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

Commit 094ef8fa authored by Ikram Gabiyev's avatar Ikram Gabiyev Committed by Android (Google) Code Review
Browse files

Merge "Add workaround for PiP1 in sync-finished detection" into main

parents e96e4e09 04d425ba
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -9644,7 +9644,18 @@ final class ActivityRecord extends WindowToken {
                    && !mDisplayContent.isSleeping()) {
                    && !mDisplayContent.isSleeping()) {
                // Visibility of starting activities isn't calculated until pause-complete, so if
                // Visibility of starting activities isn't calculated until pause-complete, so if
                // this is not paused yet, don't consider it ready.
                // this is not paused yet, don't consider it ready.
                // However, due to pip1 having an intermediate state, add a special exception here
                // that skips waiting if the next activity is already visible.
                final ActivityRecord toResume = isPip2ExperimentEnabled() ? null
                        : mDisplayContent.getActivity((r) -> !r.finishing
                        && r.isVisibleRequested()
                        && !r.isTaskOverlay()
                        && !r.isAlwaysOnTop());
                if (toResume == null || !toResume.isVisible()) {
                    return false;
                    return false;
                } else {
                    Slog.i(TAG, "Assuming sync-finish while pausing due to visible target");
                }
            }
            }
            return true;
            return true;
        }
        }