判断是否是锁屏状态:
public boolean isLockScreenOn() { KeyguardManager mKeyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); if (mKeyguardManager.inKeyguardRestrictedInputMode()) { return true; } else { return false; } }