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