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

Commit a810b2ef authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix focused error of embedded task fragments" into main

parents 284075a5 a209eafe
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1257,11 +1257,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;