private KeyguardManager.KeyguardLock mKeyguardLock = null;
private KeyguardManager mKeyguardManager = null;
private PowerManager.WakeLock mWakeLock;


public void enterIncallMode() {
		if (!(mWakeLock.isHeld())) {
			
			mWakeLock.setReferenceCounted(false);
			mWakeLock.acquire();
		}
		mKeyguardLock = this.mKeyguardManager.newKeyguardLock("");
		mKeyguardLock.disableKeyguard();
	}

	public void initProwerManager() {
		mWakeLock = ((PowerManager) getSystemService("power")).newWakeLock(
				PowerManager.SCREEN_DIM_WAKE_LOCK
						| PowerManager.ACQUIRE_CAUSES_WAKEUP, "CALL_ACTIVITY#"
						+ super.getClass().getName());
		mKeyguardManager = ((KeyguardManager) getSystemService("keyguard"));
	}

	public void releaseWakeLock() {
		try {
			if (this.mWakeLock.isHeld()) {
				if (this.mKeyguardLock != null) {
					this.mKeyguardLock.reenableKeyguard();
					this.mKeyguardLock = null;
				}
				this.mWakeLock.release();
			}
			return;
		} catch (Exception localException) {
			ECLog4Util.e("AndroidRuntime", localException.toString());
		}
	}


	
色迷迷 哭 呕吐 大笑 口水 微笑 啵一个 发怒

Hi,您需要填写昵称和邮箱!

  • 必填项
  • 必填项