AuthenticationPolicyManager


class AuthenticationPolicyManager
kotlin.Any
   ↳ android.security.authenticationpolicy.AuthenticationPolicyManager

AuthenticationPolicyManager is a centralized interface for managing authentication related policies on the device. AuthenticationPolicyManager is designed to protect Android users by integrating with apps and key system components, such as the lock screen. It is not related to enterprise control surfaces and does not offer additional administrative controls.

Secure Lock

Secure lockdown includes a set of device locking capabilities to protect users in "at risk" environments.

To use secure lock, call #enableSecureLockDevice to enable it on the device. This will require the caller to have the android.Manifest.permission#MANAGE_SECURE_LOCK_DEVICE permission.

To disable secure lock on the device, call #disableSecureLockDevice. This will require the caller to have the android.Manifest.permission#MANAGE_SECURE_LOCK_DEVICE permission.

To check if the device meets the requirements to enable secure lock, call #getSecureLockDeviceAvailability. This will require the caller to have the android.Manifest.permission#MANAGE_SECURE_LOCK_DEVICE permission.

To check if secure lock is already enabled on the device, call #isSecureLockDeviceEnabled. This will require the caller to have the android.Manifest.permission#MANAGE_SECURE_LOCK_DEVICE permission.

To listen for changes in the availability or enabled / disabled status of Secure Lock Device, register a android.security.authenticationpolicy.AuthenticationPolicyManager.SecureLockDeviceStatusListener using #registerSecureLockDeviceStatusListener(java.util.concurrent.Executor,android.security.authenticationpolicy.AuthenticationPolicyManager.SecureLockDeviceStatusListener). To unregister a previously registered listener, use #unregisterSecureLockDeviceStatusListener(android.security.authenticationpolicy.AuthenticationPolicyManager.SecureLockDeviceStatusListener).

Cross Device Authentication Framework

AuthenticationPolicyManager exposes a set of methods that can be used by privileged components to gate access to select functionality.

This will require the caller to have the android.Manifest.permission#MANAGE_CROSS_DEVICE_AUTHENTICATED_MESSAGES permission.

Cross device access requests can be initiated on one device by calling #createCrossDeviceAuthenticationRequest(android.companion.DeviceId,java.lang.String,java.util.concurrent.Executor). The returned token should be transmitted to another device, via any means, and the receiving service should then use that token to call #parseCrossDeviceAuthenticationRequest(byte[],java.lang.String,java.util.concurrent.Executor,android.os.OutcomeReceiver) before executing the request. This ensures that a common set of security checks are verified before executing the request and it decouples many form factor specific checks from the service being guarded.

Summary