Kindle Fire permission and disable_keyguard
So based on https://developer.amazon.com/help/faq.html#KindleFire Kindle Fire doesn't support disable_keyguard permissions.
But I want my app to run on both regular Android devices and Kindle. Is there a simple solution to this problem?
And that permission should be there, so I can't just remove it from the app.
+3
source to share
3 answers
You can simply surround the disableKeyguard () call with try catch and do some extra logic there.
KeyguardManager kgm = (KeyguardManager) Application.getSystemService(Application.KEYGUARD_SERVICE);
KeyguardManager.KeyguardLock kl = kgm.newKeyguardLock(VIEW_LOG_TAG);
try{
kl.disableKeyguard();
}
catch (SecurityException e)
{
//kindle code goes here
}
+3
source to share
Not sure what the context of your application is, but what about Wake Lock? It might cost you some battery life.
0
source to share