AdvancedProtectionManager
  public
  
  final
  
  class
  AdvancedProtectionManager
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | 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 | |
|---|---|
| 
        
        
        
        
        interface | AdvancedProtectionManager.CallbackA callback class for monitoring changes to Advanced Protection state To register a callback, implement this interface, and register it with
  | 
| Public methods | |
|---|---|
| 
        
        
        
        
        
        boolean | 
      isAdvancedProtectionEnabled()
      Checks if advanced protection is enabled on the device. | 
| 
        
        
        
        
        
        void | 
      registerAdvancedProtectionCallback(Executor executor, AdvancedProtectionManager.Callback callback)
      Registers a  | 
| 
        
        
        
        
        
        void | 
      unregisterAdvancedProtectionCallback(AdvancedProtectionManager.Callback callback)
      Unregister an existing  | 
| Inherited methods | |
|---|---|
Public methods
isAdvancedProtectionEnabled
public boolean isAdvancedProtectionEnabled ()
Checks if advanced protection is enabled on the device.
 
 Requires Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE
| Returns | |
|---|---|
| boolean | trueif advanced protection is enabled,falseotherwise. | 
registerAdvancedProtectionCallback
public void registerAdvancedProtectionCallback (Executor executor, AdvancedProtectionManager.Callback callback)
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 Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE
| Parameters | |
|---|---|
| executor | Executor: The executor of where the callback will execute.
 This value cannot benull.
 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: TheCallbackobject to register..
 This value cannot benull. | 
unregisterAdvancedProtectionCallback
public void unregisterAdvancedProtectionCallback (AdvancedProtectionManager.Callback callback)
Unregister an existing Callback.
 
 Requires Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE
| Parameters | |
|---|---|
| callback | AdvancedProtectionManager.Callback: TheCallbackobject to unregister.
 This value cannot benull. | 
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.
