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

Commit 74d6d5fd authored by Evan Rosky's avatar Evan Rosky
Browse files

make non-organized tasks visible when their activity is made visible

This is necessary in a few cases (CTS) where a task is NOT organized but
had its visibility changed within its direct parent. An example of this
is if an alternate home leaf-task HB is started atop the normal home
leaf-task HA: these are both in the Home root-task HR, so there will be a
transition containing HA and HB where HA surface is hidden. If a standard task SA is
launched on top, then HB finishes, no transition will happen since neither home is
visible. When SA finishes, the transition contains HR rather than HA. Since home
leaf-tasks are NOT organized, HA won't be in the transition and thus its surface
wouldn't be shown. Just show is safe here since all other properties will have
already been reset by the original hiding-transition's finishTransaction (we can't
show in the finishTransaction because by then the activity doesn't hide until
surface placement).

Bug: 194112093
Test: atest SplashscreenTests
Change-Id: I885d688b3f505d33e04d9c2e4857928ada1c4fb0
parent 6f562371
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -437,6 +437,25 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
            final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord();
            if (ar == null || !ar.mVisibleRequested) continue;
            transaction.show(ar.getSurfaceControl());

            // Also manually show any non-reported parents. This is necessary in a few cases
            // where a task is NOT organized but had its visibility changed within its direct
            // parent. An example of this is if an alternate home leaf-task HB is started atop the
            // normal home leaf-task HA: these are both in the Home root-task HR, so there will be a
            // transition containing HA and HB where HA surface is hidden. If a standard task SA is
            // launched on top, then HB finishes, no transition will happen since neither home is
            // visible. When SA finishes, the transition contains HR rather than HA. Since home
            // leaf-tasks are NOT organized, HA won't be in the transition and thus its surface
            // wouldn't be shown. Just show is safe here since all other properties will have
            // already been reset by the original hiding-transition's finishTransaction (we can't
            // show in the finishTransaction because by then the activity doesn't hide until
            // surface placement).
            for (WindowContainer p = ar.getParent(); p != null && !mTargets.contains(p);
                    p = p.getParent()) {
                if (p.getSurfaceControl() != null) {
                    transaction.show(p.getSurfaceControl());
                }
            }
        }

        mStartTransaction = transaction;