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

Commit 85cd30cd authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Cancel touches on the unlocked animation" into tm-dev am: 10337fae

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17108929

Change-Id: Ifac47b438eb05f378217bf2102be2aa7715c88b0
parents fd4c616b 10337fae
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5026,6 +5026,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                .append(" qsExpandFraction=").append(mQsExpansionFraction)
                .append(" isCurrentUserSetup=").append(mIsCurrentUserSetup)
                .append(" hideAmount=").append(mAmbientState.getHideAmount())
                .append(" ambientStateSwipingUp=").append(mAmbientState.isSwipingUp())
                .append("]");
        pw.println(sb.toString());
        DumpUtilsKt.withIncreasedIndent(pw, () -> {
+20 −2
Original line number Diff line number Diff line
@@ -641,6 +641,7 @@ public class CentralSurfaces extends CoreStartable implements
    private boolean mWallpaperSupported;

    private Runnable mLaunchTransitionEndRunnable;
    private Runnable mLaunchTransitionCancelRunnable;
    private boolean mLaunchCameraWhenFinishedWaking;
    private boolean mLaunchCameraOnFinishedGoingToSleep;
    private boolean mLaunchEmergencyActionWhenFinishedWaking;
@@ -2967,12 +2968,15 @@ public class CentralSurfaces extends CoreStartable implements
     *
     * @param beforeFading the runnable to be run when the circle is fully expanded and the fading
     *                     starts
     * @param endRunnable the runnable to be run when the transition is done
     * @param endRunnable the runnable to be run when the transition is done. Will not run
     *                    if the transition is cancelled, instead cancelRunnable will run
     * @param cancelRunnable the runnable to be run if the transition is cancelled
     */
    public void fadeKeyguardAfterLaunchTransition(final Runnable beforeFading,
            Runnable endRunnable) {
            Runnable endRunnable, Runnable cancelRunnable) {
        mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
        mLaunchTransitionEndRunnable = endRunnable;
        mLaunchTransitionCancelRunnable = cancelRunnable;
        Runnable hideRunnable = () -> {
            mKeyguardStateController.setLaunchTransitionFadingAway(true);
            if (beforeFading != null) {
@@ -2994,6 +2998,15 @@ public class CentralSurfaces extends CoreStartable implements
        }
    }

    private void cancelAfterLaunchTransitionRunnables() {
        if (mLaunchTransitionCancelRunnable != null) {
            mLaunchTransitionCancelRunnable.run();
        }
        mLaunchTransitionEndRunnable = null;
        mLaunchTransitionCancelRunnable = null;
        mNotificationPanelViewController.setLaunchTransitionEndRunnable(null);
    }

    /**
     * Fades the content of the Keyguard while we are dozing and makes it invisible when finished
     * fading.
@@ -3033,6 +3046,7 @@ public class CentralSurfaces extends CoreStartable implements
    }

    private void runLaunchTransitionEndRunnable() {
        mLaunchTransitionCancelRunnable = null;
        if (mLaunchTransitionEndRunnable != null) {
            Runnable r = mLaunchTransitionEndRunnable;

@@ -3524,6 +3538,10 @@ public class CentralSurfaces extends CoreStartable implements
        public void onStartedGoingToSleep() {
            String tag = "CentralSurfaces#onStartedGoingToSleep";
            DejankUtils.startDetectingBlockingIpcs(tag);

            //  cancel stale runnables that could put the device in the wrong state
            cancelAfterLaunchTransitionRunnables();

            updateRevealEffect(false /* wakingUp */);
            updateNotificationPanelTouchState();
            maybeEscalateHeadsUp();
+9 −2
Original line number Diff line number Diff line
@@ -894,12 +894,19 @@ public class NotificationPanelViewController extends PanelViewController {
                        mDepthController.setBlursDisabledForUnlock(mTracking);

                        if (playingCannedAnimation && !isWakeAndUnlock) {
                            // Fling the panel away so it's not in the way or the surface behind the
                            // Hide the panel so it's not in the way or the surface behind the
                            // keyguard, which will be appearing. If we're wake and unlocking, the
                            // lock screen is hidden instantly so should not be flung away.
                            if (isTracking() || isFlinging()) {
                                // Instant collpase the notification panel since the notification
                                // panel is already in the middle animating
                                onTrackingStopped(false);
                                instantCollapse();
                            } else {
                                fling(0f, false, 0.7f, false);
                            }
                        }
                    }
                });
    }

+20 −2
Original line number Diff line number Diff line
@@ -36,12 +36,14 @@ import com.android.keyguard.LockIconViewController;
import com.android.systemui.R;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dock.DockManager;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.lowlightclock.LowLightClockController;
import com.android.systemui.statusbar.DragDownHelper;
import com.android.systemui.statusbar.LockscreenShadeTransitionController;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
@@ -71,6 +73,8 @@ public class NotificationShadeWindowViewController {
    private final LockIconViewController mLockIconViewController;
    private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
    private final StatusBarWindowStateController mStatusBarWindowStateController;
    private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
    private final AmbientState mAmbientState;

    private GestureDetector mGestureDetector;
    private View mBrightnessMirror;
@@ -109,7 +113,9 @@ public class NotificationShadeWindowViewController {
            LockIconViewController lockIconViewController,
            Optional<LowLightClockController> lowLightClockController,
            CentralSurfaces centralSurfaces,
            NotificationShadeWindowController controller) {
            NotificationShadeWindowController controller,
            KeyguardUnlockAnimationController keyguardUnlockAnimationController,
            AmbientState ambientState) {
        mLockscreenShadeTransitionController = transitionController;
        mFalsingCollector = falsingCollector;
        mTunerService = tunerService;
@@ -126,6 +132,8 @@ public class NotificationShadeWindowViewController {
        mLowLightClockController = lowLightClockController;
        mService = centralSurfaces;
        mNotificationShadeWindowController = controller;
        mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
        mAmbientState = ambientState;

        // This view is not part of the newly inflated expanded status bar.
        mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container);
@@ -203,7 +211,6 @@ public class NotificationShadeWindowViewController {
                // Reset manual touch dispatch state here but make sure the UP/CANCEL event still
                // gets
                // delivered.

                if (!isCancel && mService.shouldIgnoreTouch()) {
                    return false;
                }
@@ -219,6 +226,16 @@ public class NotificationShadeWindowViewController {
                    return false;
                }

                if (mKeyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) {
                    // If the user was sliding their finger across the lock screen,
                    // we may have been intercepting the touch and forwarding it to the
                    // UDFPS affordance via mStatusBarKeyguardViewManager.onTouch (see below).
                    // If this touch ended up unlocking the device, we want to cancel the touch
                    // immediately, so we don't cause swipe or expand animations afterwards.
                    cancelCurrentTouch();
                    return true;
                }

                mFalsingCollector.onTouchEvent(ev);
                mGestureDetector.onTouchEvent(ev);
                mStatusBarKeyguardViewManager.onTouch(ev);
@@ -430,6 +447,7 @@ public class NotificationShadeWindowViewController {
            event.recycle();
            mTouchCancelled = true;
        }
        mAmbientState.setSwipingUp(false);
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+4 −0
Original line number Diff line number Diff line
@@ -865,6 +865,10 @@ public abstract class PanelViewController {
        return mClosing || mIsLaunchAnimationRunning;
    }

    public boolean isFlinging() {
        return mIsFlinging;
    }

    public boolean isTracking() {
        return mTracking;
    }
Loading