@Implements(android.app.KeyguardManager.class) public class ShadowKeyguardManager extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ShadowKeyguardManager.ShadowKeyguardLock |
An implementation of
KeyguardManager.KeyguardLock, for use in tests. |
| Constructor | Description |
|---|---|
ShadowKeyguardManager() |
| Modifier and Type | Method | Description |
|---|---|---|
protected Intent |
createConfirmFactoryResetCredentialIntent(CharSequence title,
CharSequence description,
CharSequence alternateButtonLabel) |
Returns the intent set via
setConfirmFactoryResetCredentialIntent(Intent), otherwise null. |
protected boolean |
inKeyguardRestrictedInputMode() |
For tests, returns the value set via
setinRestrictedInputMode(boolean), or false by
default. |
protected boolean |
isDeviceLocked() |
|
protected boolean |
isDeviceLocked(int userId) |
|
protected boolean |
isDeviceSecure() |
For tests on Android >=M, returns the value set by
setIsDeviceSecure(boolean), or
false by default. |
protected boolean |
isDeviceSecure(int userId) |
For tests on Android >=M, returns the value set by
setIsDeviceSecure(int, boolean), or
false by default. |
protected boolean |
isKeyguardLocked() |
For tests, returns the value set via
setKeyguardLocked(boolean), or false by default. |
protected boolean |
isKeyguardSecure() |
For tests, returns the value set by
setIsKeyguardSecure(boolean), or false by default. |
protected void |
requestDismissKeyguard(Activity activity,
KeyguardManager.KeyguardDismissCallback callback) |
|
static void |
reset() |
|
void |
setConfirmFactoryResetCredentialIntent(Intent intent) |
For tests on Android >= O MR1, sets the value to be returned by
createConfirmFactoryResetCredentialIntent(CharSequence,CharSequence,CharSequence). |
void |
setinRestrictedInputMode(boolean restricted) |
Deprecated.
use
setInRestrictedInputMode(boolean) instead |
void |
setInRestrictedInputMode(boolean restricted) |
Sets the value to be returned by
KeyguardManager.inKeyguardRestrictedInputMode(). |
void |
setIsDeviceLocked(boolean isDeviceLocked) |
For tests on Android >=L MR1, sets the value to be returned by
isDeviceLocked(). |
void |
setIsDeviceLocked(int userId,
boolean isLocked) |
For tests on Android >= L MR1, sets the value to be returned by
isDeviceLocked(int). |
void |
setIsDeviceSecure(boolean isDeviceSecure) |
For tests on Android >=M, sets the value to be returned by
isDeviceSecure(). |
void |
setIsDeviceSecure(int userId,
boolean isDeviceSecure) |
For tests on Android >=M, sets the value to be returned by
isDeviceSecure(int). |
void |
setIsKeyguardSecure(boolean secure) |
Sets the value to be returned by
isKeyguardSecure(). |
void |
setKeyguardLocked(boolean isKeyguardLocked) |
Sets whether the device keyguard is locked or not.
|
@Implementation protected boolean inKeyguardRestrictedInputMode()
setinRestrictedInputMode(boolean), or false by
default.setInRestrictedInputMode(boolean)@Implementation(minSdk=26) protected void requestDismissKeyguard(Activity activity, KeyguardManager.KeyguardDismissCallback callback)
@Implementation protected boolean isKeyguardLocked()
setKeyguardLocked(boolean), or false by default.setKeyguardLocked(boolean)public void setKeyguardLocked(boolean isKeyguardLocked)
isKeyguardLocked() and also invokes callbacks set in KeyguardManager.requestDismissKeyguard(Activity, KeyguardDismissCallback) ()}.isKeyguardLocked - true to lock the keyguard. If a KeyguardDismissCallback is set will
fire KeyguardManager.KeyguardDismissCallback.onDismissCancelled() or false to unlock and dismiss
the keyguard firing KeyguardManager.KeyguardDismissCallback.onDismissSucceeded() if a
KeyguardDismissCallback is set.@Deprecated public void setinRestrictedInputMode(boolean restricted)
setInRestrictedInputMode(boolean) insteadKeyguardManager.inKeyguardRestrictedInputMode().public void setInRestrictedInputMode(boolean restricted)
KeyguardManager.inKeyguardRestrictedInputMode().@Implementation protected boolean isKeyguardSecure()
setIsKeyguardSecure(boolean), or false by default.setIsKeyguardSecure(boolean)public void setIsKeyguardSecure(boolean secure)
isKeyguardSecure().isKeyguardSecure()@Implementation(minSdk=23) protected boolean isDeviceSecure()
setIsDeviceSecure(boolean), or
false by default.setIsDeviceSecure(boolean)public void setIsDeviceSecure(boolean isDeviceSecure)
isDeviceSecure().isDeviceSecure()@Implementation(minSdk=23) protected boolean isDeviceSecure(int userId)
setIsDeviceSecure(int, boolean), or
false by default.setIsDeviceSecure(int, boolean)public void setIsDeviceSecure(int userId,
boolean isDeviceSecure)
isDeviceSecure(int).isDeviceSecure(int)public void setIsDeviceLocked(boolean isDeviceLocked)
isDeviceLocked().isDeviceLocked()@Implementation(minSdk=22) protected boolean isDeviceLocked()
setIsDeviceLocked(boolean).isDeviceLocked()public void setIsDeviceLocked(int userId,
boolean isLocked)
isDeviceLocked(int).isDeviceLocked(int)@Implementation(minSdk=22) protected boolean isDeviceLocked(int userId)
public void setConfirmFactoryResetCredentialIntent(Intent intent)
createConfirmFactoryResetCredentialIntent(CharSequence,CharSequence,CharSequence).@Implementation(minSdk=27) protected Intent createConfirmFactoryResetCredentialIntent(CharSequence title, CharSequence description, CharSequence alternateButtonLabel)
setConfirmFactoryResetCredentialIntent(Intent), otherwise null.@Resetter public static void reset()