Merge "Add extra to inform the role holder of the update attempt result" into tm-dev

This commit is contained in:
Antoan Angelov
2022-03-18 14:29:48 +00:00
committed by Android (Google) Code Review
2 changed files with 29 additions and 0 deletions

View File

@@ -1149,6 +1149,7 @@ package android.app.admin {
field public static final String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
field public static final String EXTRA_ROLE_HOLDER_PROVISIONING_INITIATOR_PACKAGE = "android.app.extra.ROLE_HOLDER_PROVISIONING_INITIATOR_PACKAGE";
field public static final String EXTRA_ROLE_HOLDER_STATE = "android.app.extra.ROLE_HOLDER_STATE";
field public static final String EXTRA_ROLE_HOLDER_UPDATE_RESULT_CODE = "android.app.extra.ROLE_HOLDER_UPDATE_RESULT_CODE";
field public static final int FLAG_SUPPORTED_MODES_DEVICE_OWNER = 4; // 0x4
field public static final int FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED = 1; // 0x1
field public static final int FLAG_SUPPORTED_MODES_PERSONALLY_OWNED = 2; // 0x2

View File

@@ -3345,6 +3345,34 @@ public class DevicePolicyManager {
public static final int
RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_PROVISIONING_DISABLED = 3;
/**
* An {@code int} extra which contains the result code of the last attempt to update
* the device policy management role holder.
*
* <p>This extra is provided to the device policy management role holder via either {@link
* #ACTION_ROLE_HOLDER_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE} or {@link
* #ACTION_ROLE_HOLDER_PROVISION_MANAGED_PROFILE} when started after the role holder
* had previously returned {@link #RESULT_UPDATE_ROLE_HOLDER}.
*
* <p>If the role holder update had failed, the role holder can use the value of this extra to
* make a decision whether to fail the provisioning flow or to carry on with the older version
* of the role holder.
*
* <p>Possible values can be:
* <ul>
* <li>{@link Activity#RESULT_OK} if the update was successful
* <li>{@link #RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_RECOVERABLE_ERROR} if it
* encounters a problem that may be solved by relaunching it again.
* <li>{@link #RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_UNRECOVERABLE_ERROR} if
* it encounters a problem that will not be solved by relaunching it again.
* </ul>
*
* @hide
*/
@SystemApi
public static final String EXTRA_ROLE_HOLDER_UPDATE_RESULT_CODE =
"android.app.extra.ROLE_HOLDER_UPDATE_RESULT_CODE";
/**
* An {@link Intent} extra which resolves to a custom user consent screen.
*