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

Commit addd00e7 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Start non-running activity that should be visible in resume state.

In multi-window mode it is possible for the system-ui launch
multiple activities at the same time that might not all be in a
running process. For the activities that are not in a running
process to be visible, they need to start in the resume state
not the stopped state if they will be the only resumed activity
in the stack.

Change-Id: I8e63d8baa278a46dd2b948052ca765a561355a71
parent 37ff6f64
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1263,6 +1263,7 @@ final class ActivityStack {
        // make sure any activities under it are now visible.
        boolean aboveTop = true;
        boolean behindFullscreen = !isStackVisibleLocked();
        boolean noStackActivityResumed = (isInStackLocked(starting) == null);

        for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
            final TaskRecord task = mTaskHistory.get(taskNdx);
@@ -1290,9 +1291,8 @@ final class ActivityStack {
                    }

                    if (r.app == null || r.app.thread == null) {
                        // This activity needs to be visible, but isn't even
                        // running...  get it started, but don't resume it
                        // at this point.
                        // This activity needs to be visible, but isn't even running...
                        // get it started and resume if no other stack in this stack is resumed.
                        if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY,
                                "Start and freeze screen for " + r);
                        if (r != starting) {
@@ -1304,7 +1304,9 @@ final class ActivityStack {
                            setVisible(r, true);
                        }
                        if (r != starting) {
                            mStackSupervisor.startSpecificActivityLocked(r, false, false);
                            mStackSupervisor.startSpecificActivityLocked(
                                    r, noStackActivityResumed, false);
                            noStackActivityResumed = false;
                        }

                    } else if (r.visible) {