commit | 5e85ebc55b04ee4f7be4108b78a726df2f5e6d61 | [log] [tgz] |
---|---|---|
author | LuK1337 <priv.luk@gmail.com> | Mon Jul 10 08:20:37 2023 +0200 |
committer | LuK1337 <priv.luk@gmail.com> | Mon Jul 10 08:20:37 2023 +0200 |
tree | 40f084d07e51f6f26af3428485c052933809765f | |
parent | f06caa639ec8c4e6040cf710448050c822860094 [diff] |
LineageParts: Make sure wakelock is held before releasing it Change-Id: I5d98fa71f65334266459d0e4b07f8330a24d1a63
diff --git a/src/org/lineageos/lineageparts/gestures/KeyHandler.java b/src/org/lineageos/lineageparts/gestures/KeyHandler.java index b670bf0..61b93c6 100644 --- a/src/org/lineageos/lineageparts/gestures/KeyHandler.java +++ b/src/org/lineageos/lineageparts/gestures/KeyHandler.java
@@ -184,7 +184,9 @@ mSensorManager.registerListener(new SensorEventListener() { @Override public void onSensorChanged(SensorEvent event) { - mProximityWakeLock.release(); + if (mProximityWakeLock.isHeld()) { + mProximityWakeLock.release(); + } mSensorManager.unregisterListener(this); if (!mEventHandler.hasMessages(GESTURE_REQUEST)) { // The sensor took too long; ignoring