# AdvancedProtectionManager

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#nestedclasses)\|[Methods](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#inhmethods)  

# AdvancedProtectionManager

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/security/advancedprotection/AdvancedProtectionManager "View this page in Kotlin")\|Java

`
public

final

class
AdvancedProtectionManager
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.security.advancedprotection.AdvancedProtectionManager |

<br />

*** ** * ** ***

<br />

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.Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.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)](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#registerAdvancedProtectionCallback(java.util.concurrent.Executor,%20android.security.advancedprotection.AdvancedProtectionManager.Callback)). |

|                                                                                                                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                                                                                                                             ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean` | ` `[isAdvancedProtectionEnabled](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#isAdvancedProtectionEnabled())`() ` Checks if advanced protection is enabled on the device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` void`    | ` `[registerAdvancedProtectionCallback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#registerAdvancedProtectionCallback(java.util.concurrent.Executor,%20android.security.advancedprotection.AdvancedProtectionManager.Callback))`(`[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)` executor, `[AdvancedProtectionManager.Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback)` callback) ` Registers a[Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback)to be notified of changes to the Advanced Protection state. |
| ` void`    | ` `[unregisterAdvancedProtectionCallback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager#unregisterAdvancedProtectionCallback(android.security.advancedprotection.AdvancedProtectionManager.Callback))`(`[AdvancedProtectionManager.Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback)` callback) ` Unregister an existing[Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback).                                                                                                                                                                           |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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 methods

### isAdvancedProtectionEnabled

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

```
public boolean isAdvancedProtectionEnabled ()
```

Checks if advanced protection is enabled on the device.  
Requires[Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE](https://developer.android.com/reference/android/Manifest.permission#QUERY_ADVANCED_PROTECTION_MODE)

<br />

|                                   Returns                                   ||
|-----------|------------------------------------------------------------------|
| `boolean` | `true`if advanced protection is enabled,`false`otherwise. <br /> |

### registerAdvancedProtectionCallback

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

```
public void registerAdvancedProtectionCallback (Executor executor, 
                AdvancedProtectionManager.Callback callback)
```

Registers a[Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.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](https://developer.android.com/reference/android/Manifest.permission#QUERY_ADVANCED_PROTECTION_MODE)

<br />

|                                                                                                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                                                                                                        ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `executor` | `Executor`: The executor of where the callback will execute. This value cannot be`null`. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/java/util/concurrent/Executor), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/android/content/Context#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)that dispatches to an appropriate thread. <br /> |
| `callback` | `AdvancedProtectionManager.Callback`: The[Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback)object to register.. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                   |

### unregisterAdvancedProtectionCallback

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

```
public void unregisterAdvancedProtectionCallback (AdvancedProtectionManager.Callback callback)
```

Unregister an existing[Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback).  
Requires[Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE](https://developer.android.com/reference/android/Manifest.permission#QUERY_ADVANCED_PROTECTION_MODE)

<br />

|                                                                                                               Parameters                                                                                                                ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `callback` | `AdvancedProtectionManager.Callback`: The[Callback](https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager.Callback)object to unregister. This value cannot be`null`. <br /> |