DevicePolicyManager.SetRequiredStrongAuthTimeout(ComponentName, Int64) Method

Definition

Called by a device/profile owner to set the timeout after which unlocking with secondary, non strong auth (e.

[Android.Runtime.Register("setRequiredStrongAuthTimeout", "(Landroid/content/ComponentName;J)V", "GetSetRequiredStrongAuthTimeout_Landroid_content_ComponentName_JHandler", ApiSince=26)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")]
public virtual void SetRequiredStrongAuthTimeout (Android.Content.ComponentName? admin, long timeoutMs);
[<Android.Runtime.Register("setRequiredStrongAuthTimeout", "(Landroid/content/ComponentName;J)V", "GetSetRequiredStrongAuthTimeout_Landroid_content_ComponentName_JHandler", ApiSince=26)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")>]
abstract member SetRequiredStrongAuthTimeout : Android.Content.ComponentName * int64 -> unit
override this.SetRequiredStrongAuthTimeout : Android.Content.ComponentName * int64 -> unit

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with. Null if the caller is not a device admin

timeoutMs
Int64

The new timeout in milliseconds, after which the user will have to unlock with strong authentication method. A value of 0 means the admin is not participating in controlling the timeout. The minimum and maximum timeouts are platform-defined and are typically 1 hour and 72 hours, respectively. Though discouraged, the admin may choose to require strong auth at all times using #KEYGUARD_DISABLE_FINGERPRINT and/or #KEYGUARD_DISABLE_TRUST_AGENTS.

Attributes

Remarks

Called by a device/profile owner to set the timeout after which unlocking with secondary, non strong auth (e.g. fingerprint, face, trust agents) times out, i.e. the user has to use a strong authentication method like password, pin or pattern.

This timeout is used internally to reset the timer to require strong auth again after specified timeout each time it has been successfully used.

Fingerprint can also be disabled altogether using #KEYGUARD_DISABLE_FINGERPRINT.

Trust agents can also be disabled altogether using #KEYGUARD_DISABLE_TRUST_AGENTS.

A calling device admin can verify the value it has set by calling #getRequiredStrongAuthTimeout(ComponentName) and passing in its instance.

This method can be called on the DevicePolicyManager instance returned by #getParentProfileInstance(ComponentName) in order to set restrictions on the parent profile.

On devices not supporting PackageManager#FEATURE_SECURE_LOCK_SCREEN feature, calling this methods has no effect - i.e. the timeout is not set.

Java documentation for android.app.admin.DevicePolicyManager.setRequiredStrongAuthTimeout(android.content.ComponentName, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to