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

Commit 67dcd28a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Remove updateUsageBatteryStats in dump due to ANR" into main

parents 9e3206da 6834b1e7
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) {