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

Commit d7470751 authored by Kenny Guy's avatar Kenny Guy Committed by android-build-merger
Browse files

Merge "Don't treat user switch as slider interaction." into pi-dev

am: a14ad4b2

Change-Id: I4d54327e98a43b653e3f55fbd107b8d8249e132d
parents e7e8f8bd a14ad4b2
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
    }

    public void onSwitchUser(@UserIdInt int newUserId) {
        handleSettingsChange();
        handleSettingsChange(true /* userSwitch */);
        mBrightnessTracker.onSwitchUser(newUserId);
    }

@@ -1420,8 +1420,12 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        mHandler.post(mOnStateChangedRunnable);
    }

    private void handleSettingsChange() {
    private void handleSettingsChange(boolean userSwitch) {
        mPendingScreenBrightnessSetting = getScreenBrightnessSetting();
        if (userSwitch) {
            // Don't treat user switches as user initiated change.
            mCurrentScreenBrightnessSetting = mPendingScreenBrightnessSetting;
        }
        mPendingAutoBrightnessAdjustment = getAutoBrightnessAdjustmentSetting();
        // We don't bother with a pending variable for VR screen brightness since we just
        // immediately adapt to it.
@@ -1735,7 +1739,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call

        @Override
        public void onChange(boolean selfChange, Uri uri) {
            handleSettingsChange();
            handleSettingsChange(false /* userSwitch */);
        }
    }