AdvancedProtectionManager
class AdvancedProtectionManager
| kotlin.Any | |
| ↳ | android.security.advancedprotection.AdvancedProtectionManager | 
Advanced Protection is a mode that users can enroll their device into, that enhances security by enabling features and restrictions across both the platform and user apps.
This class provides methods to query and control the advanced protection mode for the device.
Summary
| Nested classes | |
|---|---|
| abstract | A callback class for monitoring changes to Advanced Protection state | 
| Public methods | |
|---|---|
| Boolean | Checks if advanced protection is enabled on the device. | 
| Unit | registerAdvancedProtectionCallback(executor: Executor, callback: AdvancedProtectionManager.Callback)Registers a  | 
| Unit | Unregister an existing  | 
Public methods
isAdvancedProtectionEnabled
fun isAdvancedProtectionEnabled(): Boolean
Checks if advanced protection is enabled on the device. 
 Requires android.Manifest.permission#QUERY_ADVANCED_PROTECTION_MODE
| Return | |
|---|---|
| Boolean | trueif advanced protection is enabled,falseotherwise. | 
registerAdvancedProtectionCallback
fun registerAdvancedProtectionCallback(
executor: Executor,
callback: AdvancedProtectionManager.Callback
): Unit
Registers a Callback to be notified of changes to the Advanced Protection state. 
The provided callback will be called on the specified executor with the updated state. Methods are called when the state changes, as well as once on initial registration. 
 Requires android.Manifest.permission#QUERY_ADVANCED_PROTECTION_MODE
| Parameters | |
|---|---|
| executor | Executor: The executor of where the callback will execute. This value cannot be null. Callback and listener events are dispatched through thisExecutor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can useContext.getMainExecutor(). Otherwise, provide anExecutorthat dispatches to an appropriate thread. | 
| callback | AdvancedProtectionManager.Callback: The Callbackobject to register.. This value cannot benull. | 
unregisterAdvancedProtectionCallback
fun unregisterAdvancedProtectionCallback(callback: AdvancedProtectionManager.Callback): Unit
Unregister an existing Callback. 
 Requires android.Manifest.permission#QUERY_ADVANCED_PROTECTION_MODE
| Parameters | |
|---|---|
| callback | AdvancedProtectionManager.Callback: The Callbackobject to unregister. This value cannot benull. | 
