android.app.KeyguardManager.KeyguardLock Java Examples

The following examples show how to use android.app.KeyguardManager.KeyguardLock. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ScreenLockUtil.java    From AndroidModulePattern with Apache License 2.0 5 votes vote down vote up
/**
 * 取消锁屏限制
 *
 * @param activity you know
 */
private static void cancelLockScreen(Activity activity) {
    Boolean isUnlock = mIsUnlockArray.get(activity);
    if (isUnlock != null && isUnlock) {
        return;
    }
    KeyguardManager mKeyguardManager = (KeyguardManager) activity.getSystemService(Context.KEYGUARD_SERVICE);
    KeyguardLock mKeyguardLock = mKeyguardManager.newKeyguardLock(activity.getClass().getName());
    mKeyguardLock.disableKeyguard();

    mIsUnlockArray.put(activity, true);
}
 
Example #2
Source File: LockerUtils.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
public static void noSysLocker(Context context) {
	KeyguardManager keyguardManager = (KeyguardManager) context
			.getApplicationContext().getSystemService(
					Context.KEYGUARD_SERVICE);
	KeyguardLock keyguardLock = keyguardManager.newKeyguardLock("Zhaome");
	keyguardLock.disableKeyguard();
}
 
Example #3
Source File: LockerUtils.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
public static void haveSysLocker(Context context) {
	KeyguardManager keyguardManager = (KeyguardManager) context
			.getApplicationContext().getSystemService(
					Context.KEYGUARD_SERVICE);
	KeyguardLock keyguardLock = keyguardManager.newKeyguardLock("Zhaome");
	keyguardLock.reenableKeyguard();
}