summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2021-10-29 16:05:08 -0700
committerFelipe Leme <felipeal@google.com>2021-10-29 16:18:04 -0700
commit97e42e278548a7ab7dca540d09dcf9049802c350 (patch)
treea7e53b44d4650481f5398992cd221326a887fcf2 /core/java/android
parente9ca4099035deaf143984ff3f915e1c451eb42a8 (diff)
Disabled some password-related APIs on automotive.
The APIs are deprecated (in favor of setRequiredPasswordComplexity()) and some automotive OEMs might not even provide the option to set passwords (just PINs and patterns). Fixes: 204252236 Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.DeprecatedPasswordAPIsTest # on automotive and phone Change-Id: I6272bdd0e893f6fd8f1d126d384d1b332e61bac2
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/admin/DevicePolicyManager.java31
1 files changed, 24 insertions, 7 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 5b01a7d2de66..d30f2eca681d 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -3437,6 +3437,9 @@ public class DevicePolicyManager {
* set on the primary {@link DevicePolicyManager} must be cleared first by calling
* {@link #setRequiredPasswordComplexity} with {@link #PASSWORD_COMPLEXITY_NONE) first.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated Prefer using {@link #setRequiredPasswordComplexity(int)}, to require a password
* that satisfies a complexity level defined by the platform, rather than specifying custom
* password requirement.
@@ -3527,12 +3530,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -3610,12 +3615,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -3700,12 +3707,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -3790,12 +3799,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -3879,12 +3890,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -3968,12 +3981,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -4056,12 +4071,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- *
* Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
* {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * <p><string>Note:</strong> this method is ignored on
+ * {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
+ *
* @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.