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

Commit b4671196 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "AOD: Wake up on double tap instead of requesting pulse"

parents b9511da2 ed85e586
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 =