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

Commit 57c297d1 authored by Beverly's avatar Beverly Committed by android-build-team Robot
Browse files

Don't persist new night mode setting in car mode

Keep persist.sys.theme in sync with the primary user's
setting value UI_NIGHT_MODE

Test: manual
Fixes: 137174308
Change-Id: I8df67e0734b08bd82418e381d153d9012ecf99e4
(cherry picked from commit 47a775b6)
(cherry picked from commit 98288b3e)
parent 5f06dfc1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -413,15 +413,15 @@ final class UiModeManagerService extends SystemService {
            try {
                synchronized (mLock) {
                    if (mNightMode != mode) {
                        if (UserManager.get(getContext()).isPrimaryUser()) {
                            SystemProperties.set(SYSTEM_PROPERTY_DEVICE_THEME,
                                    Integer.toString(mode));
                        }

                        // Only persist setting if not in car mode
                        if (!mCarModeEnabled) {
                            Secure.putIntForUser(getContext().getContentResolver(),
                                    Secure.UI_NIGHT_MODE, mode, user);

                            if (UserManager.get(getContext()).isPrimaryUser()) {
                                SystemProperties.set(SYSTEM_PROPERTY_DEVICE_THEME,
                                        Integer.toString(mode));
                            }
                        }

                        mNightMode = mode;