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

Commit 32eeff7f authored by Dave Mankoff's avatar Dave Mankoff Committed by android-build-merger
Browse files

Merge "Ensure that notifications don't wake the screen even when far away." into qt-r1-dev

am: 5818d2f6

Change-Id: I32e7c954a274bbfd60c0ca96c4aca375ea3a983d
parents 8ecabb4b 5818d2f6
Loading
Loading
Loading
Loading
+19 −5
Original line number Original line Diff line number Diff line
@@ -107,9 +107,17 @@ public class DozeTriggers implements DozeMachine.Part {
    }
    }


    private void onNotification() {
    private void onNotification() {
        if (DozeMachine.DEBUG) Log.d(TAG, "requestNotificationPulse");
        if (DozeMachine.DEBUG) {
            Log.d(TAG, "requestNotificationPulse");
        }
        if (!sWakeDisplaySensorState) {
            Log.d(TAG, "Wake display false. Pulse denied.");
            return;
        }
        mNotificationPulseTime = SystemClock.elapsedRealtime();
        mNotificationPulseTime = SystemClock.elapsedRealtime();
        if (!mConfig.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) return;
        if (!mConfig.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) {
            return;
        }
        requestPulse(DozeLog.PULSE_REASON_NOTIFICATION, false /* performedProxCheck */);
        requestPulse(DozeLog.PULSE_REASON_NOTIFICATION, false /* performedProxCheck */);
        DozeLog.traceNotificationPulse(mContext);
        DozeLog.traceNotificationPulse(mContext);
    }
    }
@@ -216,15 +224,21 @@ public class DozeTriggers implements DozeMachine.Part {
        if (state == DozeMachine.State.DOZE_PULSING
        if (state == DozeMachine.State.DOZE_PULSING
                || state == DozeMachine.State.DOZE_PULSING_BRIGHT) {
                || state == DozeMachine.State.DOZE_PULSING_BRIGHT) {
            boolean ignoreTouch = near;
            boolean ignoreTouch = near;
            if (DEBUG) Log.i(TAG, "Prox changed, ignore touch = " + ignoreTouch);
            if (DEBUG) {
                Log.i(TAG, "Prox changed, ignore touch = " + ignoreTouch);
            }
            mDozeHost.onIgnoreTouchWhilePulsing(ignoreTouch);
            mDozeHost.onIgnoreTouchWhilePulsing(ignoreTouch);
        }
        }


        if (far && (paused || pausing)) {
        if (far && (paused || pausing)) {
            if (DEBUG) Log.i(TAG, "Prox FAR, unpausing AOD");
            if (DEBUG) {
                Log.i(TAG, "Prox FAR, unpausing AOD");
            }
            mMachine.requestState(DozeMachine.State.DOZE_AOD);
            mMachine.requestState(DozeMachine.State.DOZE_AOD);
        } else if (near && aod) {
        } else if (near && aod) {
            if (DEBUG) Log.i(TAG, "Prox NEAR, pausing AOD");
            if (DEBUG) {
                Log.i(TAG, "Prox NEAR, pausing AOD");
            }
            mMachine.requestState(DozeMachine.State.DOZE_AOD_PAUSING);
            mMachine.requestState(DozeMachine.State.DOZE_AOD_PAUSING);
        }
        }
    }
    }