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

Commit 14d34c1f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove updateUsageBatteryStats in dump due to ANR" into main am: 67dcd28a

parents 32ebf15c 67dcd28a
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -818,8 +818,10 @@ final class AppBatteryTracker extends BaseAppStateTracker<AppBatteryPolicy>
    void dump(PrintWriter pw, String prefix) {
        pw.print(prefix);
        pw.println("APP BATTERY STATE TRACKER:");
        if (mInjector.getActivityManagerInternal().isBooted()) {
            // Force an update.
            updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
        }
        // Force a check.
        scheduleBgBatteryUsageStatsCheck();
        // Wait for its completion (as it runs in handler thread for the sake of thread safe)
@@ -878,8 +880,10 @@ final class AppBatteryTracker extends BaseAppStateTracker<AppBatteryPolicy>

    @Override
    void dumpAsProto(ProtoOutputStream proto, int uid) {
        if (mInjector.getActivityManagerInternal().isBooted()) {
            // Force an update.
            updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
        }
        synchronized (mLock) {
            final SparseArray<ImmutableBatteryUsage> uidConsumers = mUidBatteryUsageInWindow;
            if (uid != android.os.Process.INVALID_UID) {