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

Commit 8e4129a6 authored by Keun young Park's avatar Keun young Park
Browse files

Add mCar check to some mCarModeEnabled checks

- mCarModeEnabled means car dock mode which is not enabled in actual car
  (=mCar is true)
- Add mCar check for some mCarModeEnabled check places:
  pesistenting / restoring night mode
  do not go to power saving mode
- There was this mistake in previos CL while updating last patch

Bug: 155167849
Test: run user switching with night mode set
Change-Id: Ia67d96c7b6c5842671004b377f540623243c2c2b
parent 47a1c324
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ final class UiModeManagerService extends SystemService {
     * @return True if the new value is different from the old value. False otherwise.
     */
    private boolean updateNightModeFromSettingsLocked(Context context, Resources res, int userId) {
        if (mCarModeEnabled) {
        if (mCarModeEnabled || mCar) {
            return false;
        }
        int oldNightMode = mNightMode;
@@ -1036,7 +1036,7 @@ final class UiModeManagerService extends SystemService {

    private void persistNightMode(int user) {
        // Only persist setting if not in car mode
        if (mCarModeEnabled) return;
        if (mCarModeEnabled || mCar) return;
        Secure.putIntForUser(getContext().getContentResolver(),
                Secure.UI_NIGHT_MODE, mNightMode, user);
        Secure.putLongForUser(getContext().getContentResolver(),
@@ -1049,7 +1049,7 @@ final class UiModeManagerService extends SystemService {

    private void persistNightModeOverrides(int user) {
        // Only persist setting if not in car mode
        if (mCarModeEnabled) return;
        if (mCarModeEnabled || mCar) return;
        Secure.putIntForUser(getContext().getContentResolver(),
                Secure.UI_NIGHT_MODE_OVERRIDE_ON, mOverrideNightModeOn ? 1 : 0, user);
        Secure.putIntForUser(getContext().getContentResolver(),
@@ -1100,7 +1100,7 @@ final class UiModeManagerService extends SystemService {
        }

        // Override night mode in power save mode if not in car mode
        if (mPowerSave && !mCarModeEnabled) {
        if (mPowerSave && !mCarModeEnabled && !mCar) {
            uiMode &= ~Configuration.UI_MODE_NIGHT_NO;
            uiMode |= Configuration.UI_MODE_NIGHT_YES;
        } else {