diff --git a/api/current.txt b/api/current.txt index 029d07d763677..f22279b5bc167 100644 --- a/api/current.txt +++ b/api/current.txt @@ -32449,6 +32449,7 @@ package android.os { field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user"; field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; field public static final java.lang.String DISALLOW_AIRPLANE_MODE = "no_airplane_mode"; + field public static final java.lang.String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display"; field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps"; field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill"; field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth"; diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 60818d14d1ab6..21974843613fe 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -223,6 +223,20 @@ public class UserManager { */ public static final String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness"; + /** + * Specifies if ambient display is disallowed for the user. + * + *

The default value is false. + * + *

This user restriction has no effect on managed profiles. + *

Key for user restrictions. + *

Type: Boolean + * @see DevicePolicyManager#addUserRestriction(ComponentName, String) + * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) + * @see #getUserRestrictions() + */ + public static final String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display"; + /** * Specifies if a user is disallowed from enabling the * "Unknown Sources" setting, that allows installation of apps from unknown sources. diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java index 6964e9db464f3..50690cb0f33ec 100644 --- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java +++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java @@ -119,6 +119,7 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_AIRPLANE_MODE, UserManager.DISALLOW_CONFIG_BRIGHTNESS, UserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE, + UserManager.DISALLOW_AMBIENT_DISPLAY }); /**