Merge "Add provisioning extra definition to skip education screens" into qt-dev am: 986f1f4e5f
am: 0122d7a3b6

Change-Id: I79d47f7b2665e92407e742168d25c37af35f0cd0
diff --git a/api/current.txt b/api/current.txt
index c88ed28..3fb0545 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -6870,6 +6870,7 @@
     field public static final String EXTRA_PROVISIONING_MAIN_COLOR = "android.app.extra.PROVISIONING_MAIN_COLOR";
     field public static final String EXTRA_PROVISIONING_MODE = "android.app.extra.PROVISIONING_MODE";
     field public static final String EXTRA_PROVISIONING_SERIAL_NUMBER = "android.app.extra.PROVISIONING_SERIAL_NUMBER";
+    field public static final String EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS = "android.app.extra.PROVISIONING_SKIP_EDUCATION_SCREENS";
     field public static final String EXTRA_PROVISIONING_SKIP_ENCRYPTION = "android.app.extra.PROVISIONING_SKIP_ENCRYPTION";
     field public static final String EXTRA_PROVISIONING_SKIP_USER_CONSENT = "android.app.extra.PROVISIONING_SKIP_USER_CONSENT";
     field public static final String EXTRA_PROVISIONING_TIME_ZONE = "android.app.extra.PROVISIONING_TIME_ZONE";
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 83c5e20..fb4eb5a 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -275,6 +275,7 @@
      * <li>{@link #EXTRA_PROVISIONING_LOGO_URI}, optional</li>
      * <li>{@link #EXTRA_PROVISIONING_MAIN_COLOR}, optional</li>
      * <li>{@link #EXTRA_PROVISIONING_DISCLAIMERS}, optional</li>
+     * <li>{@link #EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS}, optional</li>
      * </ul>
      *
      * <p>When device owner provisioning has completed, an intent of the type
@@ -323,6 +324,33 @@
      * the device. A device owner has full control over the device. The device owner can not be
      * modified by the user and the only way of resetting the device is via factory reset.
      *
+     * <p>From version {@link android.os.Build.VERSION_CODES#Q}, the admin app can choose
+     * whether to set up a fully managed device or a work profile. For the admin app to support
+     * this, it must have an activity with intent filter {@link #ACTION_GET_PROVISIONING_MODE} and
+     * another one with intent filter {@link #ACTION_ADMIN_POLICY_COMPLIANCE}. For example:
+     * <pre>
+     * &lt;activity
+     *     android:name=".GetProvisioningModeActivity"
+     *     android:label="@string/app_name"
+     *     android:permission="android.permission.BIND_DEVICE_ADMIN"&gt;
+     *     &lt;intent-filter&gt;
+     *         &lt;action
+     *             android:name="android.app.action.GET_PROVISIONING_MODE" /&gt;
+     *         &lt;category android:name="android.intent.category.DEFAULT" /&gt;
+     *     &lt;/intent-filter&gt;
+     * &lt;/activity&gt;
+     *
+     * &lt;activity
+     *     android:name=".PolicyComplianceActivity"
+     *     android:label="@string/app_name"
+     *     android:permission="android.permission.BIND_DEVICE_ADMIN"&gt;
+     *     &lt;intent-filter&gt;
+     *         &lt;action
+     *             android:name="android.app.action.ADMIN_POLICY_COMPLIANCE" /&gt;
+     *         &lt;category android:name="android.intent.category.DEFAULT" /&gt;
+     *     &lt;/intent-filter&gt;
+     * &lt;/activity&gt;</pre>
+     *
      * <p>A typical use case would be a device that is owned by a company, but used by either an
      * employee or client.
      *
@@ -354,7 +382,9 @@
      * <li>{@link #EXTRA_PROVISIONING_SUPPORT_URL}, optional</li>
      * <li>{@link #EXTRA_PROVISIONING_ORGANIZATION_NAME}, optional</li>
      * <li>{@link #EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE}, optional</li>
-     * <li>{@link #EXTRA_PROVISIONING_USE_MOBILE_DATA, optional </li><ul>
+     * <li>{@link #EXTRA_PROVISIONING_USE_MOBILE_DATA}, optional </li>
+     * <li>{@link #EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS}, optional</li>
+     * </ul>
      *
      * @hide
      */
@@ -393,6 +423,7 @@
      * <li>{@link #EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE}, optional</li>
      * <li>{@link #EXTRA_PROVISIONING_LOGO_URI}, optional</li>
      * <li>{@link #EXTRA_PROVISIONING_MAIN_COLOR}, optional</li>
+     * <li>{@link #EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS}, optional</li>
      * </ul>
      *
      * <p>When device owner provisioning has completed, an intent of the type
@@ -1115,6 +1146,19 @@
             "android.app.extra.PROVISIONING_SKIP_USER_CONSENT";
 
     /**
+     * A boolean extra indicating if the education screens from the provisioning flow should be
+     * skipped. If unspecified, defaults to {@code false}.
+     *
+     * <p>If the education screens are skipped, it is the admin application's responsibility
+     * to display its own user education screens.
+     *
+     * <p>It can be used when provisioning a fully managed device via
+     * {@link #ACTION_PROVISION_MANAGED_DEVICE}.
+     */
+    public static final String EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS =
+            "android.app.extra.PROVISIONING_SKIP_EDUCATION_SCREENS";
+
+    /**
      * A boolean extra indicating if mobile data should be used during NFC device owner provisioning
      * for downloading the mobile device management application. If {@link
      * #EXTRA_PROVISIONING_WIFI_SSID} is also specified, wifi network will be used instead.