Merge "Ignore entries for isolated uids if there's no mapping for them." into oc-dev

This commit is contained in:
Sudheer Shanka
2017-06-05 21:22:32 +00:00
committed by Android (Google) Code Review

View File

@@ -10175,7 +10175,16 @@ public class BatteryStatsImpl extends BatteryStats {
new KernelUidCpuTimeReader.Callback() {
@Override
public void onUidCpuTime(int uid, long userTimeUs, long systemTimeUs) {
final Uid u = getUidStatsLocked(mapUid(uid));
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
// This could happen if the isolated uid mapping was removed before
// that process was actually killed.
mKernelUidCpuTimeReader.removeUid(uid);
Slog.d(TAG, "Got readings for an isolated uid with"
+ " no mapping to owning uid: " + uid);
return;
}
final Uid u = getUidStatsLocked(uid);
// Accumulate the total system and user time.
mTempTotalCpuUserTimeUs += userTimeUs;
@@ -10340,7 +10349,11 @@ public class BatteryStatsImpl extends BatteryStats {
@Override
public void onUidCpuFreqTime(int uid, long[] cpuFreqTimeMs) {
final Uid u = getUidStatsLocked(mapUid(uid));
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
return;
}
final Uid u = getUidStatsLocked(uid);
if (u.mCpuFreqTimeMs == null) {
u.mCpuFreqTimeMs = new LongSamplingCounterArray(mOnBatteryTimeBase);
}