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

Commit 55e76027 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Ignore tap ouside for transient-hide task

Because with transient launch, launcher is moved to top when
animating recents animation. Then before the surface of transient
hide task disappears on screen, the tap outside may still be
triggered. Which will send another TO_FRONT transition
(app=CHANGE, recents=CLOSE).

This add the same condition as legacy recents did in
onPointerDownOutsideFocusLocked to skip handling the tap.

Also let RecentsTransitionHandler cancel the animation and restore
the state (hide recents, reorder app to top and show it) if the
unexpected TO_FRONT happens (e.g. setFocusedTask on hide task).

Bug: 278055698
Test: Launch an activity with a dialog.
      Swipe-up and tap screen quickly.
      Home is still visible.
Change-Id: I1d22cb7a391d71b0d5cc0fa57cd8303458a4434d
parent b4a8a82f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -540,7 +540,12 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
                mergeActivityOnly(info, t);
            } else if (!didMergeThings) {
                // Didn't recognize anything in incoming transition so don't merge it.
                Slog.w(TAG, "Don't know how to merge this transition.");
                Slog.w(TAG, "Don't know how to merge this transition, foundRecentsClosing="
                        + foundRecentsClosing);
                if (foundRecentsClosing) {
                    mWillFinishToHome = false;
                    cancel(false /* toHome */);
                }
                return;
            }
            // At this point, we are accepting the merge.
+8 −0
Original line number Diff line number Diff line
@@ -8526,6 +8526,14 @@ public class WindowManagerService extends IWindowManager.Stub
            //                    while in overview
            return;
        }
        final WindowState w = t.getWindowState();
        if (w != null) {
            final Task task = w.getTask();
            if (task != null && w.mTransitionController.isTransientHide(task)) {
                // Don't disturb transient animation by accident touch.
                return;
            }
        }

        ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "onPointerDownOutsideFocusLocked called on %s",
                t);