Loading core/java/android/app/TaskInfo.java +13 −3 Original line number Diff line number Diff line Loading @@ -221,6 +221,12 @@ public class TaskInfo { */ public Rect parentBounds; /** * Whether this task is focused. * @hide */ public boolean isFocused; TaskInfo() { // Do nothing } Loading Loading @@ -304,7 +310,8 @@ public class TaskInfo { && equalsLetterboxParams(that) && pictureInPictureParams == that.pictureInPictureParams && getWindowingMode() == that.getWindowingMode() && Objects.equals(taskDescription, that.taskDescription); && Objects.equals(taskDescription, that.taskDescription) && isFocused == that.isFocused; } private boolean equalsLetterboxParams(TaskInfo that) { Loading Loading @@ -350,6 +357,7 @@ public class TaskInfo { positionInParent = source.readTypedObject(Point.CREATOR); parentTaskId = source.readInt(); parentBounds = source.readTypedObject(Rect.CREATOR); isFocused = source.readBoolean(); } /** Loading Loading @@ -385,6 +393,7 @@ public class TaskInfo { dest.writeTypedObject(positionInParent, flags); dest.writeInt(parentTaskId); dest.writeTypedObject(parentBounds, flags); dest.writeBoolean(isFocused); } @Override Loading @@ -407,8 +416,9 @@ public class TaskInfo { + " launchCookies" + launchCookies + " letterboxActivityBounds=" + letterboxActivityBounds + " positionInParent=" + positionInParent + " parentTaskId: " + parentTaskId + " parentBounds: " + parentBounds + " parentTaskId=" + parentTaskId + " parentBounds=" + parentBounds + " isFocused=" + isFocused + "}"; } } services/core/java/com/android/server/wm/ActivityRecord.java +4 −7 Original line number Diff line number Diff line Loading @@ -6408,13 +6408,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // The app is just becoming visible, and the parent Task has updated with the // orientation request. Update the size compat mode. updateSizeCompatMode(); if (task.isOrganized()) { // WM Shell can override WM Core positioning (e.g. for letterboxing) so ensure // that WM Shell is called when an activity becomes visible. Without this, WM Core // will handle positioning instead of WM Shell when an app is reopened. mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged( task, /* force= */ true); } task.dispatchTaskInfoChangedIfNeeded(/* force= */ true); } } Loading services/core/java/com/android/server/wm/RecentsAnimation.java +3 −6 Original line number Diff line number Diff line Loading @@ -385,12 +385,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mWindowManager.executeAppTransition(); final Task rootTask = targetStack.getRootTask(); if (rootTask.isOrganized()) { // Client state may have changed during the recents animation, so force // send task info so the client can synchronize its state. mService.mTaskOrganizerController.dispatchTaskInfoChanged( rootTask, true /* force */); } rootTask.dispatchTaskInfoChangedIfNeeded(true /* force */); } catch (Exception e) { Slog.e(TAG, "Failed to clean up recents activity", e); throw e; Loading services/core/java/com/android/server/wm/Task.java +14 −13 Original line number Diff line number Diff line Loading @@ -2041,9 +2041,7 @@ class Task extends WindowContainer<WindowContainer> { } } if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, false /* force */); } dispatchTaskInfoChangedIfNeeded(false /* force */); } private static boolean setTaskDescriptionFromActivityAboveRoot( Loading Loading @@ -2272,8 +2270,8 @@ class Task extends WindowContainer<WindowContainer> { } // If the task organizer has changed, then it will already be receiving taskAppeared with // the latest task-info thus the task-info won't have changed. if (!taskOrgChanged && isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, false /* force */); if (!taskOrgChanged) { dispatchTaskInfoChangedIfNeeded(false /* force */); } } Loading Loading @@ -4100,6 +4098,7 @@ class Task extends WindowContainer<WindowContainer> { info.parentTaskId = rootTask == getParent() && rootTask.mCreatedByOrganizer ? rootTask.mTaskId : INVALID_TASK_ID; info.isFocused = isFocused(); } @Nullable PictureInPictureParams getPictureInPictureParams() { Loading @@ -4120,8 +4119,7 @@ class Task extends WindowContainer<WindowContainer> { letterboxActivityBounds)) { mLetterboxActivityBounds = Rect.copyOrNull(letterboxActivityBounds); // Forcing update to reduce visual jank during the transition. mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged( this, /* force= */ true); dispatchTaskInfoChangedIfNeeded(true /* force */); } } Loading Loading @@ -5067,12 +5065,11 @@ class Task extends WindowContainer<WindowContainer> { */ void onWindowFocusChanged(boolean hasFocus) { updateShadowsRadius(hasFocus, getSyncTransaction()); dispatchTaskInfoChangedIfNeeded(false /* force */); } void onPictureInPictureParamsChanged() { if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, true /* force */); } dispatchTaskInfoChangedIfNeeded(true /* force */); } /** Loading Loading @@ -7447,9 +7444,7 @@ class Task extends WindowContainer<WindowContainer> { @Override void onChildPositionChanged(WindowContainer child) { if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, false /* force */); } dispatchTaskInfoChangedIfNeeded(false /* force */); if (!mChildren.contains(child)) { return; Loading Loading @@ -7604,6 +7599,12 @@ class Task extends WindowContainer<WindowContainer> { return super.getBounds(); } void dispatchTaskInfoChangedIfNeeded(boolean force) { if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, force); } } @Override public void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTraceLogLevel int logLevel) { Loading Loading
core/java/android/app/TaskInfo.java +13 −3 Original line number Diff line number Diff line Loading @@ -221,6 +221,12 @@ public class TaskInfo { */ public Rect parentBounds; /** * Whether this task is focused. * @hide */ public boolean isFocused; TaskInfo() { // Do nothing } Loading Loading @@ -304,7 +310,8 @@ public class TaskInfo { && equalsLetterboxParams(that) && pictureInPictureParams == that.pictureInPictureParams && getWindowingMode() == that.getWindowingMode() && Objects.equals(taskDescription, that.taskDescription); && Objects.equals(taskDescription, that.taskDescription) && isFocused == that.isFocused; } private boolean equalsLetterboxParams(TaskInfo that) { Loading Loading @@ -350,6 +357,7 @@ public class TaskInfo { positionInParent = source.readTypedObject(Point.CREATOR); parentTaskId = source.readInt(); parentBounds = source.readTypedObject(Rect.CREATOR); isFocused = source.readBoolean(); } /** Loading Loading @@ -385,6 +393,7 @@ public class TaskInfo { dest.writeTypedObject(positionInParent, flags); dest.writeInt(parentTaskId); dest.writeTypedObject(parentBounds, flags); dest.writeBoolean(isFocused); } @Override Loading @@ -407,8 +416,9 @@ public class TaskInfo { + " launchCookies" + launchCookies + " letterboxActivityBounds=" + letterboxActivityBounds + " positionInParent=" + positionInParent + " parentTaskId: " + parentTaskId + " parentBounds: " + parentBounds + " parentTaskId=" + parentTaskId + " parentBounds=" + parentBounds + " isFocused=" + isFocused + "}"; } }
services/core/java/com/android/server/wm/ActivityRecord.java +4 −7 Original line number Diff line number Diff line Loading @@ -6408,13 +6408,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // The app is just becoming visible, and the parent Task has updated with the // orientation request. Update the size compat mode. updateSizeCompatMode(); if (task.isOrganized()) { // WM Shell can override WM Core positioning (e.g. for letterboxing) so ensure // that WM Shell is called when an activity becomes visible. Without this, WM Core // will handle positioning instead of WM Shell when an app is reopened. mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged( task, /* force= */ true); } task.dispatchTaskInfoChangedIfNeeded(/* force= */ true); } } Loading
services/core/java/com/android/server/wm/RecentsAnimation.java +3 −6 Original line number Diff line number Diff line Loading @@ -385,12 +385,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mWindowManager.executeAppTransition(); final Task rootTask = targetStack.getRootTask(); if (rootTask.isOrganized()) { // Client state may have changed during the recents animation, so force // send task info so the client can synchronize its state. mService.mTaskOrganizerController.dispatchTaskInfoChanged( rootTask, true /* force */); } rootTask.dispatchTaskInfoChangedIfNeeded(true /* force */); } catch (Exception e) { Slog.e(TAG, "Failed to clean up recents activity", e); throw e; Loading
services/core/java/com/android/server/wm/Task.java +14 −13 Original line number Diff line number Diff line Loading @@ -2041,9 +2041,7 @@ class Task extends WindowContainer<WindowContainer> { } } if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, false /* force */); } dispatchTaskInfoChangedIfNeeded(false /* force */); } private static boolean setTaskDescriptionFromActivityAboveRoot( Loading Loading @@ -2272,8 +2270,8 @@ class Task extends WindowContainer<WindowContainer> { } // If the task organizer has changed, then it will already be receiving taskAppeared with // the latest task-info thus the task-info won't have changed. if (!taskOrgChanged && isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, false /* force */); if (!taskOrgChanged) { dispatchTaskInfoChangedIfNeeded(false /* force */); } } Loading Loading @@ -4100,6 +4098,7 @@ class Task extends WindowContainer<WindowContainer> { info.parentTaskId = rootTask == getParent() && rootTask.mCreatedByOrganizer ? rootTask.mTaskId : INVALID_TASK_ID; info.isFocused = isFocused(); } @Nullable PictureInPictureParams getPictureInPictureParams() { Loading @@ -4120,8 +4119,7 @@ class Task extends WindowContainer<WindowContainer> { letterboxActivityBounds)) { mLetterboxActivityBounds = Rect.copyOrNull(letterboxActivityBounds); // Forcing update to reduce visual jank during the transition. mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged( this, /* force= */ true); dispatchTaskInfoChangedIfNeeded(true /* force */); } } Loading Loading @@ -5067,12 +5065,11 @@ class Task extends WindowContainer<WindowContainer> { */ void onWindowFocusChanged(boolean hasFocus) { updateShadowsRadius(hasFocus, getSyncTransaction()); dispatchTaskInfoChangedIfNeeded(false /* force */); } void onPictureInPictureParamsChanged() { if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, true /* force */); } dispatchTaskInfoChangedIfNeeded(true /* force */); } /** Loading Loading @@ -7447,9 +7444,7 @@ class Task extends WindowContainer<WindowContainer> { @Override void onChildPositionChanged(WindowContainer child) { if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, false /* force */); } dispatchTaskInfoChangedIfNeeded(false /* force */); if (!mChildren.contains(child)) { return; Loading Loading @@ -7604,6 +7599,12 @@ class Task extends WindowContainer<WindowContainer> { return super.getBounds(); } void dispatchTaskInfoChangedIfNeeded(boolean force) { if (isOrganized()) { mAtmService.mTaskOrganizerController.dispatchTaskInfoChanged(this, force); } } @Override public void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTraceLogLevel int logLevel) { Loading