Added in API level 30

Builder


class Builder
kotlin.Any
   ↳ android.app.admin.FactoryResetProtectionPolicy.Builder

Builder class for FactoryResetProtectionPolicy objects.

Summary

Public constructors

Initialize a new Builder to construct a FactoryResetProtectionPolicy.

Public methods
open FactoryResetProtectionPolicy

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

open FactoryResetProtectionPolicy.Builder
setFactoryResetProtectionAccounts(factoryResetProtectionAccounts: MutableList<String!>)

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

open FactoryResetProtectionPolicy.Builder
setFactoryResetProtectionEnabled(factoryResetProtectionEnabled: Boolean)

Sets whether factory reset protection is enabled or not.

Public constructors

Builder

Added in API level 30
Builder()

Initialize a new Builder to construct a FactoryResetProtectionPolicy.

Public methods

build

Added in API level 30
open fun build(): FactoryResetProtectionPolicy

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

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

setFactoryResetProtectionAccounts

Added in API level 30
open fun setFactoryResetProtectionAccounts(factoryResetProtectionAccounts: MutableList<String!>): FactoryResetProtectionPolicy.Builder

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 MutableList<String!>: list of accounts. This value cannot be null.
Return
FactoryResetProtectionPolicy.Builder the same Builder instance. This value cannot be null.

setFactoryResetProtectionEnabled

Added in API level 30
open fun setFactoryResetProtectionEnabled(factoryResetProtectionEnabled: Boolean): FactoryResetProtectionPolicy.Builder

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. By default, factory reset protection is enabled.

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