PHP
·
发表于 5年以前
·
阅读量:8410
public static boolean isSleeping(Context context) {
KeyguardManager kgMgr = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
boolean isSleeping = kgMgr.inKeyguardRestrictedInputMode();
return isSleeping;
}