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

Commit 542588e3 authored by Jessica Hummel's avatar Jessica Hummel Committed by Adam Connors
Browse files

Update documentation so it meets api requirements

Change-Id: Ice52dc3d5ecca77f81d3df1b43179c94aece6fef
bug:15023443

Conflicts:
	api/current.txt
	core/java/android/app/admin/DeviceAdminReceiver.java
parent edbfd040
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5253,8 +5253,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 java.lang.String EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME = "android.app.extra.defaultManagedProfileName";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME = "android.app.extra.deviceAdminPackageName";
    field public static int FLAG_TO_MANAGED_PROFILE;
    field public static int FLAG_TO_PRIMARY_USER;
    field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
+23 −15
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app.admin;

import android.accounts.AccountManager;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.Service;
@@ -165,12 +166,14 @@ public class DeviceAdminReceiver extends BroadcastReceiver {
            = "android.app.action.ACTION_PASSWORD_EXPIRING";

    /**
     * Broadcast Action: This broadcast is sent to the newly created profile when
     * the provisioning of a managed profile has completed successfully. It is used in both the
     * Profile Owner and the Device Owner provisioning.
     * Broadcast Action: This broadcast is sent to indicate that provisioning of a managed profile
     * or managed device has completed successfully.
     *
     * <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 broadcast is limited to the profile that will be managed by the application that
     * requested provisioning. In the device owner case the profile is the primary user.
     * The broadcast will also be limited to the {@link DeviceAdminReceiver} component
     * specified in the original intent or NFC bump that started the provisioning process
     * (@see DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE).
     *
     * <p>Input: Nothing.</p>
     * <p>Output: Nothing</p>
@@ -307,18 +310,23 @@ public class DeviceAdminReceiver extends BroadcastReceiver {
    }

    /**
     * Called on the new profile when managed profile provisioning has completed.
     * Managed profile provisioning is the process of setting up the device so that it has a
     * separate profile which is managed by the mobile device management(mdm) application that
     * triggered the provisioning.
     * Called when provisioning of a managed profile or managed device has completed successfully.
     *
     * <p>As part of provisioning a new profile is created, the mdm is moved to the new profile and
     * set as the owner of the profile so that it has full control over it.
     * This intent is only received by the mdm package that is set as profile owner during
     * provisioning.
     * <p> As a prerequisit for the execution of this callback the (@link DeviceAdminReceiver} has
     * to declare an intent filter for {@link #ACTION_PROFILE_PROVISIONING_COMPLETE}.
     * Its component must also be specified in the {@link DevicePolicyManager#EXTRA_DEVICE_ADMIN}
     * of the {@link DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE} intent that started the
     * managed provisioning.
     *
     * <p>Provisioning can be triggered via an intent with the action
     * android.managedprovisioning.ACTION_PROVISION_MANAGED_PROFILE.
     * <p>When provisioning is complete, the managed profile is hidden until the profile owner
     * calls {DevicePolicyManager#setProfileEnabled(ComponentName admin)}. Typically a profile
     * owner will enable the profile when it has finished any additional setup such as adding an
     * account by using the {@link AccountManager} and calling apis to bring the profile into the
     * desired state.
     *
     * <p> Note that provisioning completes without waiting for any server interactions, so the
     * profile owner needs to wait for data to be available if required (e.g android device ids or
     * other data that is set as a result of server interactions).
     *
     * @param context The running context as per {@link #onReceive}.
     * @param intent The received intent as per {@link #onReceive}.
+20 −9
Original line number Diff line number Diff line
@@ -82,17 +82,25 @@ public class DevicePolicyManager {

    /**
     * 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>A managed profile allows data separation for example for the usage of a
     * device as a personal and corporate device. The user which provisioning is started from and
     * the managed profile share a launcher.
     *
     * <p>This intent will typically be sent by a mobile device management application (mdm).
     * 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 extras {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME}
     * {@link #EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME} and {@link #EXTRA_DEVICE_ADMIN}.
     *
     * <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.
     * managed profile. The intent is sent to the {@link DeviceAdminReceiver} specified in the
     * {@link #EXTRA_DEVICE_ADMIN} exclusively.
     *
     * If provisioning fails, the managedProfile is removed so the device returns to its previous
     * state.
     *
     * <p>Input: Nothing.</p>
     * <p>Output: Nothing</p>
@@ -107,7 +115,7 @@ public class DevicePolicyManager {
     * <p>Use with {@link #ACTION_PROVISION_MANAGED_PROFILE}.
     */
    public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
        = "deviceAdminPackageName";
        = "android.app.extra.deviceAdminPackageName";

    /**
     * A String extra holding the default name of the profile that is created during managed profile
@@ -115,7 +123,7 @@ public class DevicePolicyManager {
     * <p>Use with {@link #ACTION_PROVISION_MANAGED_PROFILE}
     */
    public static final String EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME
        = "defaultManagedProfileName";
        = "android.app.extra.defaultManagedProfileName";

    /**
     * Activity action: ask the user to add a new device administrator to the system.
@@ -837,6 +845,9 @@ public class DevicePolicyManager {
     * {@link DeviceAdminInfo#USES_POLICY_EXPIRE_PASSWORD} to be able to call this
     * method; if it has not, a security exception will be thrown.
     *
     * <p> Note that setting the password will automatically reset the expiration time for all
     * active admins. Active admins do not need to explicitly call this method in that case.
     *
     * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
     * @param timeout The limit (in ms) that a password can remain in effect. A value of 0
     *        means there is no restriction (unlimited).