Loading core/java/android/app/admin/DevicePolicyManager.java +24 −7 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +18 −7 Original line number Diff line number Diff line Loading @@ -3844,9 +3844,17 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } private boolean notSupportedOnAutomotive(String method) { if (mIsAutomotive) { Slogf.i(LOG_TAG, "%s is not supported on automotive builds", method); return true; } return false; } @Override public void setPasswordQuality(ComponentName who, int quality, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordQuality")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4081,7 +4089,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumLength(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumLength")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4363,7 +4371,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumUpperCase(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumUpperCase")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4396,6 +4404,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumLowerCase(ComponentName who, int length, boolean parent) { if (notSupportedOnAutomotive("setPasswordMinimumLowerCase")) { return; } Objects.requireNonNull(who, "ComponentName is null"); final int userId = mInjector.userHandleGetCallingUserId(); synchronized (getLockObject()) { Loading Loading @@ -4426,7 +4437,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumLetters(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumLetters")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4458,7 +4469,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumNumeric(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumNumeric")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4490,7 +4501,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumSymbols(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumSymbols")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4522,7 +4533,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumNonLetter(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumNonLetter")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +24 −7 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading Loading @@ -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. Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +18 −7 Original line number Diff line number Diff line Loading @@ -3844,9 +3844,17 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } private boolean notSupportedOnAutomotive(String method) { if (mIsAutomotive) { Slogf.i(LOG_TAG, "%s is not supported on automotive builds", method); return true; } return false; } @Override public void setPasswordQuality(ComponentName who, int quality, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordQuality")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4081,7 +4089,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumLength(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumLength")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4363,7 +4371,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumUpperCase(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumUpperCase")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4396,6 +4404,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumLowerCase(ComponentName who, int length, boolean parent) { if (notSupportedOnAutomotive("setPasswordMinimumLowerCase")) { return; } Objects.requireNonNull(who, "ComponentName is null"); final int userId = mInjector.userHandleGetCallingUserId(); synchronized (getLockObject()) { Loading Loading @@ -4426,7 +4437,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumLetters(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumLetters")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4458,7 +4469,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumNumeric(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumNumeric")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4490,7 +4501,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumSymbols(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumSymbols")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading Loading @@ -4522,7 +4533,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override public void setPasswordMinimumNonLetter(ComponentName who, int length, boolean parent) { if (!mHasFeature) { if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumNonLetter")) { return; } Objects.requireNonNull(who, "ComponentName is null"); Loading