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

Commit 013b12f6 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Set focused activity when moving task fullscreen.

When maximizing docked stack & docked activity is not resumed & focused
we need to not only move stack to the top, but also mark the activity
as the focused one. Otherwise the activity that is getting hidden (since
its stack is going under fullscreen stack) will retain focus.

Bug: 24870602
Change-Id: Ie929fc95ba7aaccd67497ae6ede32e64dc1ba094
parent 09494864
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3228,9 +3228,16 @@ public final class ActivityStackSupervisor implements DisplayListener {
            // Apps may depend on onResume()/onPause() being called in pairs.
            if (wasResumed) {
                stack.mResumedActivity = r;
            }
            // move the stack in which we are placing the task to the front.
                // Move the stack in which we are placing the task to the front. We don't use
                // ActivityManagerService.setFocusedActivityLocked, because if the activity is
                // already focused, the call will short-circuit and do nothing.
                stack.moveToFront(reason);
            } else {
                // We need to not only move the stack to the front, but also have the activity
                // focused. This will achieve both goals.
                mService.setFocusedActivityLocked(r, reason);
            }

        }

        return stack;