From d3a5461b7ff0f90ec63fa439c0b7587b2656761f Mon Sep 17 00:00:00 2001 From: arangelov Date: Tue, 11 Jan 2022 17:05:16 +0000 Subject: [PATCH] Add EXTRA_PROVISIONING_ALLOW_OFFLINE Bug: 214038662 Test: compiled Change-Id: I9056ea20c25c9f5c1116c54503cfcae97e58c6ae --- core/api/current.txt | 1 + .../app/admin/DevicePolicyManager.java | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index 69422212fb841..8b2b12897e6b6 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -7554,6 +7554,7 @@ package android.app.admin { field public static final String EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE = "android.app.extra.PROVISIONING_ACCOUNT_TO_MIGRATE"; field public static final String EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE = "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE"; field public static final String EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES = "android.app.extra.PROVISIONING_ALLOWED_PROVISIONING_MODES"; + field public static final String EXTRA_PROVISIONING_ALLOW_OFFLINE = "android.app.extra.PROVISIONING_ALLOW_OFFLINE"; field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME = "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME"; field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE = "android.app.extra.PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE"; field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM"; diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 96825933b17ca..658dcf393d5d8 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -621,6 +621,32 @@ public class DevicePolicyManager { public static final String EXTRA_FORCE_UPDATE_ROLE_HOLDER = "android.app.extra.FORCE_UPDATE_ROLE_HOLDER"; + /** + * A boolean extra indicating whether offline provisioning is allowed. + * + *

For the online provisioning flow, there will be an attempt to download and install + * the latest version of the device management role holder. The platform will then delegate + * provisioning to the device management role holder via role holder-specific provisioning + * actions. + * + *

For the offline provisioning flow, the provisioning flow will always be handled by + * the platform. + * + *

If this extra is set to {@code false}, the provisioning flow will enforce that an + * internet connection is established, which will start the online provisioning flow. If an + * internet connection cannot be established, provisioning will fail. + * + *

If this extra is set to {@code true}, the provisioning flow will still try to connect to + * the internet, but if it fails it will start the offline provisioning flow. + * + *

The default value is {@code false}. + * + *

This extra is respected when provided via the provisioning intent actions such as {@link + * #ACTION_PROVISION_MANAGED_PROFILE}. + */ + public static final String EXTRA_PROVISIONING_ALLOW_OFFLINE = + "android.app.extra.PROVISIONING_ALLOW_OFFLINE"; + /** * Action: Bugreport sharing with device owner has been accepted by the user. *