# Print output for @column tags ?> FactoryResetProtectionPolicy - Android SDK | Android Developers

Most visited

Recently visited

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.

See also:

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

public static final Creator<FactoryResetProtectionPolicy> CREATOR

Public methods

describeContents

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

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

public boolean isFactoryResetProtectionEnabled ()

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

Returns
boolean

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

writeToParcel

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.