From 18800097c347108807b6d9afec597f70130e3f6b Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Tue, 11 Apr 2017 19:41:43 +0100 Subject: [PATCH] Add STATE_USER_SETUP_COMPLETE ManagedProvisioning launches SetupWizard by action STATE_USER_SETUP_COMPLETE Bug: 29829689 Test: runtest managed-provisioning Change-Id: I06656842a1855fbc9a0675d3d9a188b1f6fbe033 --- api/system-current.txt | 1 + .../app/admin/DevicePolicyManager.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/api/system-current.txt b/api/system-current.txt index c1ed088169220..b31e2fb297bb4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6642,6 +6642,7 @@ package android.app.admin { 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_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER"; field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION"; + field public static final java.lang.String ACTION_STATE_USER_SETUP_COMPLETE = "android.app.action.STATE_USER_SETUP_COMPLETE"; field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED"; field public static final java.lang.String DELEGATION_APP_RESTRICTIONS = "delegation-app-restrictions"; field public static final java.lang.String DELEGATION_BLOCK_UNINSTALL = "delegation-block-uninstall"; diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index bb5d830820aa9..aa95ee0e63b1c 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -257,6 +257,26 @@ public class DevicePolicyManager { public static final String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE"; + /** + * Activity action: launch when user provisioning completed, i.e. + * {@link #getUserProvisioningState()} returns one of the complete state. + * + *

Please note that the API behavior is not necessarily consistent across various releases, + * and devices, as it's contract between SetupWizard and ManagedProvisioning. The default + * implementation is that ManagedProvisioning launches SetupWizard in NFC provisioning only. + * + *

The activity must be protected by permission + * {@link android.Manifest.permission#BIND_DEVICE_ADMIN}, and the process must hold + * {@link android.Manifest.permission#DISPATCH_PROVISIONING_MESSAGE} to be launched. + * Only one {@link ComponentName} in the entire system should be enabled, and the rest of the + * components are not started by this intent. + * @hide + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + @SystemApi + public static final String ACTION_STATE_USER_SETUP_COMPLETE = + "android.app.action.STATE_USER_SETUP_COMPLETE"; + /** * Activity action: Starts the provisioning flow which sets up a managed device. *