androidkeyguard

android after disableKeyguard the inKeyguardRestrictedInputMode() still return true


version: android 4.4.2

I use keyguardLock.disableKeyguard() unlock the screen, then use keyguardManager.inKeyguardRestrictedInputMode() print screen lock state, it always return true,but the powerManager.isScreenOn() return true,and i can use my phone normally.

ps: I do lock and unlock in a android service.

Is there any thing wrong when use disableKeyguard()?


Solution

  • The keyguardLock is deprecated starting from API 13. Please use the FLAG_DISMISS_KEYGUARD and/or FLAG_SHOW_WHEN_LOCKED. See here