diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 4b753ba822d87..74315f5ff5df5 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -1064,6 +1064,7 @@ package android.app.admin { field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_ALLOWED"; field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_DISALLOWED"; field public static final String ACTION_BIND_SECONDARY_LOCKSCREEN_SERVICE = "android.app.action.BIND_SECONDARY_LOCKSCREEN_SERVICE"; + field @RequiresPermission(android.Manifest.permission.DISPATCH_PROVISIONING_MESSAGE) public static final String ACTION_ESTABLISH_NETWORK_CONNECTION = "android.app.action.ESTABLISH_NETWORK_CONNECTION"; field public static final String ACTION_PROVISION_FINALIZATION = "android.app.action.PROVISION_FINALIZATION"; field public static final String ACTION_PROVISION_FINANCED_DEVICE = "android.app.action.PROVISION_FINANCED_DEVICE"; field public static final String ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE = "android.app.action.PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE"; diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 84157948a3f56..cefd25ac7ac53 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -3011,6 +3011,54 @@ public class DevicePolicyManager { public static final String EXTRA_PROVISIONING_ROLE_HOLDER_CUSTOM_USER_CONSENT_INTENT = "android.app.extra.PROVISIONING_ROLE_HOLDER_CUSTOM_USER_CONSENT_INTENT"; + /** + * Activity action: attempts to establish network connection + * + *
This intent can be accompanied by any of the relevant provisioning extras related to + * network connectivity, such as: + *
If there are provisioning extras related to network connectivity, this activity + * attempts to connect to the specified network. Otherwise it prompts the end-user to connect. + * + *
This activity is meant to be started by the provisioning initiator prior to starting + * {@link #ACTION_PROVISION_MANAGED_PROFILE} or {@link + * #ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE}. + * + *
Note that network connectivity is still also handled when provisioning via {@link + * #ACTION_PROVISION_MANAGED_PROFILE} or {@link + * #ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE}. {@link + * #ACTION_ESTABLISH_NETWORK_CONNECTION} should only be used in cases when the provisioning + * initiator would like to do some additional logic after the network connectivity step and + * before the start of provisioning. + * + * If network connection is established, {@link Activity#RESULT_OK} will be returned. Otherwise + * the result will be {@link Activity#RESULT_CANCELED}. + * + * @hide + */ + @RequiresPermission(android.Manifest.permission.DISPATCH_PROVISIONING_MESSAGE) + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + @SystemApi + public static final String ACTION_ESTABLISH_NETWORK_CONNECTION = + "android.app.action.ESTABLISH_NETWORK_CONNECTION"; + /** * Maximum supported password length. Kind-of arbitrary. * @hide