Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f72078bd authored by Jessica Hummel's avatar Jessica Hummel
Browse files

Move the provisioning intents to DevicePolicyManager.

Change-Id: Ibde867b193e64c1fda8d9c84b0d1be36a1592035
parent 54904603
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4741,7 +4741,7 @@ package android.app.admin {
    field public static final java.lang.String ACTION_PASSWORD_EXPIRING = "android.app.action.ACTION_PASSWORD_EXPIRING";
    field public static final java.lang.String ACTION_PASSWORD_FAILED = "android.app.action.ACTION_PASSWORD_FAILED";
    field public static final java.lang.String ACTION_PASSWORD_SUCCEEDED = "android.app.action.ACTION_PASSWORD_SUCCEEDED";
    field public static final java.lang.String ACTION_PROFILE_PROVISIONING_COMPLETE = "android.managedprovisioning.ACTION_PROVISIONING_COMPLETE";
    field public static final java.lang.String ACTION_PROFILE_PROVISIONING_COMPLETE = "android.app.action.ACTION_PROFILE_PROVISIONING_COMPLETE";
    field public static final java.lang.String DEVICE_ADMIN_META_DATA = "android.app.device_admin";
    field public static final java.lang.String EXTRA_DISABLE_WARNING = "android.app.extra.DISABLE_WARNING";
  }
@@ -4794,6 +4794,7 @@ package android.app.admin {
    method public int setStorageEncryption(android.content.ComponentName, boolean);
    method public void wipeData(int);
    field public static final java.lang.String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.managedprovisioning.ACTION_PROVISION_MANAGED_PROFILE";
    field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD";
    field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
@@ -4802,6 +4803,8 @@ package android.app.admin {
    field public static final int ENCRYPTION_STATUS_UNSUPPORTED = 0; // 0x0
    field public static final java.lang.String EXTRA_ADD_EXPLANATION = "android.app.extra.ADD_EXPLANATION";
    field public static final java.lang.String EXTRA_DEVICE_ADMIN = "android.app.extra.DEVICE_ADMIN";
    field public static final java.lang.String EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME = "defaultManagedProfileName";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME = "deviceAdminPackageName";
    field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
    field public static final int KEYGUARD_DISABLE_FEATURES_NONE = 0; // 0x0
    field public static final int KEYGUARD_DISABLE_SECURE_CAMERA = 2; // 0x2
+12 −4
Original line number Diff line number Diff line
@@ -164,13 +164,21 @@ public class DeviceAdminReceiver extends BroadcastReceiver {
    public static final String ACTION_PASSWORD_EXPIRING
            = "android.app.action.ACTION_PASSWORD_EXPIRING";


    /**
     * Action broadcasted when provisioning of a managed profile has completed.
     * Broadcast Action: This broadcast is sent to the newly created profile when
     * the provisioning of a managed profile has completed successfully.
     *
     * <p>The broadcast is limited to the package which started the provisioning as specified in
     * the extra {@link DevicePolicyManager#EXTRA_PROVISIONING_MDM_PACKAGE_NAME} of the
     * {@link DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE} intent that started the
     * provisioning. It is also limited to the managed profile.
     *
     * <p>Input: Nothing.</p>
     * <p>Output: Nothing</p>
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_PROFILE_PROVISIONING_COMPLETE
            = "android.managedprovisioning.ACTION_PROVISIONING_COMPLETE";
    public static final String ACTION_PROFILE_PROVISIONING_COMPLETE =
            "android.app.action.ACTION_PROFILE_PROVISIONING_COMPLETE";

    /**
     * Name under which a DevicePolicy component publishes information
+37 −0
Original line number Diff line number Diff line
@@ -76,6 +76,43 @@ public class DevicePolicyManager {
        return me.mService != null ? me : null;
    }

    /**
     * Activity action: Starts the provisioning flow which sets up a managed profile.
     * This intent will typically be sent by a mobile device management application(mdm).
     * Managed profile provisioning creates a profile, moves the mdm to the profile,
     * sets the mdm as the profile owner and removes all non required applications from the profile.
     * As a profile owner the mdm than has full control over the managed profile.
     *
     * <p>The intent must contain the extras {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME} and
     * {@link #EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME}.
     *
     * <p> When managed provisioning has completed, an intent of the type
     * {@link DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE} is broadcasted to the
     * mdm app on the managed profile.
     *
     * <p>Input: Nothing.</p>
     * <p>Output: Nothing</p>
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_PROVISION_MANAGED_PROFILE
        = "android.managedprovisioning.ACTION_PROVISION_MANAGED_PROFILE";

    /**
     * A String extra holding the name of the package of the mobile device management application
     * that starts the managed provisioning flow. This package will be set as the profile owner.
     * <p>Use with {@link #ACTION_PROVISION_MANAGED_PROFILE}.
     */
    public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
        = "deviceAdminPackageName";

    /**
     * A String extra holding the default name of the profile that is created during managed profile
     * provisioning.
     * <p>Use with {@link #ACTION_PROVISION_MANAGED_PROFILE}
     */
    public static final String EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME
        = "defaultManagedProfileName";

    /**
     * Activity action: ask the user to add a new device administrator to the system.
     * The desired policy is the ComponentName of the policy in the