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

Commit 1c32743a authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Swipe up to unlock when pulsing

Bug: 111405682
Test: adb shell am broadcast -a com.android.systemui.doze.pulse com.android.systemui
Change-Id: Ida5adb6a18f3ee992b1d154e10b35ba244f5b712
parent 357f4472
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1843,6 +1843,13 @@ public class KeyguardViewMediator extends SystemUI {
     */
    private void handleHide() {
        Trace.beginSection("KeyguardViewMediator#handleHide");

        // It's possible that the device was unlocked in a dream state. It's time to wake up.
        if (mAodShowing) {
            PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
            pm.wakeUp(SystemClock.uptimeMillis(), "com.android.systemui:BOUNCER_DOZING");
        }

        synchronized (KeyguardViewMediator.this) {
            if (DEBUG) Log.d(TAG, "handleHide");

+1 −1
Original line number Diff line number Diff line
@@ -956,7 +956,7 @@ public class NotificationPanelView extends PanelView implements
            handled = true;
        }
        handled |= super.onTouchEvent(event);
        return mDozing ? handled : true;
        return !mDozing || mPulsing || handled;
    }

    private boolean handleQsTouch(MotionEvent event) {
+4 −4
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
            mExpansionFraction = fraction;

            final boolean keyguardOrUnlocked = mState == ScrimState.UNLOCKED
                    || mState == ScrimState.KEYGUARD;
                    || mState == ScrimState.KEYGUARD || mState == ScrimState.PULSING;
            if (!keyguardOrUnlocked || !mExpansionAffectsAlpha) {
                return;
            }
@@ -409,7 +409,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
            behindFraction = (float) Math.pow(behindFraction, 0.8f);
            mCurrentBehindAlpha = behindFraction * GRADIENT_SCRIM_ALPHA_BUSY;
            mCurrentInFrontAlpha = 0;
        } else if (mState == ScrimState.KEYGUARD) {
        } else if (mState == ScrimState.KEYGUARD || mState == ScrimState.PULSING) {
            // Either darken of make the scrim transparent when you
            // pull down the shade
            float interpolatedFract = getInterpolatedFraction();
@@ -562,8 +562,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        if (alpha == 0f) {
            scrim.setClickable(false);
        } else {
            // Eat touch events (unless dozing or pulsing).
            scrim.setClickable(mState != ScrimState.AOD && mState != ScrimState.PULSING);
            // Eat touch events (unless dozing).
            scrim.setClickable(mState != ScrimState.AOD);
        }
        updateScrim(scrim, alpha);
    }
+14 −10
Original line number Diff line number Diff line
@@ -3573,10 +3573,7 @@ public class StatusBar extends SystemUI implements DemoMode,
            mVisualStabilityManager.setScreenOn(false);
            updateVisibleToUser();

            // We need to disable touch events because these might
            // collapse the panel after we expanded it, and thus we would end up with a blank
            // Keyguard.
            mNotificationPanel.setTouchAndAnimationDisabled(true);
            updateNotificationPanelTouchState();
            mStatusBarWindow.cancelCurrentTouch();
            if (mLaunchCameraOnFinishedGoingToSleep) {
                mLaunchCameraOnFinishedGoingToSleep = false;
@@ -3599,13 +3596,22 @@ public class StatusBar extends SystemUI implements DemoMode,
            mDeviceInteractive = true;
            mAmbientPulseManager.releaseAllImmediately();
            mVisualStabilityManager.setScreenOn(true);
            mNotificationPanel.setTouchAndAnimationDisabled(false);
            updateNotificationPanelTouchState();
            updateVisibleToUser();
            updateIsKeyguard();
            mDozeServiceHost.stopDozing();
        }
    };

    /**
     * We need to disable touch events because these might
     * collapse the panel after we expanded it, and thus we would end up with a blank
     * Keyguard.
     */
    private void updateNotificationPanelTouchState() {
        mNotificationPanel.setTouchAndAnimationDisabled(!mDeviceInteractive && !mPulsing);
    }

    final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() {
        @Override
        public void onScreenTurningOn() {
@@ -3871,17 +3877,15 @@ public class StatusBar extends SystemUI implements DemoMode,
                @Override
                public void onPulseStarted() {
                    callback.onPulseStarted();
                    if (mAmbientPulseManager.hasNotifications()) {
                        // Only pulse the stack scroller if there's actually something to show.
                        // Otherwise just show the always-on screen.
                    updateNotificationPanelTouchState();
                    setPulsing(true);
                }
                }

                @Override
                public void onPulseFinished() {
                    mPulsing = false;
                    callback.onPulseFinished();
                    updateNotificationPanelTouchState();
                    setPulsing(false);
                }

+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
            mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
        } else if (bouncerNeedsScrimming()) {
            mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
        } else if (mShowing && !mDozing) {
        } else if (mShowing) {
            if (!isWakeAndUnlocking() && !mStatusBar.isInLaunchTransition()) {
                mBouncer.setExpansion(expansion);
            }
Loading