The callback methods, like the base + * {@link BroadcastReceiver#onReceive(Context, Intent) BroadcastReceiver.onReceive()} + * method, happen on the main thread of the process. Thus long running + * operations must be done on another thread. Note that because a receiver + * is done once returning from its receive function, such long-running operations + * should probably be done in a {@link Service}. + * *
When publishing your DeviceAdmin subclass as a receiver, it must * handle {@link #ACTION_DEVICE_ADMIN_ENABLED} and require the * {@link android.Manifest.permission#BIND_DEVICE_ADMIN} permission. A typical @@ -42,7 +49,7 @@ import android.os.Bundle; * * {@sample development/samples/ApiDemos/res/xml/device_admin_sample.xml meta_data} */ -public class DeviceAdmin extends BroadcastReceiver { +public class DeviceAdminReceiver extends BroadcastReceiver { private static String TAG = "DevicePolicy"; private static boolean DEBUG = false; private static boolean localLOGV = DEBUG || android.util.Config.LOGV; @@ -51,7 +58,7 @@ public class DeviceAdmin extends BroadcastReceiver { * This is the primary action that a device administrator must implement to be * allowed to manage a device. This will be set to the receiver * when the user enables it for administration. You will generally - * handle this in {@link DeviceAdmin#onEnabled(Context, Intent)}. To be + * handle this in {@link DeviceAdminReceiver#onEnabled(Context, Intent)}. To be * supported, the receiver must also require the * {@link android.Manifest.permission#BIND_DEVICE_ADMIN} permission so * that other applications can not abuse it. @@ -85,7 +92,7 @@ public class DeviceAdmin extends BroadcastReceiver { * Action sent to a device administrator when the user has disabled * it. Upon return, the application no longer has access to the * protected device policy manager APIs. You will generally - * handle this in {@link DeviceAdmin#onDisabled(Context, Intent)}. Note + * handle this in {@link DeviceAdminReceiver#onDisabled(Context, Intent)}. Note * that this action will be * sent the receiver regardless of whether it is explicitly listed in * its intent filter. @@ -100,7 +107,7 @@ public class DeviceAdmin extends BroadcastReceiver { * of the new password with {@link DevicePolicyManager#isActivePasswordSufficient() * DevicePolicyManager.isActivePasswordSufficient()}. * You will generally - * handle this in {@link DeviceAdmin#onPasswordChanged}. + * handle this in {@link DeviceAdminReceiver#onPasswordChanged}. * *
The calling device admin must have requested * {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to receive @@ -116,7 +123,7 @@ public class DeviceAdmin extends BroadcastReceiver { * number of failed password attempts there have been with * {@link DevicePolicyManager#getCurrentFailedPasswordAttempts * DevicePolicyManager.getCurrentFailedPasswordAttempts()}. You will generally - * handle this in {@link DeviceAdmin#onPasswordFailed}. + * handle this in {@link DeviceAdminReceiver#onPasswordFailed}. * *
The calling device admin must have requested * {@link DeviceAdminInfo#USES_POLICY_WATCH_LOGIN} to receive diff --git a/core/java/android/app/DevicePolicyManager.java b/core/java/android/app/DevicePolicyManager.java index 82c43dc18ae9b..d611807c74dce 100644 --- a/core/java/android/app/DevicePolicyManager.java +++ b/core/java/android/app/DevicePolicyManager.java @@ -36,7 +36,7 @@ import java.util.List; /** * Public interface for managing policies enforced on a device. Most clients - * of this class must have published a {@link DeviceAdmin} that the user + * of this class must have published a {@link DeviceAdminReceiver} that the user * has currently enabled. */ public class DevicePolicyManager { @@ -195,7 +195,7 @@ 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. * - * @param admin Which {@link DeviceAdmin} this request is associated with. + * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param quality The new desired quality. One of * {@link #PASSWORD_QUALITY_UNSPECIFIED}, {@link #PASSWORD_QUALITY_SOMETHING}, * {@link #PASSWORD_QUALITY_NUMERIC}, or {@link #PASSWORD_QUALITY_ALPHANUMERIC}. @@ -243,7 +243,7 @@ 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. * - * @param admin Which {@link DeviceAdmin} this request is associated with. + * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param length The new desired minimum password length. A value of 0 * means there is no restriction. */ @@ -338,11 +338,11 @@ public class DevicePolicyManager { *
To implement any other policy (e.g. wiping data for a particular
* application only, erasing or revoking credentials, or reporting the
* failure to a server), you should implement
- * {@link DeviceAdmin#onPasswordFailed(Context, android.content.Intent)}
+ * {@link DeviceAdminReceiver#onPasswordFailed(Context, android.content.Intent)}
* instead. Do not use this API, because if the maximum count is reached,
* the device will be wiped immediately, and your callback will not be invoked.
*
- * @param admin Which {@link DeviceAdmin} this request is associated with.
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param num The number of failed password attempts at which point the
* device will wipe its data.
*/
@@ -375,7 +375,9 @@ public class DevicePolicyManager {
}
/**
- * Force a new password on the user. This takes effect immediately.
+ * 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.
* The given password must be sufficient for the
* current password quality and length constraints as returned by
* {@link #getPasswordQuality(ComponentName)} and
@@ -413,7 +415,7 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_FORCE_LOCK} to be able to call
* this method; if it has not, a security exception will be thrown.
*
- * @param admin Which {@link DeviceAdmin} this request is associated with.
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param timeMs The new desired maximum time to lock in milliseconds.
* A value of 0 means there is no restriction.
*/
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 70bc0000fbcd9..33b509bd1fc75 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -83,7 +83,7 @@
never be encrypted if an Encrypted File System solution
is enabled. Specifically, this is an "opt-out" feature, meaning
that, by default, user data will be encrypted if the EFS feature
- is enabled.-->
+ is enabled. -->