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

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

Merge "Ensure automatic battery saver won't stick" into pi-dev

parents 0c6929ec 1d146e44
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -141,8 +141,14 @@ public class BatterySaverStateMachine {
        if (DEBUG) {
            Slog.d(TAG, "onBootCompleted");
        }
        // This is called with the power manager lock held. Don't do any
        // Just booted. We don't want LOW_POWER_MODE to be persisted, so just always clear it.
        putGlobalSetting(Global.LOW_POWER_MODE, 0);

        // This is called with the power manager lock held. Don't do anything that may call to
        // upper services. (e.g. don't call into AM directly)
        // So use a BG thread.
        runOnBgThread(() -> {

            final ContentResolver cr = mContext.getContentResolver();
            cr.registerContentObserver(Settings.Global.getUriFor(
                    Settings.Global.LOW_POWER_MODE),