Automatically dismiss (auto-unlock) lock screen (keyguard) - Fire OS 8

I have an app running fine on Fire OS 7 (Fire HD 10 9th & 11th gen), but has this issue on Fire OS 8 (Fire HD 10 13th gen.): Can’t auto-dismiss the Keyguard: I get these messages within Logcat when I try to do it:

cannot setShowWhenLocked  without com.amazon.permission.ENABLE_KEYGUARD_FLAGS permission. 
cannot dismissKeyguard  without com.amazon.permission.ENABLE_KEYGUARD_FLAGS permission.

The question is: How can I grant this permission? I have tried adding the permission to the Manifest and requesting it at runtime, but is never granted. I also haven’t found any related entry within the Settings app.

Some more details:

  • My app runs a foreground service, that launches an activity when some alert is received.
  • The activity turns the screen on and dismisses the keyguard using the following code in onResume():
setTurnScreenOn(true);
setShowWhenLocked(true);
keyguardManager.requestDismissKeyguard(this, new KeyguardManager.KeyguardDismissCallback() ...
  • It works fine on the latest Fire OS 7 (7.3.3.1)
  • It doesn’t work on the latest Fire OS 8 (8.3.3.1)

Thanks.

Hello @Rafael ,

Thanks for posting. We have messaged the appropriate team for further investigation and will let you know once we receive an update.

1 Like

Hi Rafael,

The protection level for this permission is set as System signature. So this permission will not be granted to any third party app. If by any chance it was granted in Fire OS 7, then it was not intentional.

Thank you very much for the answer.

I take it means that KeyguardManager.requestDismissKeyguard() functionality will no longer be supported by Fire OS, right?

If that is indeed the case, it would be helpful to add this information to your list of changes, so other developers don’t waste time trying to implement what cannot be implemented.

Thank you.

Thanks Rafael,

I asked the relevant team to update the docs.