FactoryResetProtectionPolicy


public final class FactoryResetProtectionPolicy
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.admin.FactoryResetProtectionPolicy


The factory reset protection policy determines which accounts can unlock a device that has gone through untrusted factory reset.

Only a device owner or profile owner of an organization-owned device can set a factory reset protection policy for the device by calling the DevicePolicyManager method DevicePolicyManager#setFactoryResetProtectionPolicy(ComponentName, FactoryResetProtectionPolicy)}.

Normally factory reset protection does not kick in if the device is factory reset via Settings. This is also the case when a device owner sets factory reset protection policy. However, when a profile owner of an organization-owned device sets factory reset protection policy that locks the device to specific accounts, the policy will take effect even if factory reset is performed from Settings.

Summary

Nested classes

class FactoryResetProtectionPolicy.Builder

Builder class for FactoryResetProtectionPolicy objects. 

Inherited constants

Fields

public static final Creator<FactoryResetProtectionPolicy> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

List<String> getFactoryResetProtectionAccounts()

Get the list of accounts that can provision a device which has been factory reset.

boolean isFactoryResetProtectionEnabled()

Return whether factory reset protection for the device is enabled or not.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 30
public static final Creator<FactoryResetProtectionPolicy> CREATOR

Public methods

describeContents

Added in API level 30
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getFactoryResetProtectionAccounts

Added in API level 30
public List<String> getFactoryResetProtectionAccounts ()

Get the list of accounts that can provision a device which has been factory reset.

Returns
List<String> This value cannot be null.

isFactoryResetProtectionEnabled

Added in API level 30
public boolean isFactoryResetProtectionEnabled ()

Return whether factory reset protection for the device is enabled or not.

Returns
boolean

toString

Added in API level 30
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

writeToParcel

Added in API level 30
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: This value may be null.