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

Commit 8c67051b authored by Chris Li's avatar Chris Li
Browse files

Do not preload recents activity if it will be visible

Before, even if the launcher was not launched, RecentsAnimation would
start the activity in background as invisible. It would cause issue
because ensureVisibility would make it visible because there is no
opaque activity on top, while that may not be collected in any app
transition.

Now, in case the recents activity should be visible, we ignore the
 preload recents activity.

Bug: 193565751
Test: pass failed launcher test
Change-Id: I93f5a716177bcbf69f5e4d5915826bd9f61f53a4
parent f7224f06
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3139,6 +3139,12 @@
      "group": "WM_DEBUG_WINDOW_TRANSITIONS",
      "at": "com\/android\/server\/wm\/Transition.java"
    },
    "1494644409": {
      "message": "  Rejecting as detached: %s",
      "level": "VERBOSE",
      "group": "WM_DEBUG_WINDOW_TRANSITIONS",
      "at": "com\/android\/server\/wm\/Transition.java"
    },
    "1495525537": {
      "message": "createWallpaperAnimations()",
      "level": "DEBUG",
+5 −0
Original line number Diff line number Diff line
@@ -125,6 +125,11 @@ class RecentsAnimation implements RecentsAnimationCallbacks, OnRootTaskOrderChan
                ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Updated config=%s",
                        targetActivity.getConfiguration());
            }
        } else if (mDefaultTaskDisplayArea.getActivity(
                ActivityRecord::occludesParent, false /* traverseTopToBottom */) == null) {
            // Skip because none of above activities can occlude the target activity. The preload
            // should be done silently in background without being visible.
            return;
        } else {
            // Create the activity record. Because the activity is invisible, this doesn't really
            // start the client.
+2 −0
Original line number Diff line number Diff line
@@ -3568,6 +3568,8 @@ class Task extends TaskFragment {
            }
            sb.append(" visible=");
            sb.append(shouldBeVisible(null /* starting */));
            sb.append(" visibleRequested=");
            sb.append(isVisibleRequested());
            sb.append(" mode=");
            sb.append(windowingModeToString(getWindowingMode()));
            sb.append(" translucent=");
+6 −2
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
            final WallpaperWindowToken wt = mParticipants.valueAt(i).asWallpaperToken();
            if (wt != null && !wt.isVisibleRequested()) {
                ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
                        "  Commit wallpaper becoming invisible: %s", ar);
                        "  Commit wallpaper becoming invisible: %s", wt);
                wt.commitVisibility(false /* visible */);
            }
        }
@@ -808,7 +808,11 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
        // of participants that should always be reported even if they aren't top.
        for (WindowContainer wc : participants) {
            // Don't include detached windows.
            if (!wc.isAttached()) continue;
            if (!wc.isAttached()) {
                ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
                        "  Rejecting as detached: %s", wc);
                continue;
            }

            final ChangeInfo changeInfo = changes.get(wc);