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

Commit ea87a4bc authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Ignore entries for isolated uids if there's no mapping for them.

Bug: 25195548
Test: manual
Change-Id: If5aa7e194f4d43f2a7068899b9aa6584bfb2b7cc
parent a2f747c5
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);
                        }