KeyguardManager keyguardManager = (KeyguardManager) ActivityThread.currentApplication().getSystemService(Context.KEYGUARD_SERVICE);
boolean isKeyguardShown = keyguardManager.isKeyguardLocked();
true — 锁屏
false — 解锁
本文摘自 :https://blog.51cto.com/u