public static class FactoryResetProtectionPolicy.Builder
extends Object



Builder class for FactoryResetProtectionPolicy objects.

Summary

Public constructors

Builder()

Initialize a new Builder to construct a FactoryResetProtectionPolicy.

Public methods

FactoryResetProtectionPolicy build()

Combines all of the attributes that have been set on this Builder

FactoryResetProtectionPolicy.Builder setFactoryResetProtectionAccounts(List<String> factoryResetProtectionAccounts)

Sets which accounts can unlock a device that has been factory reset.

FactoryResetProtectionPolicy.Builder setFactoryResetProtectionEnabled(boolean factoryResetProtectionEnabled)

Sets whether factory reset protection is enabled or not.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Public methods

setFactoryResetProtectionAccounts

public FactoryResetProtectionPolicy.Builder setFactoryResetProtectionAccounts (List<String> factoryResetProtectionAccounts)

Sets which accounts can unlock a device that has been factory reset.

Once set, the consumer unlock flow will be disabled and only accounts in this list can unlock factory reset protection after untrusted factory reset.

It's up to the FRP management agent to interpret the String as account it supports. Please consult their relevant documentation for details.

Parameters
factoryResetProtectionAccounts List: list of accounts.
This value cannot be null.
Returns
FactoryResetProtectionPolicy.Builder the same Builder instance.
This value cannot be null.

setFactoryResetProtectionEnabled

public FactoryResetProtectionPolicy.Builder setFactoryResetProtectionEnabled (boolean factoryResetProtectionEnabled)

Sets whether factory reset protection is enabled or not.

Once disabled, factory reset protection will not kick in all together when the device goes through untrusted factory reset. This applies to both the consumer unlock flow and the admin account overrides via setFactoryResetProtectionAccounts(List). By default, factory reset protection is enabled.

Parameters
factoryResetProtectionEnabled boolean: Whether the policy is enabled or not.
Returns
FactoryResetProtectionPolicy.Builder the same Builder instance.
This value cannot be null.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-02-13 UTC.