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

Commit 6bea7235 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Resume activity only if it is visible" into main

parents 5f4301bc afa5917f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import static com.android.server.wm.RootWindowContainerProto.KEYGUARD_CONTROLLER
import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
import static com.android.server.wm.Task.REPARENT_LEAVE_ROOT_TASK_IN_PLACE;
import static com.android.server.wm.Task.REPARENT_MOVE_ROOT_TASK_TO_FRONT;
import static com.android.server.wm.TaskFragment.TASK_FRAGMENT_VISIBILITY_VISIBLE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
@@ -1795,7 +1796,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                continue;
            }
            try {
                final boolean canResume = r.isFocusable() && r == tf.topRunningActivity();
                final boolean canResume = r.isFocusable() && r == tf.topRunningActivity()
                        && tf.getVisibility(r) == TASK_FRAGMENT_VISIBILITY_VISIBLE;
                if (mTaskSupervisor.realStartActivityLocked(r, app, canResume,
                        true /* checkConfig */)) {
                    hasActivityStarted = true;