FactoryResetProtectionPolicy.Builder


public static class FactoryResetProtectionPolicy.Builder
extends Object

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


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

Public constructors

Builder

Added in API level 30
public Builder ()

Initialize a new Builder to construct a FactoryResetProtectionPolicy.

Public methods

build

Added in API level 30
public FactoryResetProtectionPolicy build ()

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

Returns
FactoryResetProtectionPolicy a new FactoryResetProtectionPolicy object. This value cannot be null.

setFactoryResetProtectionAccounts

Added in API level 30
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

Added in API level 30
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.