Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +9 −9 Original line number Diff line number Diff line Loading @@ -1909,17 +1909,17 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { if (r.moveFocusableActivityToTop("setFocusedTask")) { mRootWindowContainer.resumeFocusedTasksTopActivities(); } else if (touchedActivity != null && touchedActivity != r && touchedActivity.getTask() == r.getTask() && touchedActivity.getTaskFragment() != r.getTaskFragment()) { // Set the focused app directly since the focused window is not on the // top-most TaskFragment of the top-most Task } else if (touchedActivity != null && touchedActivity.isFocusable()) { final TaskFragment parent = touchedActivity.getTaskFragment(); if (parent != null && parent.isEmbedded()) { // Set the focused app directly if the focused window is currently embedded final DisplayContent displayContent = touchedActivity.getDisplayContent(); displayContent.setFocusedApp(touchedActivity); mWindowManager.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /* updateInputWindows */); } } } @Override public boolean removeTask(int taskId) { Loading services/core/java/com/android/server/wm/DisplayContent.java +13 −4 Original line number Diff line number Diff line Loading @@ -777,12 +777,21 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return true; } if (focusedApp.getTask() == activity.getTask() && focusedApp.getTaskFragment() != activity.getTaskFragment()) { // Do not use the activity window of another TaskFragment in the same leaf Task // If the candidate activity is currently being embedded in the focused task, the // activity cannot be focused unless it is on the same TaskFragment as the focusedApp's. TaskFragment parent = activity.getTaskFragment(); if (parent != null && parent.isEmbedded()) { Task hostTask = focusedApp.getTask(); if (hostTask.isEmbedded()) { // Use the hosting task if the current task is embedded. hostTask = hostTask.getParent().asTaskFragment().getTask(); } if (activity.isDescendantOf(hostTask) && activity.getTaskFragment() != focusedApp.getTaskFragment()) { return false; } } } ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "findFocusedWindow: Found new focus @ %s", w); mTmpWindow = w; Loading Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +9 −9 Original line number Diff line number Diff line Loading @@ -1909,17 +1909,17 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { if (r.moveFocusableActivityToTop("setFocusedTask")) { mRootWindowContainer.resumeFocusedTasksTopActivities(); } else if (touchedActivity != null && touchedActivity != r && touchedActivity.getTask() == r.getTask() && touchedActivity.getTaskFragment() != r.getTaskFragment()) { // Set the focused app directly since the focused window is not on the // top-most TaskFragment of the top-most Task } else if (touchedActivity != null && touchedActivity.isFocusable()) { final TaskFragment parent = touchedActivity.getTaskFragment(); if (parent != null && parent.isEmbedded()) { // Set the focused app directly if the focused window is currently embedded final DisplayContent displayContent = touchedActivity.getDisplayContent(); displayContent.setFocusedApp(touchedActivity); mWindowManager.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /* updateInputWindows */); } } } @Override public boolean removeTask(int taskId) { Loading
services/core/java/com/android/server/wm/DisplayContent.java +13 −4 Original line number Diff line number Diff line Loading @@ -777,12 +777,21 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return true; } if (focusedApp.getTask() == activity.getTask() && focusedApp.getTaskFragment() != activity.getTaskFragment()) { // Do not use the activity window of another TaskFragment in the same leaf Task // If the candidate activity is currently being embedded in the focused task, the // activity cannot be focused unless it is on the same TaskFragment as the focusedApp's. TaskFragment parent = activity.getTaskFragment(); if (parent != null && parent.isEmbedded()) { Task hostTask = focusedApp.getTask(); if (hostTask.isEmbedded()) { // Use the hosting task if the current task is embedded. hostTask = hostTask.getParent().asTaskFragment().getTask(); } if (activity.isDescendantOf(hostTask) && activity.getTaskFragment() != focusedApp.getTaskFragment()) { return false; } } } ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "findFocusedWindow: Found new focus @ %s", w); mTmpWindow = w; Loading