Bootup brightnedd and dark theme
When booting up, the brightness of booting animation doesnt match the dark theme setting Test: UiMode tests Fixes: 148820073 Change-Id: I7c5a9e919df09e1e0adea73a602b6ee3ae0ef1d4
This commit is contained in:
@@ -302,15 +302,19 @@ final class UiModeManagerService extends SystemService {
|
||||
private final ContentObserver mDarkThemeObserver = new ContentObserver(mHandler) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange, Uri uri) {
|
||||
int mode = Secure.getIntForUser(getContext().getContentResolver(), Secure.UI_NIGHT_MODE,
|
||||
mNightMode, 0);
|
||||
if (mode == MODE_NIGHT_AUTO || mode == MODE_NIGHT_CUSTOM) {
|
||||
mode = MODE_NIGHT_YES;
|
||||
}
|
||||
SystemProperties.set(SYSTEM_PROPERTY_DEVICE_THEME, Integer.toString(mode));
|
||||
updateSystemProperties();
|
||||
}
|
||||
};
|
||||
|
||||
private void updateSystemProperties() {
|
||||
int mode = Secure.getIntForUser(getContext().getContentResolver(), Secure.UI_NIGHT_MODE,
|
||||
mNightMode, 0);
|
||||
if (mode == MODE_NIGHT_AUTO || mode == MODE_NIGHT_CUSTOM) {
|
||||
mode = MODE_NIGHT_YES;
|
||||
}
|
||||
SystemProperties.set(SYSTEM_PROPERTY_DEVICE_THEME, Integer.toString(mode));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchUser(int userHandle) {
|
||||
super.onSwitchUser(userHandle);
|
||||
@@ -392,6 +396,7 @@ final class UiModeManagerService extends SystemService {
|
||||
|
||||
context.getContentResolver().registerContentObserver(Secure.getUriFor(Secure.UI_NIGHT_MODE),
|
||||
false, mDarkThemeObserver, 0);
|
||||
updateSystemProperties();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
Reference in New Issue
Block a user