Loading services/core/java/com/android/server/wm/ActivityDisplay.java +5 −4 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> @Override public void onInitializeOverrideConfiguration(Configuration config) { getOverrideConfiguration().updateFrom(config); getRequestedOverrideConfiguration().updateFrom(config); } void addChild(ActivityStack stack, int position) { Loading Loading @@ -953,15 +953,16 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> } @Override public void onOverrideConfigurationChanged(Configuration overrideConfiguration) { final int currRotation = getOverrideConfiguration().windowConfiguration.getRotation(); public void onRequestedOverrideConfigurationChanged(Configuration overrideConfiguration) { final int currRotation = getRequestedOverrideConfiguration().windowConfiguration.getRotation(); if (currRotation != ROTATION_UNDEFINED && currRotation != overrideConfiguration.windowConfiguration.getRotation() && getWindowContainerController() != null) { getWindowContainerController().applyRotation(currRotation, overrideConfiguration.windowConfiguration.getRotation()); } super.onOverrideConfigurationChanged(overrideConfiguration); super.onRequestedOverrideConfigurationChanged(overrideConfiguration); } @Override Loading services/core/java/com/android/server/wm/ActivityRecord.java +15 −10 Original line number Diff line number Diff line Loading @@ -441,8 +441,13 @@ final class ActivityRecord extends ConfigurationContainer { mLastReportedConfiguration.dump(pw, prefix + " "); pw.print(prefix); pw.print("CurrentConfiguration="); pw.println(getConfiguration()); if (!getOverrideConfiguration().equals(EMPTY)) { pw.println(prefix + "OverrideConfiguration=" + getOverrideConfiguration()); if (!getRequestedOverrideConfiguration().equals(EMPTY)) { pw.println(prefix + "RequestedOverrideConfiguration=" + getRequestedOverrideConfiguration()); } if (!getResolvedOverrideConfiguration().equals(getRequestedOverrideConfiguration())) { pw.println(prefix + "ResolvedOverrideConfiguration=" + getResolvedOverrideConfiguration()); } if (!matchParentBounds()) { pw.println(prefix + "bounds=" + getBounds()); Loading Loading @@ -2531,13 +2536,13 @@ final class ActivityRecord extends ConfigurationContainer { mTmpConfig.unset(); computeBounds(mTmpBounds); if (mTmpBounds.equals(getOverrideBounds())) { if (mTmpBounds.equals(getRequestedOverrideBounds())) { return; } setBounds(mTmpBounds); final Rect updatedBounds = getOverrideBounds(); final Rect updatedBounds = getRequestedOverrideBounds(); // Bounds changed...update configuration to match. if (!matchParentBounds()) { Loading @@ -2545,7 +2550,7 @@ final class ActivityRecord extends ConfigurationContainer { false /* overrideWidth */, false /* overrideHeight */); } onOverrideConfigurationChanged(mTmpConfig); onRequestedOverrideConfigurationChanged(mTmpConfig); } /** Returns true if the configuration is compatible with this activity. */ Loading Loading @@ -2602,11 +2607,11 @@ final class ActivityRecord extends ConfigurationContainer { if (containingAppWidth <= maxActivityWidth && containingAppHeight <= maxActivityHeight) { // The display matches or is less than the activity aspect ratio, so nothing else to do. // Return the existing bounds. If this method is running for the first time, // {@link #getOverrideBounds()} will be empty (representing no override). If the method has run // before, then effect of {@link #getOverrideBounds()} will already have been applied to the // value returned from {@link getConfiguration}. Refer to // {@link TaskRecord#computeOverrideConfiguration}. outBounds.set(getOverrideBounds()); // {@link #getRequestedOverrideBounds()} will be empty (representing no override). If // the method has run before, then effect of {@link #getRequestedOverrideBounds()} will // already have been applied to the value returned from {@link getConfiguration}. Refer // to {@link TaskRecord#computeOverrideConfiguration}. outBounds.set(getRequestedOverrideBounds()); return; } Loading services/core/java/com/android/server/wm/ActivityStack.java +18 −17 Original line number Diff line number Diff line Loading @@ -264,8 +264,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // If we created a docked stack we want to resize it so it resizes all other stacks // in the system. getStackDockedModeBounds(null, null, mTmpRect2, mTmpRect3); mStackSupervisor.resizeDockedStackLocked( getOverrideBounds(), mTmpRect2, mTmpRect2, null, null, PRESERVE_WINDOWS); mStackSupervisor.resizeDockedStackLocked(getRequestedOverrideBounds(), mTmpRect2, mTmpRect2, null, null, PRESERVE_WINDOWS); } mRootActivityContainer.updateUIDsPresentOnDisplay(); } Loading Loading @@ -562,7 +562,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // Update bounds if applicable boolean hasNewOverrideBounds = false; // Use override windowing mode to prevent extra bounds changes if inheriting the mode. if (getOverrideWindowingMode() == WINDOWING_MODE_PINNED) { if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_PINNED) { // Pinned calculation already includes rotation mTmpRect2.set(mTmpRect); hasNewOverrideBounds = getWindowContainerController().mContainer Loading @@ -589,8 +589,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai || prevScreenH != getConfiguration().screenHeightDp) { // Use override windowing mode to prevent extra bounds changes if inheriting // the mode. if (getOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY || getOverrideWindowingMode() if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY || getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { mTmpRect2.set(mTmpRect); getWindowContainerController().mContainer Loading @@ -602,11 +602,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } if (getWindowingMode() != prevWindowingMode) { // Use override windowing mode to prevent extra bounds changes if inheriting the mode. if (getOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) { if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) { getStackDockedModeBounds(null, null, mTmpRect2, mTmpRect3); // immediately resize so docked bounds are available in onSplitScreenModeActivated resize(mTmpRect2, null /* tempTaskBounds */, null /* tempTaskInsetBounds */); } else if (getOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { } else if ( getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { Rect dockedBounds = display.getSplitScreenPrimaryStack().getBounds(); final boolean isMinimizedDock = getDisplay().getWindowContainerController() .mContainer.getDockedDividerController().isMinimizedDock(); Loading Loading @@ -672,7 +673,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai void setWindowingMode(int preferredWindowingMode, boolean animate, boolean showRecents, boolean enteringSplitScreenMode, boolean deferEnsuringVisibility, boolean creating) { final int currentMode = getWindowingMode(); final int currentOverrideMode = getOverrideWindowingMode(); final int currentOverrideMode = getRequestedOverrideWindowingMode(); final ActivityDisplay display = getDisplay(); final TaskRecord topTask = topTask(); final ActivityStack splitScreenStack = display.getSplitScreenPrimaryStack(); Loading Loading @@ -725,7 +726,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // You are already in the window mode, so we can skip most of the work below. However, // it's possible that we have inherited the current windowing mode from a parent. So, // fulfill this method's contract by setting the override mode directly. getOverrideConfiguration().windowConfiguration.setWindowingMode(windowingMode); getRequestedOverrideConfiguration().windowConfiguration.setWindowingMode(windowingMode); return; } Loading Loading @@ -791,7 +792,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai mWindowContainerController.getRawBounds(mTmpRect2); } if (!Objects.equals(getOverrideBounds(), mTmpRect2)) { if (!Objects.equals(getRequestedOverrideBounds(), mTmpRect2)) { resize(mTmpRect2, null /* tempTaskBounds */, null /* tempTaskInsetBounds */); } } finally { Loading Loading @@ -4934,8 +4935,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // For freeform stack we don't adjust the size of the tasks to match that // of the stack, but we do try to make sure the tasks are still contained // with the bounds of the stack. if (task.getOverrideBounds() != null) { mTmpRect2.set(task.getOverrideBounds()); if (task.getRequestedOverrideBounds() != null) { mTmpRect2.set(task.getRequestedOverrideBounds()); fitWithinBounds(mTmpRect2, bounds); task.updateOverrideConfiguration(mTmpRect2); } Loading @@ -4946,9 +4947,9 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (task.hasDisplayedBounds()) { mTmpBounds.put(task.taskId, task.getDisplayedBounds()); mTmpInsetBounds.put(task.taskId, task.getOverrideBounds()); mTmpInsetBounds.put(task.taskId, task.getRequestedOverrideBounds()); } else { mTmpBounds.put(task.taskId, task.getOverrideBounds()); mTmpBounds.put(task.taskId, task.getRequestedOverrideBounds()); mTmpInsetBounds.put(task.taskId, null); } } Loading Loading @@ -5191,7 +5192,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai pw.println(""); } pw.println(prefix + "Task id #" + task.taskId); pw.println(prefix + "mBounds=" + task.getOverrideBounds()); pw.println(prefix + "mBounds=" + task.getRequestedOverrideBounds()); pw.println(prefix + "mMinWidth=" + task.mMinWidth); pw.println(prefix + "mMinHeight=" + task.mMinHeight); pw.println(prefix + "mLastNonFullscreenBounds=" + task.mLastNonFullscreenBounds); Loading Loading @@ -5349,7 +5350,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (!mStackSupervisor.getLaunchParamsController() .layoutTask(task, info.windowLayout, activity, source, options) && !matchParentBounds() && task.isResizeable() && !isLockscreenShown) { task.updateOverrideConfiguration(getOverrideBounds()); task.updateOverrideConfiguration(getRequestedOverrideBounds()); } task.createWindowContainer(toTop, (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0); return task; Loading Loading @@ -5541,7 +5542,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } proto.write(DISPLAY_ID, mDisplayId); if (!matchParentBounds()) { final Rect bounds = getOverrideBounds(); final Rect bounds = getRequestedOverrideBounds(); bounds.writeToProto(proto, BOUNDS); } Loading services/core/java/com/android/server/wm/ActivityStackSupervisor.java +1 −1 Original line number Diff line number Diff line Loading @@ -2410,7 +2410,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { return; } scheduleUpdatePictureInPictureModeIfNeeded(task, stack.getOverrideBounds()); scheduleUpdatePictureInPictureModeIfNeeded(task, stack.getRequestedOverrideBounds()); } void scheduleUpdatePictureInPictureModeIfNeeded(TaskRecord task, Rect targetStackBounds) { Loading services/core/java/com/android/server/wm/ConfigurationContainer.java +96 −62 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
services/core/java/com/android/server/wm/ActivityDisplay.java +5 −4 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> @Override public void onInitializeOverrideConfiguration(Configuration config) { getOverrideConfiguration().updateFrom(config); getRequestedOverrideConfiguration().updateFrom(config); } void addChild(ActivityStack stack, int position) { Loading Loading @@ -953,15 +953,16 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> } @Override public void onOverrideConfigurationChanged(Configuration overrideConfiguration) { final int currRotation = getOverrideConfiguration().windowConfiguration.getRotation(); public void onRequestedOverrideConfigurationChanged(Configuration overrideConfiguration) { final int currRotation = getRequestedOverrideConfiguration().windowConfiguration.getRotation(); if (currRotation != ROTATION_UNDEFINED && currRotation != overrideConfiguration.windowConfiguration.getRotation() && getWindowContainerController() != null) { getWindowContainerController().applyRotation(currRotation, overrideConfiguration.windowConfiguration.getRotation()); } super.onOverrideConfigurationChanged(overrideConfiguration); super.onRequestedOverrideConfigurationChanged(overrideConfiguration); } @Override Loading
services/core/java/com/android/server/wm/ActivityRecord.java +15 −10 Original line number Diff line number Diff line Loading @@ -441,8 +441,13 @@ final class ActivityRecord extends ConfigurationContainer { mLastReportedConfiguration.dump(pw, prefix + " "); pw.print(prefix); pw.print("CurrentConfiguration="); pw.println(getConfiguration()); if (!getOverrideConfiguration().equals(EMPTY)) { pw.println(prefix + "OverrideConfiguration=" + getOverrideConfiguration()); if (!getRequestedOverrideConfiguration().equals(EMPTY)) { pw.println(prefix + "RequestedOverrideConfiguration=" + getRequestedOverrideConfiguration()); } if (!getResolvedOverrideConfiguration().equals(getRequestedOverrideConfiguration())) { pw.println(prefix + "ResolvedOverrideConfiguration=" + getResolvedOverrideConfiguration()); } if (!matchParentBounds()) { pw.println(prefix + "bounds=" + getBounds()); Loading Loading @@ -2531,13 +2536,13 @@ final class ActivityRecord extends ConfigurationContainer { mTmpConfig.unset(); computeBounds(mTmpBounds); if (mTmpBounds.equals(getOverrideBounds())) { if (mTmpBounds.equals(getRequestedOverrideBounds())) { return; } setBounds(mTmpBounds); final Rect updatedBounds = getOverrideBounds(); final Rect updatedBounds = getRequestedOverrideBounds(); // Bounds changed...update configuration to match. if (!matchParentBounds()) { Loading @@ -2545,7 +2550,7 @@ final class ActivityRecord extends ConfigurationContainer { false /* overrideWidth */, false /* overrideHeight */); } onOverrideConfigurationChanged(mTmpConfig); onRequestedOverrideConfigurationChanged(mTmpConfig); } /** Returns true if the configuration is compatible with this activity. */ Loading Loading @@ -2602,11 +2607,11 @@ final class ActivityRecord extends ConfigurationContainer { if (containingAppWidth <= maxActivityWidth && containingAppHeight <= maxActivityHeight) { // The display matches or is less than the activity aspect ratio, so nothing else to do. // Return the existing bounds. If this method is running for the first time, // {@link #getOverrideBounds()} will be empty (representing no override). If the method has run // before, then effect of {@link #getOverrideBounds()} will already have been applied to the // value returned from {@link getConfiguration}. Refer to // {@link TaskRecord#computeOverrideConfiguration}. outBounds.set(getOverrideBounds()); // {@link #getRequestedOverrideBounds()} will be empty (representing no override). If // the method has run before, then effect of {@link #getRequestedOverrideBounds()} will // already have been applied to the value returned from {@link getConfiguration}. Refer // to {@link TaskRecord#computeOverrideConfiguration}. outBounds.set(getRequestedOverrideBounds()); return; } Loading
services/core/java/com/android/server/wm/ActivityStack.java +18 −17 Original line number Diff line number Diff line Loading @@ -264,8 +264,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // If we created a docked stack we want to resize it so it resizes all other stacks // in the system. getStackDockedModeBounds(null, null, mTmpRect2, mTmpRect3); mStackSupervisor.resizeDockedStackLocked( getOverrideBounds(), mTmpRect2, mTmpRect2, null, null, PRESERVE_WINDOWS); mStackSupervisor.resizeDockedStackLocked(getRequestedOverrideBounds(), mTmpRect2, mTmpRect2, null, null, PRESERVE_WINDOWS); } mRootActivityContainer.updateUIDsPresentOnDisplay(); } Loading Loading @@ -562,7 +562,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // Update bounds if applicable boolean hasNewOverrideBounds = false; // Use override windowing mode to prevent extra bounds changes if inheriting the mode. if (getOverrideWindowingMode() == WINDOWING_MODE_PINNED) { if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_PINNED) { // Pinned calculation already includes rotation mTmpRect2.set(mTmpRect); hasNewOverrideBounds = getWindowContainerController().mContainer Loading @@ -589,8 +589,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai || prevScreenH != getConfiguration().screenHeightDp) { // Use override windowing mode to prevent extra bounds changes if inheriting // the mode. if (getOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY || getOverrideWindowingMode() if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY || getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { mTmpRect2.set(mTmpRect); getWindowContainerController().mContainer Loading @@ -602,11 +602,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } if (getWindowingMode() != prevWindowingMode) { // Use override windowing mode to prevent extra bounds changes if inheriting the mode. if (getOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) { if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) { getStackDockedModeBounds(null, null, mTmpRect2, mTmpRect3); // immediately resize so docked bounds are available in onSplitScreenModeActivated resize(mTmpRect2, null /* tempTaskBounds */, null /* tempTaskInsetBounds */); } else if (getOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { } else if ( getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { Rect dockedBounds = display.getSplitScreenPrimaryStack().getBounds(); final boolean isMinimizedDock = getDisplay().getWindowContainerController() .mContainer.getDockedDividerController().isMinimizedDock(); Loading Loading @@ -672,7 +673,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai void setWindowingMode(int preferredWindowingMode, boolean animate, boolean showRecents, boolean enteringSplitScreenMode, boolean deferEnsuringVisibility, boolean creating) { final int currentMode = getWindowingMode(); final int currentOverrideMode = getOverrideWindowingMode(); final int currentOverrideMode = getRequestedOverrideWindowingMode(); final ActivityDisplay display = getDisplay(); final TaskRecord topTask = topTask(); final ActivityStack splitScreenStack = display.getSplitScreenPrimaryStack(); Loading Loading @@ -725,7 +726,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // You are already in the window mode, so we can skip most of the work below. However, // it's possible that we have inherited the current windowing mode from a parent. So, // fulfill this method's contract by setting the override mode directly. getOverrideConfiguration().windowConfiguration.setWindowingMode(windowingMode); getRequestedOverrideConfiguration().windowConfiguration.setWindowingMode(windowingMode); return; } Loading Loading @@ -791,7 +792,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai mWindowContainerController.getRawBounds(mTmpRect2); } if (!Objects.equals(getOverrideBounds(), mTmpRect2)) { if (!Objects.equals(getRequestedOverrideBounds(), mTmpRect2)) { resize(mTmpRect2, null /* tempTaskBounds */, null /* tempTaskInsetBounds */); } } finally { Loading Loading @@ -4934,8 +4935,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // For freeform stack we don't adjust the size of the tasks to match that // of the stack, but we do try to make sure the tasks are still contained // with the bounds of the stack. if (task.getOverrideBounds() != null) { mTmpRect2.set(task.getOverrideBounds()); if (task.getRequestedOverrideBounds() != null) { mTmpRect2.set(task.getRequestedOverrideBounds()); fitWithinBounds(mTmpRect2, bounds); task.updateOverrideConfiguration(mTmpRect2); } Loading @@ -4946,9 +4947,9 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (task.hasDisplayedBounds()) { mTmpBounds.put(task.taskId, task.getDisplayedBounds()); mTmpInsetBounds.put(task.taskId, task.getOverrideBounds()); mTmpInsetBounds.put(task.taskId, task.getRequestedOverrideBounds()); } else { mTmpBounds.put(task.taskId, task.getOverrideBounds()); mTmpBounds.put(task.taskId, task.getRequestedOverrideBounds()); mTmpInsetBounds.put(task.taskId, null); } } Loading Loading @@ -5191,7 +5192,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai pw.println(""); } pw.println(prefix + "Task id #" + task.taskId); pw.println(prefix + "mBounds=" + task.getOverrideBounds()); pw.println(prefix + "mBounds=" + task.getRequestedOverrideBounds()); pw.println(prefix + "mMinWidth=" + task.mMinWidth); pw.println(prefix + "mMinHeight=" + task.mMinHeight); pw.println(prefix + "mLastNonFullscreenBounds=" + task.mLastNonFullscreenBounds); Loading Loading @@ -5349,7 +5350,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (!mStackSupervisor.getLaunchParamsController() .layoutTask(task, info.windowLayout, activity, source, options) && !matchParentBounds() && task.isResizeable() && !isLockscreenShown) { task.updateOverrideConfiguration(getOverrideBounds()); task.updateOverrideConfiguration(getRequestedOverrideBounds()); } task.createWindowContainer(toTop, (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0); return task; Loading Loading @@ -5541,7 +5542,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } proto.write(DISPLAY_ID, mDisplayId); if (!matchParentBounds()) { final Rect bounds = getOverrideBounds(); final Rect bounds = getRequestedOverrideBounds(); bounds.writeToProto(proto, BOUNDS); } Loading
services/core/java/com/android/server/wm/ActivityStackSupervisor.java +1 −1 Original line number Diff line number Diff line Loading @@ -2410,7 +2410,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { return; } scheduleUpdatePictureInPictureModeIfNeeded(task, stack.getOverrideBounds()); scheduleUpdatePictureInPictureModeIfNeeded(task, stack.getRequestedOverrideBounds()); } void scheduleUpdatePictureInPictureModeIfNeeded(TaskRecord task, Rect targetStackBounds) { Loading
services/core/java/com/android/server/wm/ConfigurationContainer.java +96 −62 File changed.Preview size limit exceeded, changes collapsed. Show changes