Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cefa28dc authored by Sudheer Shanka's avatar Sudheer Shanka Committed by android-build-merger
Browse files

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

am: 057bad9c

Change-Id: I536deea7b77c202b788f6d985574a9629d9bd1f1
parents 2638ae16 057bad9c
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -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);
                        }