UserManager.InvokeIsUserUnlocked(UserHandle) Method

Definition

Return whether the given user is running in an "unlocked" state.

[Android.Runtime.Register("isUserUnlocked", "(Landroid/os/UserHandle;)Z", "GetInvokeIsUserUnlocked_Landroid_os_UserHandle_Handler", ApiSince=24)]
public virtual bool InvokeIsUserUnlocked (Android.OS.UserHandle? user);
[<Android.Runtime.Register("isUserUnlocked", "(Landroid/os/UserHandle;)Z", "GetInvokeIsUserUnlocked_Landroid_os_UserHandle_Handler", ApiSince=24)>]
abstract member InvokeIsUserUnlocked : Android.OS.UserHandle -> bool
override this.InvokeIsUserUnlocked : Android.OS.UserHandle -> bool

Parameters

user
UserHandle

to retrieve the unlocked state for.

Returns

Attributes

Remarks

Return whether the given user is running in an "unlocked" state.

On devices with direct boot, a user is unlocked only after they've entered their credentials (such as a lock pattern or PIN). On devices without direct boot, a user is unlocked as soon as it starts.

When a user is locked, only device-protected data storage is available. When a user is unlocked, both device-protected and credential-protected private app data storage is available.

Requires android.permission.MANAGE_USERS or android.permission.INTERACT_ACROSS_USERS, otherwise specified UserHandle user must be the calling user or a profile associated with it.

Java documentation for android.os.UserManager.isUserUnlocked(android.os.UserHandle).

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