Merge "Do not update nightmode from settings for car" into rvc-qpr-dev am: 98b5abf507
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12484420 Change-Id: Id3cddc3feaf5143d8af7412de848785224a383a7
This commit is contained in:
@@ -485,6 +485,9 @@ final class UiModeManagerService extends SystemService {
|
|||||||
* @return True if the new value is different from the old value. False otherwise.
|
* @return True if the new value is different from the old value. False otherwise.
|
||||||
*/
|
*/
|
||||||
private boolean updateNightModeFromSettingsLocked(Context context, Resources res, int userId) {
|
private boolean updateNightModeFromSettingsLocked(Context context, Resources res, int userId) {
|
||||||
|
if (mCarModeEnabled || mCar) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
int oldNightMode = mNightMode;
|
int oldNightMode = mNightMode;
|
||||||
if (mSetupWizardComplete) {
|
if (mSetupWizardComplete) {
|
||||||
mNightMode = Secure.getIntForUser(context.getContentResolver(),
|
mNightMode = Secure.getIntForUser(context.getContentResolver(),
|
||||||
@@ -1015,7 +1018,7 @@ final class UiModeManagerService extends SystemService {
|
|||||||
|
|
||||||
private void persistNightMode(int user) {
|
private void persistNightMode(int user) {
|
||||||
// Only persist setting if not in car mode
|
// Only persist setting if not in car mode
|
||||||
if (mCarModeEnabled) return;
|
if (mCarModeEnabled || mCar) return;
|
||||||
Secure.putIntForUser(getContext().getContentResolver(),
|
Secure.putIntForUser(getContext().getContentResolver(),
|
||||||
Secure.UI_NIGHT_MODE, mNightMode, user);
|
Secure.UI_NIGHT_MODE, mNightMode, user);
|
||||||
Secure.putLongForUser(getContext().getContentResolver(),
|
Secure.putLongForUser(getContext().getContentResolver(),
|
||||||
@@ -1028,7 +1031,7 @@ final class UiModeManagerService extends SystemService {
|
|||||||
|
|
||||||
private void persistNightModeOverrides(int user) {
|
private void persistNightModeOverrides(int user) {
|
||||||
// Only persist setting if not in car mode
|
// Only persist setting if not in car mode
|
||||||
if (mCarModeEnabled) return;
|
if (mCarModeEnabled || mCar) return;
|
||||||
Secure.putIntForUser(getContext().getContentResolver(),
|
Secure.putIntForUser(getContext().getContentResolver(),
|
||||||
Secure.UI_NIGHT_MODE_OVERRIDE_ON, mOverrideNightModeOn ? 1 : 0, user);
|
Secure.UI_NIGHT_MODE_OVERRIDE_ON, mOverrideNightModeOn ? 1 : 0, user);
|
||||||
Secure.putIntForUser(getContext().getContentResolver(),
|
Secure.putIntForUser(getContext().getContentResolver(),
|
||||||
@@ -1079,7 +1082,7 @@ final class UiModeManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override night mode in power save mode if not in car mode
|
// 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_NO;
|
||||||
uiMode |= Configuration.UI_MODE_NIGHT_YES;
|
uiMode |= Configuration.UI_MODE_NIGHT_YES;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user