Merge "Turn off ambient settings when DISALLOW_AMBIENT_DISPLAY is set."
This commit is contained in:
committed by
Android (Google) Code Review
commit
0dea6c9eab
@@ -1647,6 +1647,15 @@ public class SettingsProvider extends ContentProvider {
|
||||
restriction = UserManager.DISALLOW_AIRPLANE_MODE;
|
||||
break;
|
||||
|
||||
case Settings.Secure.DOZE_ENABLED:
|
||||
case Settings.Secure.DOZE_ALWAYS_ON:
|
||||
case Settings.Secure.DOZE_PULSE_ON_PICK_UP:
|
||||
case Settings.Secure.DOZE_PULSE_ON_LONG_PRESS:
|
||||
case Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP:
|
||||
if ("0".equals(value)) return false;
|
||||
restriction = UserManager.DISALLOW_AMBIENT_DISPLAY;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) {
|
||||
if ("0".equals(value)) return false;
|
||||
|
||||
@@ -561,6 +561,25 @@ public class UserRestrictionsUtils {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case UserManager.DISALLOW_AMBIENT_DISPLAY:
|
||||
if (newValue) {
|
||||
android.provider.Settings.Secure.putString(
|
||||
context.getContentResolver(),
|
||||
Settings.Secure.DOZE_ENABLED, "0");
|
||||
android.provider.Settings.Secure.putString(
|
||||
context.getContentResolver(),
|
||||
Settings.Secure.DOZE_ALWAYS_ON, "0");
|
||||
android.provider.Settings.Secure.putString(
|
||||
context.getContentResolver(),
|
||||
Settings.Secure.DOZE_PULSE_ON_PICK_UP, "0");
|
||||
android.provider.Settings.Secure.putString(
|
||||
context.getContentResolver(),
|
||||
Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, "0");
|
||||
android.provider.Settings.Secure.putString(
|
||||
context.getContentResolver(),
|
||||
Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP, "0");
|
||||
}
|
||||
break;
|
||||
}
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(id);
|
||||
|
||||
Reference in New Issue
Block a user