KeyguardManager.IsDeviceLocked Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns whether the device is currently locked for the user.
public virtual bool IsDeviceLocked { [Android.Runtime.Register("isDeviceLocked", "()Z", "GetIsDeviceLockedHandler", ApiSince=22)] get; }
[<get: Android.Runtime.Register("isDeviceLocked", "()Z", "GetIsDeviceLockedHandler", ApiSince=22)>]
member this.IsDeviceLocked : bool
Property Value
true
if the device is currently locked for the user
- Attributes
Remarks
Returns whether the device is currently locked for the user.
This method returns the device locked state for the Context
's user. The device is considered to be locked for a user when the user's apps are currently inaccessible and some form of lock screen authentication is required to regain access to them. The lock screen authentication typically uses PIN, pattern, password, or biometric. Some devices may support additional methods, such as unlock using a paired smartwatch. "Swipe" does not count as authentication; if the lock screen is dismissible with swipe, for example due to the lock screen being set to Swipe or due to the device being kept unlocked by being near a trusted bluetooth device or in a trusted location, the device is considered unlocked. <div class="note">
<b>Note:</b> In the case of multiple full users, each user can have their own lock screen authentication configured. The device-locked state may differ between different users. For example, the device may be unlocked for the current user, but locked for a non-current user if lock screen authentication would be required to access that user's apps after switching to that user.
In the case of a profile, when the device goes to the main lock screen, up to two layers of authentication may be required to regain access to the profile's apps: one to unlock the main lock screen, and one to unlock the profile (when a separate profile challenge is required). For a profile, the device is considered to be locked as long as any challenge remains, either the parent user's challenge (when applicable) or the profile's challenge (when applicable). </div>
Java documentation for android.app.KeyguardManager.isDeviceLocked()
.
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.