summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Roshan Pius <rpius@google.com> 2023-08-24 20:51:58 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-08-24 20:51:58 +0000
commit1ef44a6d86652227510848b814db7ce6bd0ecb34 (patch)
treedd8e0acd7acd3bcca8d689562f064329c6aa9e67
parentcd3af1d83c6143a5e4ea723f2b6e2611078d1697 (diff)
parent2e7559900631794105d6a6d7b5365a539f44c723 (diff)
Merge "Implement DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO AE user restriction" into udc-dev-plus-aosp am: 2e75599006
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24528498 Change-Id: Iba8b3cd0415e477dab25ba225738a1541159e17a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--core/api/current.txt1
-rw-r--r--core/java/android/os/UserManager.java26
-rw-r--r--services/core/java/com/android/server/pm/UserRestrictionsUtils.java9
3 files changed, 33 insertions, 3 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index e37beb3abd14..02be7726eca4 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -33955,6 +33955,7 @@ package android.os {
field public static final String DISALLOW_MICROPHONE_TOGGLE = "disallow_microphone_toggle";
field public static final String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts";
field public static final String DISALLOW_MOUNT_PHYSICAL_MEDIA = "no_physical_media";
+ field public static final String DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO = "no_near_field_communication_radio";
field public static final String DISALLOW_NETWORK_RESET = "no_network_reset";
field public static final String DISALLOW_OUTGOING_BEAM = "no_outgoing_beam";
field public static final String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 84f1880213b8..cf8e875c1644 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -1810,6 +1810,31 @@ public class UserManager {
public static final String DISALLOW_ULTRA_WIDEBAND_RADIO = "no_ultra_wideband_radio";
/**
+ * This user restriction specifies if Near-field communication is disallowed on the device. If
+ * Near-field communication is disallowed it cannot be turned on 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 turn off the
+ * Near-field communication radio if it's currently on and prevent the radio from being turned
+ * on in the future.
+ *
+ * <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()
+ */
+ public static final String DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO =
+ "no_near_field_communication_radio";
+
+ /**
* List of key values that can be passed into the various user restriction related methods
* in {@link UserManager} & {@link DevicePolicyManager}.
* Note: This is slightly different from the real set of user restrictions listed in {@link
@@ -1893,6 +1918,7 @@ public class UserManager {
DISALLOW_CELLULAR_2G,
DISALLOW_ULTRA_WIDEBAND_RADIO,
DISALLOW_GRANT_ADMIN,
+ DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO,
})
@Retention(RetentionPolicy.SOURCE)
public @interface UserRestrictionKey {}
diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
index 8815834f6b5c..4e2ceab290d4 100644
--- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
+++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
@@ -151,7 +151,8 @@ public class UserRestrictionsUtils {
UserManager.DISALLOW_ADD_WIFI_CONFIG,
UserManager.DISALLOW_CELLULAR_2G,
UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO,
- UserManager.DISALLOW_CONFIG_DEFAULT_APPS
+ UserManager.DISALLOW_CONFIG_DEFAULT_APPS,
+ UserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO
});
public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet(
@@ -201,7 +202,8 @@ public class UserRestrictionsUtils {
UserManager.DISALLOW_WIFI_DIRECT,
UserManager.DISALLOW_ADD_WIFI_CONFIG,
UserManager.DISALLOW_CELLULAR_2G,
- UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO
+ UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO,
+ UserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO
);
/**
@@ -243,7 +245,8 @@ public class UserRestrictionsUtils {
UserManager.DISALLOW_WIFI_DIRECT,
UserManager.DISALLOW_ADD_WIFI_CONFIG,
UserManager.DISALLOW_CELLULAR_2G,
- UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO
+ UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO,
+ UserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO
);
/**