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

Commit 07ac20bb authored by Nicolas Prevot's avatar Nicolas Prevot
Browse files

Adding an extra and an action to notify the mdm to start the provisioning.

Adding EXTRA_PROVISIONING_EMAIL_ADDRESS and ACTION_START_PROVISIONING to DevicePolicyManager.

BUG: 15157562

Change-Id: Ic3ecc6b0a501e1df9a5f803a44347dd024a7a07c
parent d5259c8e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5234,6 +5234,7 @@ package android.app.admin {
    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.app.action.ACTION_PROVISION_MANAGED_PROFILE";
    field public static final java.lang.String ACTION_SEND_PROVISIONING_VALUES = "android.app.action.ACTION_SEND_PROVISIONING_VALUES";
    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
@@ -5244,6 +5245,7 @@ package android.app.admin {
    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 java.lang.String EXTRA_PROVISIONING_EMAIL_ADDRESS = "android.app.extra.ManagedProfileEmailAddress";
    field public static final java.lang.String EXTRA_PROVISIONING_TOKEN = "android.app.extra.token";
    field public static int FLAG_MANAGED_CAN_ACCESS_PARENT;
    field public static int FLAG_PARENT_CAN_ACCESS_MANAGED;
+3 −0
Original line number Diff line number Diff line
@@ -172,6 +172,9 @@ public class DeviceAdminReceiver extends BroadcastReceiver {
     * <p>The broadcast is limited to the DeviceAdminReceiver component specified in the message
     * that started the provisioning. It is also limited to the managed profile.
     *
     * <p> The intent may contain the extra
     * {@link DevicePolicyManager#EXTRA_PROVISIONING_EMAIL_ADDRESS}.
     *
     * <p>Input: Nothing.</p>
     * <p>Output: Nothing</p>
     */
+32 −2
Original line number Diff line number Diff line
@@ -82,6 +82,20 @@ public class DevicePolicyManager {
        return me.mService != null ? me : null;
    }

    /**
     * Activity action: Used to indicate that the receiving activity is being started as part of the
     * managed profile provisioning flow. This intent is typically sent to a mobile device
     * management application (mdm) after the first part of the provisioning process is complete in
     * the expectation that this app will (after optionally showing it's own UI) ultimately call
     * {@link #ACTION_PROVISION_MANAGED_PROFILE} to complete the creation of the managed profile.
     *
     * <p> The intent may contain the extras {@link #EXTRA_PROVISIONING_TOKEN} and
     * {@link #EXTRA_PROVISIONING_EMAIL_ADDRESS}.
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_SEND_PROVISIONING_VALUES
        = "android.app.action.ACTION_SEND_PROVISIONING_VALUES";

    /**
     * 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).
@@ -123,8 +137,13 @@ public class DevicePolicyManager {
        = "deviceAdminPackageName";

    /**
     * An int extra used to identify the consent of the user to create the managed profile.
     * <p>Use with {@link #ACTION_PROVISION_MANAGED_PROFILE}
     * An int extra used to identify that during the current setup process the user has already
     * consented to setting up a managed profile. This is typically received by
     * a mobile device management application when it is started with
     * {@link #ACTION_SEND_PROVISIONING_VALUES} and passed on in an intent
     * {@link #ACTION_PROVISION_MANAGED_PROFILE} which starts the setup of the managed profile. The
     * token indicates that steps asking for user consent can be skipped as the user has previously
     * consented.
     */
    public static final String EXTRA_PROVISIONING_TOKEN
        = "android.app.extra.token";
@@ -137,6 +156,17 @@ public class DevicePolicyManager {
    public static final String EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME
        = "defaultManagedProfileName";

    /**
     * A String extra holding the email address of the profile that is created during managed
     * profile provisioning. This is typically received by a mobile management application when it
     * is started with {@link #ACTION_SEND_PROVISIONING_VALUES} and passed on in an intent
     * {@link #ACTION_PROVISION_MANAGED_PROFILE} which starts the setup of the managed profile. It
     * is eventually passed on in an intent
     * {@link DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE}.
     */
    public static final String EXTRA_PROVISIONING_EMAIL_ADDRESS
        = "android.app.extra.ManagedProfileEmailAddress";

    /**
     * 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