diff --git a/api/current.txt b/api/current.txt index f22279b5bc167..43baf8b30b0a8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -32462,6 +32462,7 @@ package android.os { field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale"; field public static final java.lang.String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode"; field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks"; + field public static final java.lang.String DISALLOW_CONFIG_SCREEN_TIMEOUT = "no_config_screen_timeout"; field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering"; field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn"; field public static final java.lang.String DISALLOW_CONFIG_WIFI = "no_config_wifi"; diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 21974843613fe..7b0c153f52341 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -237,6 +237,20 @@ public class UserManager { */ public static final String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display"; + /** + * Specifies if a user is disallowed from changing screen off timeout. + * + *
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_CONFIG_SCREEN_TIMEOUT = "no_config_screen_timeout"; + /** * 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 50690cb0f33ec..8dd710546db5e 100644 --- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java +++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java @@ -119,7 +119,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_AIRPLANE_MODE, UserManager.DISALLOW_CONFIG_BRIGHTNESS, UserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE, - UserManager.DISALLOW_AMBIENT_DISPLAY + UserManager.DISALLOW_AMBIENT_DISPLAY, + UserManager.DISALLOW_CONFIG_SCREEN_TIMEOUT }); /**