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

Commit b1e397aa authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix focused error of embedded task fragments" into main am: a810b2ef

parents 4869428f a810b2ef
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1319,11 +1319,14 @@ class TaskFragment extends WindowContainer<WindowContainer> {

            // In a multi-resumed environment, like in a freeform device, the top
            // activity can be resumed, but it might not be the focused app.
            // Set focused app when top activity is resumed
            if (taskDisplayArea.inMultiWindowMode() && taskDisplayArea.mDisplayContent != null
                    && taskDisplayArea.mDisplayContent.mFocusedApp != next) {
            // Set focused app when top activity is resumed. However, we shouldn't do it for a
            // same task because it can break focused state. (e.g. activity embedding)
            if (taskDisplayArea.inMultiWindowMode() && taskDisplayArea.mDisplayContent != null) {
                final ActivityRecord focusedApp = taskDisplayArea.mDisplayContent.mFocusedApp;
                if (focusedApp == null || focusedApp.getTask() != next.getTask()) {
                    taskDisplayArea.mDisplayContent.setFocusedApp(next);
                }
            }
            ProtoLog.d(WM_DEBUG_STATES, "resumeTopActivity: Top activity "
                    + "resumed %s", next);
            return false;