From c8f175a40a28331279bd1e1c7be400a47e3422e2 Mon Sep 17 00:00:00 2001 From: arangelov Date: Tue, 2 Apr 2019 14:31:47 +0100 Subject: [PATCH] Add provisioning extra definition to skip education screens Bug: 129750998 Test: none Change-Id: I874c80d36d2d3e7f2a602c2e231a73dab3baef21 --- api/current.txt | 1 + .../app/admin/DevicePolicyManager.java | 46 ++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 8ff63c07594de..2f50a3a851fc8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6874,6 +6874,7 @@ package android.app.admin { 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 20e85e6793f15..c6f1ff330f4be 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -276,6 +276,7 @@ public class DevicePolicyManager { *
  • {@link #EXTRA_PROVISIONING_LOGO_URI}, optional
  • *
  • {@link #EXTRA_PROVISIONING_MAIN_COLOR}, optional
  • *
  • {@link #EXTRA_PROVISIONING_DISCLAIMERS}, optional
  • + *
  • {@link #EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS}, optional
  • * * *

    When device owner provisioning has completed, an intent of the type @@ -324,6 +325,33 @@ public class DevicePolicyManager { * 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. * + *

    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: + *

    +     * <activity
    +     *     android:name=".GetProvisioningModeActivity"
    +     *     android:label="@string/app_name"
    +     *     android:permission="android.permission.BIND_DEVICE_ADMIN">
    +     *     <intent-filter>
    +     *         <action
    +     *             android:name="android.app.action.GET_PROVISIONING_MODE" />
    +     *         <category android:name="android.intent.category.DEFAULT" />
    +     *     </intent-filter>
    +     * </activity>
    +     *
    +     * <activity
    +     *     android:name=".PolicyComplianceActivity"
    +     *     android:label="@string/app_name"
    +     *     android:permission="android.permission.BIND_DEVICE_ADMIN">
    +     *     <intent-filter>
    +     *         <action
    +     *             android:name="android.app.action.ADMIN_POLICY_COMPLIANCE" />
    +     *         <category android:name="android.intent.category.DEFAULT" />
    +     *     </intent-filter>
    +     * </activity>
    + * *

    A typical use case would be a device that is owned by a company, but used by either an * employee or client. * @@ -355,7 +383,9 @@ public class DevicePolicyManager { *

  • {@link #EXTRA_PROVISIONING_SUPPORT_URL}, optional
  • *
  • {@link #EXTRA_PROVISIONING_ORGANIZATION_NAME}, optional
  • *
  • {@link #EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE}, optional
  • - *
  • {@link #EXTRA_PROVISIONING_USE_MOBILE_DATA, optional
  • * * @hide */ @@ -394,6 +424,7 @@ public class DevicePolicyManager { *
  • {@link #EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE}, optional
  • *
  • {@link #EXTRA_PROVISIONING_LOGO_URI}, optional
  • *
  • {@link #EXTRA_PROVISIONING_MAIN_COLOR}, optional
  • + *
  • {@link #EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS}, optional
  • * * *

    When device owner provisioning has completed, an intent of the type @@ -1115,6 +1146,19 @@ public class DevicePolicyManager { public static final String EXTRA_PROVISIONING_SKIP_USER_CONSENT = "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}. + * + *

    If the education screens are skipped, it is the admin application's responsibility + * to display its own user education screens. + * + *

    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