Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fe75dc2 authored by yuemingw's avatar yuemingw Committed by Yueming Wang
Browse files

Add DISALLOW_AIRPLANE_MODE.

Bug: 67675441
Test: cts test will be added for b/67675455

Design doc: https://docs.google.com/document/d/1rvEg5jE3lMhjH-OA0iTLBUY2opM96fg7BrP81MoPnmg/edit#

Change-Id: I902b281695a7e734639c9d6d4852a0e96fea8305
parent 7cc2c4c2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32270,6 +32270,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    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_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";
+15 −0
Original line number Diff line number Diff line
@@ -193,6 +193,21 @@ public class UserManager {
     */
    public static final String DISALLOW_SHARE_LOCATION = "no_share_location";

    /**
     * Specifies if airplane mode is disallowed on the device.
     *
     * <p> This restriction can only be set by the device owner and the profile owner on the
     * primary user and it applies globally - i.e. it disables airplane mode on the entire device.
     * <p>The default value is <code>false</code>.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_AIRPLANE_MODE = "no_airplane_mode";

    /**
     * Specifies if a user is disallowed from enabling the
     * "Unknown Sources" setting, that allows installation of apps from unknown sources.
+6 −3
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_AUTOFILL,
            UserManager.DISALLOW_USER_SWITCH,
            UserManager.DISALLOW_UNIFIED_PASSWORD,
            UserManager.DISALLOW_CONFIG_LOCATION_MODE
            UserManager.DISALLOW_CONFIG_LOCATION_MODE,
            UserManager.DISALLOW_AIRPLANE_MODE
    });

    /**
@@ -143,7 +144,8 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_FUN,
            UserManager.DISALLOW_SAFE_BOOT,
            UserManager.DISALLOW_CREATE_WINDOWS,
            UserManager.DISALLOW_DATA_ROAMING
            UserManager.DISALLOW_DATA_ROAMING,
            UserManager.DISALLOW_AIRPLANE_MODE
    );

    /**
@@ -198,7 +200,8 @@ public class UserRestrictionsUtils {
     * Special user restrictions that are always applied to all users no matter who sets them.
     */
    private static final Set<String> PROFILE_GLOBAL_RESTRICTIONS = Sets.newArraySet(
            UserManager.ENSURE_VERIFY_APPS
            UserManager.ENSURE_VERIFY_APPS,
            UserManager.DISALLOW_AIRPLANE_MODE
    );

    /**