Gestures: allow larger proximity values
Some device report the distance larger than maximum. Allow these
devices to pass the proximity check. The same logic is used in
frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
for proximity check on wake.
Change-Id: I2efd9adafd3d63f0df83c195f306c1f81fdfea91
diff --git a/src/org/lineageos/lineageparts/gestures/KeyHandler.java b/src/org/lineageos/lineageparts/gestures/KeyHandler.java
index a6387bf..67d42e2 100644
--- a/src/org/lineageos/lineageparts/gestures/KeyHandler.java
+++ b/src/org/lineageos/lineageparts/gestures/KeyHandler.java
@@ -189,7 +189,7 @@
return;
}
mEventHandler.removeMessages(GESTURE_REQUEST);
- if (event.values[0] == mProximitySensor.getMaximumRange()) {
+ if (event.values[0] >= mProximitySensor.getMaximumRange()) {
Message msg = getMessageForAction(action);
mEventHandler.sendMessage(msg);
}