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

Commit 2900705a authored by ziyiw's avatar ziyiw
Browse files

[nfc] Add disallow nfc change user restriction.

Bug: 319934052
Test: compile
Change-Id: I6ac06ae394ba20d67004ec177fa0d65a6fbabdcc
parent e5b74662
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34049,6 +34049,7 @@ package android.os {
    field public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
    field public static final String DISALLOW_CAMERA_TOGGLE = "disallow_camera_toggle";
    field public static final String DISALLOW_CELLULAR_2G = "no_cellular_2g";
    field @FlaggedApi("android.nfc.enable_nfc_user_restriction") public static final String DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO = "no_change_near_field_communication_radio";
    field public static final String DISALLOW_CHANGE_WIFI_STATE = "no_change_wifi_state";
    field public static final String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
    field public static final String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness";
+26 −0
Original line number Diff line number Diff line
@@ -1905,6 +1905,31 @@ public class UserManager {
    public static final String DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO =
            "no_near_field_communication_radio";

    /**
     * This user restriction specifies if Near-field communication is disallowed to change
     * on the device. If Near-field communication is disallowed it cannot be changed via Settings.
     *
     * <p>This restriction can only be set by a device owner or a profile owner of an
     * organization-owned managed profile on the parent profile.
     * In both cases, the restriction applies globally on the device and will not allow Near-field
     * communication state being changed.
     *
     * <p>
     * Near-field communication (NFC) is a radio technology that allows two devices (like your phone
     * and a payments terminal) to communicate with each other when they're close together.
     *
     * <p>Default is <code>false</code>.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    @FlaggedApi(Flags.FLAG_ENABLE_NFC_USER_RESTRICTION)
    public static final String DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO =
            "no_change_near_field_communication_radio";

    /**
     * This user restriction specifies if Thread network is disallowed on the device. If Thread
     * network is disallowed it cannot be turned on via Settings.
@@ -2006,6 +2031,7 @@ public class UserManager {
            DISALLOW_CAMERA,
            DISALLOW_CAMERA_TOGGLE,
            DISALLOW_CELLULAR_2G,
            DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO,
            DISALLOW_CHANGE_WIFI_STATE,
            DISALLOW_CONFIG_BLUETOOTH,
            DISALLOW_CONFIG_BRIGHTNESS,
+6 −3
Original line number Diff line number Diff line
@@ -156,7 +156,8 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO,
            UserManager.DISALLOW_SIM_GLOBALLY,
            UserManager.DISALLOW_ASSIST_CONTENT,
            UserManager.DISALLOW_THREAD_NETWORK
            UserManager.DISALLOW_THREAD_NETWORK,
            UserManager.DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO
    });

    public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet(
@@ -208,7 +209,8 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_CELLULAR_2G,
            UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO,
            UserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO,
            UserManager.DISALLOW_THREAD_NETWORK
            UserManager.DISALLOW_THREAD_NETWORK,
            UserManager.DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO
    );

    /**
@@ -254,7 +256,8 @@ public class UserRestrictionsUtils {
                    UserManager.DISALLOW_CELLULAR_2G,
                    UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO,
                    UserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO,
                    UserManager.DISALLOW_THREAD_NETWORK
                    UserManager.DISALLOW_THREAD_NETWORK,
                    UserManager.DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO
            );

    /**