Class ShadowKeyguardManager


  • @Implements(android.app.KeyguardManager.class)
    public class ShadowKeyguardManager
    extends java.lang.Object
    • Constructor Detail

      • ShadowKeyguardManager

        public ShadowKeyguardManager()
    • Method Detail

      • requestDismissKeyguard

        @Implementation(minSdk=26)
        protected void requestDismissKeyguard​(android.app.Activity activity,
                                              android.app.KeyguardManager.KeyguardDismissCallback callback)
      • setKeyguardLocked

        public void setKeyguardLocked​(boolean isKeyguardLocked)
        Sets whether the device keyguard is locked or not. This affects the value to be returned by isKeyguardLocked() and also invokes callbacks set in KeyguardManager.requestDismissKeyguard(Activity, KeyguardDismissCallback) ()}.
        Parameters:
        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.
      • setinRestrictedInputMode

        @Deprecated
        public void setinRestrictedInputMode​(boolean restricted)
        Deprecated.
        Sets the value to be returned by KeyguardManager.inKeyguardRestrictedInputMode().
        See Also:
        KeyguardManager.inKeyguardRestrictedInputMode()
      • setInRestrictedInputMode

        public void setInRestrictedInputMode​(boolean restricted)
        Sets the value to be returned by KeyguardManager.inKeyguardRestrictedInputMode().
        See Also:
        KeyguardManager.inKeyguardRestrictedInputMode()
      • setIsDeviceSecure

        public void setIsDeviceSecure​(boolean isDeviceSecure)
        For tests on Android >=M, sets the value to be returned by isDeviceSecure().
        See Also:
        isDeviceSecure()
      • setIsDeviceSecure

        public void setIsDeviceSecure​(int userId,
                                      boolean isDeviceSecure)
        For tests on Android >=M, sets the value to be returned by isDeviceSecure(int).
        See Also:
        isDeviceSecure(int)
      • setIsDeviceLocked

        public void setIsDeviceLocked​(boolean isDeviceLocked)
        For tests on Android >=L MR1, sets the value to be returned by isDeviceLocked().
        See Also:
        isDeviceLocked()
      • setIsDeviceLocked

        public void setIsDeviceLocked​(int userId,
                                      boolean isLocked)
        For tests on Android >= L MR1, sets the value to be returned by isDeviceLocked(int).
        See Also:
        isDeviceLocked(int)
      • isDeviceLocked

        @Implementation(minSdk=22)
        protected boolean isDeviceLocked​(int userId)
      • createConfirmFactoryResetCredentialIntent

        @Implementation(minSdk=27)
        protected android.content.Intent createConfirmFactoryResetCredentialIntent​(java.lang.CharSequence title,
                                                                                   java.lang.CharSequence description,
                                                                                   java.lang.CharSequence alternateButtonLabel)
        Returns the intent set via setConfirmFactoryResetCredentialIntent(Intent), otherwise null.
      • reset

        @Resetter
        public static void reset()