Fields Summary |
---|
private android.view.IWindowManager | mWM |
private android.app.trust.ITrustManager | mTrustManager |
public static final String | ACTION_CONFIRM_DEVICE_CREDENTIALIntent used to prompt user for device credentials. |
public static final String | EXTRA_TITLEA CharSequence dialog title to show to the user when used with a
{@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}. |
public static final String | EXTRA_DESCRIPTIONA CharSequence description to show to the user when used with
{@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}. |
Methods Summary |
---|
public android.content.Intent | createConfirmDeviceCredentialIntent(java.lang.CharSequence title, java.lang.CharSequence description)Get an intent to prompt the user to confirm credentials (pin, pattern or password)
for the current user of the device. The caller is expected to launch this activity using
{@link android.app.Activity#startActivityForResult(Intent, int)} and check for
{@link android.app.Activity#RESULT_OK} if the user successfully completes the challenge.
if (!isKeyguardSecure()) return null;
Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL);
intent.putExtra(EXTRA_TITLE, title);
intent.putExtra(EXTRA_DESCRIPTION, description);
// For security reasons, only allow this to come from system settings.
intent.setPackage("com.android.settings");
return intent;
|
public void | exitKeyguardSecurely(android.app.KeyguardManager$OnKeyguardExitResult callback)
try {
mWM.exitKeyguardSecurely(new IOnKeyguardExitResult.Stub() {
public void onKeyguardExitResult(boolean success) throws RemoteException {
if (callback != null) {
callback.onKeyguardExitResult(success);
}
}
});
} catch (RemoteException e) {
}
|
public boolean | inKeyguardRestrictedInputMode()If keyguard screen is showing or in restricted key input mode (i.e. in
keyguard password emergency screen). When in such mode, certain keys,
such as the Home key and the right soft keys, don't work.
try {
return mWM.inKeyguardRestrictedInputMode();
} catch (RemoteException ex) {
return false;
}
|
public boolean | isDeviceLocked()Returns whether the device is currently locked and requires a PIN, pattern or
password to unlock.
return isDeviceLocked(UserHandle.getCallingUserId());
|
public boolean | isDeviceLocked(int userId)Returns whether the device is currently locked and requires a PIN, pattern or
password to unlock.
try {
return mTrustManager.isDeviceLocked(userId);
} catch (RemoteException e) {
return false;
}
|
public boolean | isKeyguardLocked()Return whether the keyguard is currently locked.
try {
return mWM.isKeyguardLocked();
} catch (RemoteException ex) {
return false;
}
|
public boolean | isKeyguardSecure()Return whether the keyguard requires a password to unlock.
try {
return mWM.isKeyguardSecure();
} catch (RemoteException ex) {
return false;
}
|
public android.app.KeyguardManager$KeyguardLock | newKeyguardLock(java.lang.String tag)
return new KeyguardLock(tag);
|