Merge "Update KernelUidCpuFreqTimeReader to handle uid removals." into oc-dev
am: f34713066e
Change-Id: Ic001bfa12fecb00b24d7170c841af21531bab28a
This commit is contained in:
@@ -3525,6 +3525,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
public void removeIsolatedUidLocked(int isolatedUid) {
|
public void removeIsolatedUidLocked(int isolatedUid) {
|
||||||
mIsolatedUids.delete(isolatedUid);
|
mIsolatedUids.delete(isolatedUid);
|
||||||
mKernelUidCpuTimeReader.removeUid(isolatedUid);
|
mKernelUidCpuTimeReader.removeUid(isolatedUid);
|
||||||
|
mKernelUidCpuFreqTimeReader.removeUid(isolatedUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int mapUid(int uid) {
|
public int mapUid(int uid) {
|
||||||
@@ -10358,6 +10359,9 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
public void onUidCpuFreqTime(int uid, long[] cpuFreqTimeMs) {
|
public void onUidCpuFreqTime(int uid, long[] cpuFreqTimeMs) {
|
||||||
uid = mapUid(uid);
|
uid = mapUid(uid);
|
||||||
if (Process.isIsolated(uid)) {
|
if (Process.isIsolated(uid)) {
|
||||||
|
mKernelUidCpuFreqTimeReader.removeUid(uid);
|
||||||
|
Slog.d(TAG, "Got freq readings for an isolated uid with"
|
||||||
|
+ " no mapping to owning uid: " + uid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Uid u = getUidStatsLocked(uid);
|
final Uid u = getUidStatsLocked(uid);
|
||||||
@@ -11026,6 +11030,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
*/
|
*/
|
||||||
public void removeUidStatsLocked(int uid) {
|
public void removeUidStatsLocked(int uid) {
|
||||||
mKernelUidCpuTimeReader.removeUid(uid);
|
mKernelUidCpuTimeReader.removeUid(uid);
|
||||||
|
mKernelUidCpuFreqTimeReader.removeUid(uid);
|
||||||
mUidStats.remove(uid);
|
mUidStats.remove(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ public class KernelUidCpuFreqTimeReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeUid(int uid) {
|
||||||
|
mLastUidCpuFreqTimeMs.delete(uid);
|
||||||
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public void readDelta(BufferedReader reader, @Nullable Callback callback) throws IOException {
|
public void readDelta(BufferedReader reader, @Nullable Callback callback) throws IOException {
|
||||||
String line = reader.readLine();
|
String line = reader.readLine();
|
||||||
|
|||||||
Reference in New Issue
Block a user