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 47a775b67d)
This commit is contained in:
@@ -413,15 +413,15 @@ final class UiModeManagerService extends SystemService {
|
|||||||
try {
|
try {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (mNightMode != mode) {
|
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
|
// Only persist setting if not in car mode
|
||||||
if (!mCarModeEnabled) {
|
if (!mCarModeEnabled) {
|
||||||
Secure.putIntForUser(getContext().getContentResolver(),
|
Secure.putIntForUser(getContext().getContentResolver(),
|
||||||
Secure.UI_NIGHT_MODE, mode, user);
|
Secure.UI_NIGHT_MODE, mode, user);
|
||||||
|
|
||||||
|
if (UserManager.get(getContext()).isPrimaryUser()) {
|
||||||
|
SystemProperties.set(SYSTEM_PROPERTY_DEVICE_THEME,
|
||||||
|
Integer.toString(mode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mNightMode = mode;
|
mNightMode = mode;
|
||||||
|
|||||||
Reference in New Issue
Block a user