summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorNicolas Prevot <nprevot@google.com>2015-03-09 14:53:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-09 14:53:24 +0000
commit6dc6876eedde69376be64774e94928f1113858b6 (patch)
treeec7b2ccd240ea70ba74b33642f77791d6c5d4913 /core/java/android/app
parentee346795107d22d59a4a50b46f83c1b73d7a39ad (diff)
parent1844025738e58d9556bf875233bfee9e9ff8e4fe (diff)
downloadframeworks_base-6dc6876eedde69376be64774e94928f1113858b6.zip
frameworks_base-6dc6876eedde69376be64774e94928f1113858b6.tar.gz
frameworks_base-6dc6876eedde69376be64774e94928f1113858b6.tar.bz2
Merge "Add a new extra to specify the admin component for provisioning."
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/admin/DevicePolicyManager.java41
1 files changed, 39 insertions, 2 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index c708859..2c2328a 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -109,7 +109,11 @@ public class DevicePolicyManager {
* Provisioning adds a managed profile and sets the MDM as the profile owner who has full
* control over the profile.
*
- * <p>This intent must contain the extra {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME}.
+ * In version {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this intent must contain the
+ * extra {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME}.
+ * As of {@link android.os.Build.VERSION_CODES#MNC}, it should contain the extra
+ * {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME} instead, although specifying only
+ * {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME} is still supported.
*
* <p> When managed provisioning has completed, broadcasts are sent to the application specified
* in the provisioning intent. The
@@ -150,11 +154,36 @@ public class DevicePolicyManager {
*
* <p>This package is set as device owner when device owner provisioning is started by an NFC
* message containing an NFC record with MIME type {@link #MIME_TYPE_PROVISIONING_NFC}.
+ *
+ * <p> When this extra is set, the application must have exactly one device admin receiver.
+ * This receiver will be set as the profile or device owner and active admin.</p>
+
+ * @see DeviceAdminReceiver
+ * @deprecated Use {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME}. This extra is still
+ * supported.
*/
+ @Deprecated
public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
= "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME";
/**
+ * A ComponentName extra indicating the device admin receiver of the mobile device management
+ * application that will be set as the profile owner or device owner and active admin.
+ *
+ * <p>If an application starts provisioning directly via an intent with action
+ * {@link #ACTION_PROVISION_MANAGED_PROFILE} the package name of this component has to match the
+ * package name of the application that started provisioning.
+ *
+ * <p>This component is set as device owner and active admin when device owner provisioning is
+ * started by an NFC message containing an NFC record with MIME type
+ * {@link #MIME_TYPE_PROVISIONING_NFC}.
+ *
+ * @see DeviceAdminReceiver
+ */
+ public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME
+ = "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME";
+
+ /**
* An {@link android.accounts.Account} extra holding the account to migrate during managed
* profile provisioning. If the account supplied is present in the primary user, it will be
* copied, along with its credentials to the managed profile and removed from the primary user.
@@ -419,7 +448,6 @@ public class DevicePolicyManager {
* <p>The NFC record must contain a serialized {@link java.util.Properties} object which
* contains the following properties:
* <ul>
- * <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME}</li>
* <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION}</li>
* <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER}, optional</li>
* <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM}</li>
@@ -436,6 +464,15 @@ public class DevicePolicyManager {
* <li>{@link #EXTRA_PROVISIONING_WIFI_PAC_URL}, optional</li>
* <li>{@link #EXTRA_PROVISIONING_SKIP_ENCRYPTION}, optional</li></ul>
*
+ * <p>
+ * In version {@link android.os.Build.VERSION_CODES#LOLLIPOP}, it should also contain
+ * {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME}.
+ * As of {@link android.os.Build.VERSION_CODES#MNC}, it should contain
+ * {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME} instead, (although
+ * specifying only {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME} is still supported).
+ * This componentName must have been converted to a String via
+ * {@link android.content.ComponentName#flattenToString()}
+ *
* <p> When device owner provisioning has completed, an intent of the type
* {@link DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE} is broadcasted to the
* device owner.