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

Commit 763ca9da authored by Sandy Pan's avatar Sandy Pan Committed by Android (Google) Code Review
Browse files

Merge "Expose SupervisionRecoveryInfo as SystemApi" into main

parents 71a0ef16 99df0a2f
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2955,6 +2955,21 @@ package android.app.supervision {
    method @FlaggedApi("android.permission.flags.enable_system_supervision_role_behavior") @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public boolean shouldAllowBypassingSupervisionRoleQualification();
  }
  @FlaggedApi("android.app.supervision.flags.supervision_manager_apis") public final class SupervisionRecoveryInfo implements android.os.Parcelable {
    ctor public SupervisionRecoveryInfo(@NonNull String, @NonNull String, int, @Nullable android.os.PersistableBundle);
    method public int describeContents();
    method @NonNull public android.os.PersistableBundle getAccountData();
    method @NonNull public String getAccountName();
    method @NonNull public String getAccountType();
    method public int getState();
    method public void readFromParcel(@NonNull android.os.Parcel);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.supervision.SupervisionRecoveryInfo> CREATOR;
    field public static final String EXTRA_SUPERVISION_RECOVERY_INFO = "android.app.supervision.extra.SUPERVISION_RECOVERY_INFO";
    field public static final int STATE_PENDING = 0; // 0x0
    field public static final int STATE_VERIFIED = 1; // 0x1
  }
}
package android.app.time {
+23 −2
Original line number Diff line number Diff line
@@ -16,24 +16,31 @@

package android.app.supervision;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.supervision.flags.Flags;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;

import androidx.annotation.Keep;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;

/**
 * Contains the information needed for recovering the device supervision pin.
 * Contains the information needed for recovering the device supervision PIN.
 *
 * <p>Returned by {@link SupervisionManager#getSupervisionRecoveryInfo}.
 *
 * @hide
 */
@SystemApi
@FlaggedApi(Flags.FLAG_SUPERVISION_MANAGER_APIS)
public final class SupervisionRecoveryInfo implements Parcelable {
    /**
     * Extra key used to pass supervision recovery information within an intent.
@@ -70,9 +77,14 @@ public final class SupervisionRecoveryInfo implements Parcelable {
                }
            };

    /** An IntDef which describes the various states of the recovery information. */
    /**
     * An IntDef which describes the various states of the recovery information.
     *
     * @hide
     */
    @Keep
    @IntDef({STATE_PENDING, STATE_VERIFIED})
    @Retention(RetentionPolicy.SOURCE)
    public @interface State {}

    /** Indicates that the recovery information is pending verification. */
@@ -86,6 +98,15 @@ public final class SupervisionRecoveryInfo implements Parcelable {
    @Nullable private PersistableBundle mAccountData;
    @State private int mState;

    /**
     * Constructor for SupervisionRecoveryInfo.
     *
     * @param accountName The name of the account. See {@link android.accounts.Account#name}.
     * @param accountType The type of the account. See {@link android.accounts.Account#type}.
     * @param state The state of the recovery information.
     * @param accountData Authenticator-specific data for recovery. This contains additional
     *     information that the recovery method needs to recover the device supervision PIN.
     */
    public SupervisionRecoveryInfo(
            @NonNull String accountName,
            @NonNull String accountType,