summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/app/DeviceAdmin.java2
-rw-r--r--core/java/android/app/DevicePolicyManager.java18
2 files changed, 13 insertions, 7 deletions
diff --git a/core/java/android/app/DeviceAdmin.java b/core/java/android/app/DeviceAdmin.java
index ecbad012f829..af9c379deb19 100644
--- a/core/java/android/app/DeviceAdmin.java
+++ b/core/java/android/app/DeviceAdmin.java
@@ -40,7 +40,7 @@ import android.os.Bundle;
* to the device administrator, as parsed by the {@link DeviceAdminInfo} class.
* A typical file would be:</p>
*
- * {@sample development/samples/ApiDemos/res/xml/sample_device_admin.xml meta_data}
+ * {@sample development/samples/ApiDemos/res/xml/device_admin_sample.xml meta_data}
*/
public class DeviceAdmin extends BroadcastReceiver {
private static String TAG = "DevicePolicy";
diff --git a/core/java/android/app/DevicePolicyManager.java b/core/java/android/app/DevicePolicyManager.java
index 08cdd0511d4b..847e879e1885 100644
--- a/core/java/android/app/DevicePolicyManager.java
+++ b/core/java/android/app/DevicePolicyManager.java
@@ -328,14 +328,20 @@ public class DevicePolicyManager {
}
/**
- * Set the maximum number of failed password attempts that are allowed
- * before the device wipes its data. This is convenience for implementing
- * the corresponding functionality with a combination of watching failed
- * password attempts and calling {@link #wipeData} upon reaching a certain
- * count, and as such requires that you request both
- * {@link DeviceAdminInfo#USES_POLICY_WATCH_LOGIN} and
+ * 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
+ * watching for failed passwords and wiping the device, and requires
+ * that you request both {@link DeviceAdminInfo#USES_POLICY_WATCH_LOGIN} and
* {@link DeviceAdminInfo#USES_POLICY_WIPE_DATA}}.
*
+ * <p>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)}
+ * 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 num The number of failed password attempts at which point the
* device will wipe its data.