Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder class for FactoryResetProtectionPolicy
objects.
Summary
Public constructors
Public methods
setFactoryResetProtectionAccounts
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 . |
setFactoryResetProtectionEnabled
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. |
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 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# FactoryResetProtectionPolicy.Builder\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/admin/FactoryResetProtectionPolicy.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.admin.FactoryResetProtectionPolicy.Builder](#) |\n\nBuilder class for [FactoryResetProtectionPolicy](/reference/kotlin/android/app/admin/FactoryResetProtectionPolicy) objects.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder())`()` Initialize a new Builder to construct a [FactoryResetProtectionPolicy](/reference/kotlin/android/app/admin/FactoryResetProtectionPolicy). |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [FactoryResetProtectionPolicy](/reference/kotlin/android/app/admin/FactoryResetProtectionPolicy) | [build](#build())`()` Combines all of the attributes that have been set on this `Builder` |\n| open [FactoryResetProtectionPolicy.Builder](#) | [setFactoryResetProtectionAccounts](#setFactoryResetProtectionAccounts(kotlin.collections.MutableList))`(`factoryResetProtectionAccounts:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\u003e`)` Sets which accounts can unlock a device that has been factory reset. |\n| open [FactoryResetProtectionPolicy.Builder](#) | [setFactoryResetProtectionEnabled](#setFactoryResetProtectionEnabled(kotlin.Boolean))`(`factoryResetProtectionEnabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether factory reset protection is enabled or not. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nInitialize a new Builder to construct a [FactoryResetProtectionPolicy](/reference/kotlin/android/app/admin/FactoryResetProtectionPolicy).\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun build(): FactoryResetProtectionPolicy\n```\n\nCombines all of the attributes that have been set on this `Builder`\n\n| Return ||\n|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| [FactoryResetProtectionPolicy](/reference/kotlin/android/app/admin/FactoryResetProtectionPolicy) | a new [FactoryResetProtectionPolicy](/reference/kotlin/android/app/admin/FactoryResetProtectionPolicy) object. This value cannot be `null`. |\n\n### setFactoryResetProtectionAccounts\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setFactoryResetProtectionAccounts(factoryResetProtectionAccounts: MutableList\u003cString!\u003e): FactoryResetProtectionPolicy.Builder\n```\n\nSets which accounts can unlock a device that has been factory reset.\n\nOnce set, the consumer unlock flow will be disabled and only accounts in this list can unlock factory reset protection after untrusted factory reset.\n\nIt's up to the FRP management agent to interpret the `String` as account it supports. Please consult their relevant documentation for details.\n\n| Parameters ||\n|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `factoryResetProtectionAccounts` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e: list of accounts. This value cannot be `null`. |\n\n| Return ||\n|-------------------------------------------|---------------------------------------------------------|\n| [FactoryResetProtectionPolicy.Builder](#) | the same Builder instance. This value cannot be `null`. |\n\n### setFactoryResetProtectionEnabled\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setFactoryResetProtectionEnabled(factoryResetProtectionEnabled: Boolean): FactoryResetProtectionPolicy.Builder\n```\n\nSets whether factory reset protection is enabled or not.\n\nOnce 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](#setFactoryResetProtectionAccounts(kotlin.collections.MutableList)). By default, factory reset protection is enabled.\n\n| Parameters ||\n|---------------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| `factoryResetProtectionEnabled` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): Whether the policy is enabled or not. |\n\n| Return ||\n|-------------------------------------------|---------------------------------------------------------|\n| [FactoryResetProtectionPolicy.Builder](#) | the same Builder instance. This value cannot be `null`. |"]]