Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#inhmethods)

# FactoryResetProtectionPolicy.Builder

*** ** * ** ***


`
public
static


class
FactoryResetProtectionPolicy.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.admin.FactoryResetProtectionPolicy.Builder |

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy` objects.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#Builder()() ` Initialize a new Builder to construct a `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy`. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy` | ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#build()() ` Combines all of the attributes that have been set on this `Builder` |
| ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder` | ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#setFactoryResetProtectionAccounts(java.util.List<java.lang.String>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String> factoryResetProtectionAccounts) ` Sets which accounts can unlock a device that has been factory reset. |
| ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder` | ` https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#setFactoryResetProtectionEnabled(boolean)(boolean factoryResetProtectionEnabled) ` Sets whether factory reset protection is enabled or not. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

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


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

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


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

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


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

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


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(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` `
https://developer.android.com/reference/java/lang/Object#wait(long)(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` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

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


## Public constructors

### Builder

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder ()
```

Initialize a new Builder to construct a `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy`.

<br />

## Public methods

### build

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FactoryResetProtectionPolicy build ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy` | a new `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy` object. This value cannot be `null`. <br /> |

### setFactoryResetProtectionAccounts

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `factoryResetProtectionAccounts` | `List`: list of accounts. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setFactoryResetProtectionEnabled

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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 `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder#setFactoryResetProtectionAccounts(java.util.List<java.lang.String>)`. By default,
factory reset protection is enabled.

<br />

| Parameters ||
|---|---|
| `factoryResetProtectionEnabled` | `boolean`: Whether the policy is enabled or not. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/admin/FactoryResetProtectionPolicy.Builder` | the same Builder instance. This value cannot be `null`. <br /> |