Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28fea115 authored by arangelov's avatar arangelov
Browse files

Add hidden constants to allow the role holder updater to specify the failure strategy

If the role holder updater fails to update the role holder, it can
specify how the platform should handle the failure. It can either
fail provisioning, or it can carry on using the platform-driven
provisioning.

Bug: 230749552
Test: compiled
Change-Id: Id24b24e5d7386d9806efa232f8c71287c9b7704b
parent 3d790a16
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -3374,6 +3374,55 @@ public class DevicePolicyManager {
    public static final int
            RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_PROVISIONING_DISABLED = 3;
    /**
     * An {@code int} extra that specifies one of {@link
     * #ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FAIL_PROVISIONING} or {@link
     * #ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FALLBACK_TO_PLATFORM_PROVISIONING}.
     *
     * <p>The failure strategy specifies how the platform should handle a failed device policy
     * management role holder update via {@link
     * #ACTION_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER} when {@link
     * #EXTRA_PROVISIONING_ALLOW_OFFLINE} is not set or set to {@code false}.
     *
     * <p>This extra may be supplied as part of the {@link
     * #ACTION_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER} result intent.
     *
     * <p>Default value is {@link #ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FAIL_PROVISIONING}.
     *
     * @hide
     */
    public static final String EXTRA_ROLE_HOLDER_UPDATE_FAILURE_STRATEGY =
            "android.app.extra.ROLE_HOLDER_UPDATE_FAILURE_STRATEGY";
    /**
     * Possible values for {@link #EXTRA_ROLE_HOLDER_UPDATE_FAILURE_STRATEGY}.
     *
     * @hide
     */
    @IntDef(prefix = { "ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_" }, value = {
            ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FAIL_PROVISIONING,
            ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FALLBACK_TO_PLATFORM_PROVISIONING
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface RoleHolderUpdateFailureStrategy {}
    /**
     * A value for {@link #EXTRA_ROLE_HOLDER_UPDATE_FAILURE_STRATEGY} indicating that upon
     * failure to update the role holder, provisioning should fail.
     *
     * @hide
     */
    public static final int ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FAIL_PROVISIONING = 1;
    /**
     * A value for {@link #EXTRA_ROLE_HOLDER_UPDATE_FAILURE_STRATEGY} indicating that upon
     * failure to update the role holder, provisioning should fallback to be platform-driven.
     *
     * @hide
     */
    public static final int ROLE_HOLDER_UPDATE_FAILURE_STRATEGY_FALLBACK_TO_PLATFORM_PROVISIONING =
            2;
    /**
     * An {@code int} extra which contains the result code of the last attempt to update
     * the device policy management role holder via {@link