Skip to content

Instantly share code, notes, and snippets.

@mstoic
Created September 16, 2018 18:43
Show Gist options
  • Save mstoic/c35b851e3fe7729642ed221e7962048d to your computer and use it in GitHub Desktop.
Save mstoic/c35b851e3fe7729642ed221e7962048d to your computer and use it in GitHub Desktop.
KeyguardManager myKM = (KeyguardManager) getApplicationContext().getSystemService(Context.KEYGUARD_SERVICE);
if( myKM.inKeyguardRestrictedInputMode()) {
// Phone is locked
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment