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

Commit 61830d5f authored by ziyiw's avatar ziyiw Committed by Roshan
Browse files

[nfc] Add disallow nfc change user restriction.

Bug: 319934052
Test: compile
Merged-In: I6ac06ae394ba20d67004ec177fa0d65a6fbabdcc
Change-Id: I6ac06ae394ba20d67004ec177fa0d65a6fbabdcc
parent b2618e5b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34045,6 +34045,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
@@ -1899,6 +1899,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.
@@ -2056,6 +2081,7 @@ public class UserManager {
            DISALLOW_WIFI_DIRECT,
            DISALLOW_ADD_WIFI_CONFIG,
            DISALLOW_CELLULAR_2G,
            DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO,
            DISALLOW_ULTRA_WIDEBAND_RADIO,
            DISALLOW_GRANT_ADMIN,
            DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO,
+7 −4
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
    );

    /**
@@ -255,7 +257,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
            );

    /**