Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6510438b authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Fix prox and wake sensor conflict

Test: manual
Bug: 111414690
Bug: 111405682
Change-Id: I5c625936781bb8404c4b1507a164c9dfe7d76f29
parent 3af0f3a7
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -401,7 +401,9 @@ public class DozeSensors {
                }
                mCallback.onSensorPulse(mPulseReason, sensorPerformsProxCheck, screenX, screenY,
                        event.values);
                if (!mRegistered) {
                    updateListener();  // reregister, this sensor only fires once
                }
            }));
        }

@@ -440,7 +442,9 @@ public class DozeSensors {
                mRegistered = false;
                mCallback.onSensorPulse(mPulseReason, true /* sensorPerformsProxCheck */, -1, -1,
                        event.getValues());
                if (!mRegistered) {
                    updateListener();  // reregister, this sensor only fires once
                }
            }));
        };

@@ -487,7 +491,6 @@ public class DozeSensors {
            }
            return sb.append(']').toString();
        }

    }

    public interface Callback {
+3 −2
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ public class DozeTriggers implements DozeMachine.Part {
            if (DEBUG) Log.i(TAG, "Prox changed, ignore touch = " + ignoreTouch);
            mDozeHost.onIgnoreTouchWhilePulsing(ignoreTouch);
        }

        if (far && (paused || pausing)) {
            if (DEBUG) Log.i(TAG, "Prox FAR, unpausing AOD");
            mMachine.requestState(DozeMachine.State.DOZE_AOD);
@@ -205,13 +206,13 @@ public class DozeTriggers implements DozeMachine.Part {
                    // In pocket, drop event.
                    return;
                }
                if (pausing || paused) {
                if (mMachine.getState() == DozeMachine.State.DOZE) {
                    mMachine.requestState(DozeMachine.State.DOZE_AOD);
                }
            }, false /* alreadyPerformedProxCheck */, DozeLog.REASON_SENSOR_WAKE_UP);
        } else {
            if (!pausing && !paused) {
                mMachine.requestState(DozeMachine.State.DOZE_AOD_PAUSING);
                mMachine.requestState(DozeMachine.State.DOZE);
            }
        }
    }