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

Commit 1d65ea4e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use the background thread instead ActivityManager to update CPU stats."

parents 8426a065 c2d02b52
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -337,6 +337,9 @@ public class BatteryStatsImpl extends BatteryStats {
    private final PlatformIdleStateCallback mPlatformIdleStateCallback;
    /**
     * This handler is running on {@link BackgroundThread}.
     */
    final class MyHandler extends Handler {
        public MyHandler(Looper looper) {
            super(looper, null, true);
+2 −1
Original line number Diff line number Diff line
@@ -2381,7 +2381,8 @@ public class ActivityManagerService extends IActivityManager.Stub
        final File systemDir = SystemServiceManager.ensureSystemDir();
        // TODO: Move creation of battery stats service outside of activity manager service.
        mBatteryStatsService = new BatteryStatsService(systemContext, systemDir, mHandler);
        mBatteryStatsService = new BatteryStatsService(systemContext, systemDir,
                BackgroundThread.get().getHandler());
        mBatteryStatsService.getActiveStatistics().readLocked();
        mBatteryStatsService.scheduleWriteToDisk();
        mOnBattery = DEBUG_POWER ? true