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

Commit ed85e586 authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Wake up on double tap instead of requesting pulse

When we are already showing AOD1 always, we need to
wake up instead of requesting a pulse.

Change-Id: I2931334caa350a157a1eab24f00ddf1ab913cc34
Fixes: 37751889
Test: Turn on AOD, double tap on AOD, verify device wakes up.
parent 1d5ceb53
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -99,9 +99,20 @@ public class DozeTriggers implements DozeMachine.Part {
    }

    private void onSensor(int pulseReason, boolean sensorPerformedProxCheck) {
        boolean isDoubleTap = pulseReason == DozeLog.PULSE_REASON_SENSOR_DOUBLE_TAP;
        boolean isPickup = pulseReason == DozeLog.PULSE_REASON_SENSOR_PICKUP;

        if (mConfig.alwaysOnEnabled(UserHandle.USER_CURRENT)) {
            if (isDoubleTap) {
                mMachine.wakeUp();
            } else {
                mDozeHost.extendPulse();
            }
        } else {
            requestPulse(pulseReason, sensorPerformedProxCheck);
        }

        if (pulseReason == DozeLog.PULSE_REASON_SENSOR_PICKUP) {
        if (isPickup) {
            final long timeSinceNotification =
                    SystemClock.elapsedRealtime() - mNotificationPulseTime;
            final boolean withinVibrationThreshold =