Stay organized with collections
Save and categorize content based on your preferences.
Callback
interface Callback
A callback class for monitoring changes to Advanced Protection state
To register a callback, implement this interface, and register it with AdvancedProtectionManager.registerAdvancedProtectionCallback(Executor, Callback)
. Methods are called when the state changes, as well as once on initial registration.
Summary
Public methods |
abstract Unit |
Called when advanced protection state changes
|
Public methods
onAdvancedProtectionChanged
abstract fun onAdvancedProtectionChanged(enabled: Boolean): Unit
Called when advanced protection state changes
Parameters |
enabled |
Boolean: the new state |
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-03-13 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-03-13 UTC."],[],[],null,["# AdvancedProtectionManager.Callback\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCallback\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback \"View this page in Java\") \n\n```\ninterface Callback\n```\n\n|-----------------------------------------------------------------------------|\n| [android.security.advancedprotection.AdvancedProtectionManager.Callback](#) |\n\nA callback class for monitoring changes to Advanced Protection state\n\nTo register a callback, implement this interface, and register it with [AdvancedProtectionManager.registerAdvancedProtectionCallback(Executor, Callback)](/reference/kotlin/android/security/advancedprotection/AdvancedProtectionManager#registerAdvancedProtectionCallback(java.util.concurrent.Executor,%20android.security.advancedprotection.AdvancedProtectionManager.Callback)). Methods are called when the state changes, as well as once on initial registration.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onAdvancedProtectionChanged](#onAdvancedProtectionChanged(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when advanced protection state changes |\n\nPublic methods\n--------------\n\n### onAdvancedProtectionChanged\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onAdvancedProtectionChanged(enabled: Boolean): Unit\n```\n\nCalled when advanced protection state changes\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------|\n| `enabled` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): the new state |"]]