diff options
author | Andrei Kapishnikov <kapishnikov@google.com> | 2015-04-21 16:38:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-21 16:38:06 +0000 |
commit | 8d505ff025f16715d47f97d0f74a0cbba6c6391d (patch) | |
tree | e39c8903b10db812876f8caa0ff101c09ac4549f /core/java/android/app | |
parent | 2099ee8ab574181627b9dac81e1ec4f3f80bce05 (diff) | |
parent | 4eb6a36922f5e98fe181c0326cc5721f0e7589ca (diff) | |
download | frameworks_base-8d505ff025f16715d47f97d0f74a0cbba6c6391d.zip frameworks_base-8d505ff025f16715d47f97d0f74a0cbba6c6391d.tar.gz frameworks_base-8d505ff025f16715d47f97d0f74a0cbba6c6391d.tar.bz2 |
Merge "Introduced DO_NOT_ASK_CREDENTIALS_ON_BOOT flag"
Diffstat (limited to 'core/java/android/app')
-rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 30 | ||||
-rw-r--r-- | core/java/android/app/admin/IDevicePolicyManager.aidl | 1 |
2 files changed, 30 insertions, 1 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 35b8a8e..9e2da61 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -1635,6 +1635,23 @@ public class DevicePolicyManager { } /** + * Queries whether {@link #DO_NOT_ASK_CREDENTIALS_ON_BOOT} flag is set. + * + * @return true if DO_NOT_ASK_CREDENTIALS_ON_BOOT flag is set. + * @hide + */ + public boolean getDoNotAskCredentialsOnBoot() { + if (mService != null) { + try { + return mService.getDoNotAskCredentialsOnBoot(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call getDoNotAskCredentialsOnBoot()", e); + } + } + return false; + } + + /** * Setting this to a value greater than zero enables a built-in policy * that will perform a device wipe after too many incorrect * device-unlock passwords have been entered. This built-in policy combines @@ -1711,6 +1728,16 @@ public class DevicePolicyManager { public static final int RESET_PASSWORD_REQUIRE_ENTRY = 0x0001; /** + * Flag for {@link #resetPassword}: don't ask for user credentials on device boot. + * If the flag is set, the device can be booted without asking for user password. + * The absence of this flag does not change the current boot requirements. This flag + * can be set by the device owner only. If the app is not the device owner, the flag + * is ignored. Once the flag is set, it cannot be reverted back without resetting the + * device to factory defaults. + */ + public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 0x0002; + + /** * Force a new device unlock password (the password needed to access the * entire device, not for individual accounts) on the user. This takes * effect immediately. @@ -1733,7 +1760,8 @@ public class DevicePolicyManager { * <p>Calling this from a managed profile will throw a security exception. * * @param password The new password for the user. Null or empty clears the password. - * @param flags May be 0 or {@link #RESET_PASSWORD_REQUIRE_ENTRY}. + * @param flags May be 0 or combination of {@link #RESET_PASSWORD_REQUIRE_ENTRY} and + * {@link #DO_NOT_ASK_CREDENTIALS_ON_BOOT}. * @return Returns true if the password was applied, or false if it is * not acceptable for the current constraints. */ diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl index 48ed45b..1f7498e 100644 --- a/core/java/android/app/admin/IDevicePolicyManager.aidl +++ b/core/java/android/app/admin/IDevicePolicyManager.aidl @@ -224,4 +224,5 @@ interface IDevicePolicyManager { boolean setKeyguardEnabledState(in ComponentName admin, boolean enabled); void setStatusBarEnabledState(in ComponentName who, boolean enabled); + boolean getDoNotAskCredentialsOnBoot(); } |