Loading services/core/java/com/android/server/wm/ActivityRecord.java +0 −7 Original line number Diff line number Diff line Loading @@ -3655,13 +3655,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } @Override protected void reparentSurfaceControl(Transaction t, SurfaceControl newParent) { if (!mSurfaceAnimator.hasLeash()) { t.reparent(mSurfaceControl, newParent); } } void logStartActivity(int tag, Task task) { final Uri data = intent.getData(); final String strData = data != null ? data.toSafeString() : null; Loading services/core/java/com/android/server/wm/Task.java +21 −4 Original line number Diff line number Diff line Loading @@ -2384,6 +2384,15 @@ class Task extends WindowContainer<WindowContainer> { saveLaunchingStateIfNeeded(); final boolean taskOrgChanged = updateTaskOrganizerState(false /* forceUpdate */); if (taskOrgChanged) { updateSurfacePosition(getSyncTransaction()); if (!isOrganized()) { // Surface-size update was skipped before (since internally it no-ops if // isOrganized() is true); however, now that this is not organized, the surface // size needs to be updated by WM. updateSurfaceSize(getSyncTransaction()); } } // 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()) { Loading Loading @@ -3367,7 +3376,7 @@ class Task extends WindowContainer<WindowContainer> { final int boundsChange = super.setBounds(bounds); mRotation = rotation; updateSurfacePosition(); updateSurfacePositionNonOrganized(); return boundsChange; } Loading Loading @@ -3742,6 +3751,12 @@ class Task extends WindowContainer<WindowContainer> { return getAppAnimationLayer(ANIMATION_LAYER_HOME); } @Override void resetSurfacePositionForAnimationLeash(SurfaceControl.Transaction t) { if (isOrganized()) return; super.resetSurfacePositionForAnimationLeash(t); } @Override Rect getAnimationBounds(int appStackClipMode) { // TODO(b/131661052): we should remove appStackClipMode with hierarchical animations. Loading Loading @@ -4960,7 +4975,9 @@ class Task extends WindowContainer<WindowContainer> { */ boolean updateTaskOrganizerState(boolean forceUpdate) { if (!isRootTask()) { return false; final boolean result = setTaskOrganizer(null); mLastTaskOrganizerWindowingMode = -1; return result; } final int windowingMode = getWindowingMode(); Loading @@ -4979,7 +4996,7 @@ class Task extends WindowContainer<WindowContainer> { final ITaskOrganizer org = mWmService.mAtmService.mTaskOrganizerController.getTaskOrganizer(windowingMode); final boolean result = setTaskOrganizer(org); mLastTaskOrganizerWindowingMode = windowingMode; mLastTaskOrganizerWindowingMode = org != null ? windowingMode : -1; return result; } Loading Loading @@ -7621,7 +7638,7 @@ class Task extends WindowContainer<WindowContainer> { private void updateSurfaceBounds() { updateSurfaceSize(getSyncTransaction()); updateSurfacePosition(); updateSurfacePositionNonOrganized(); scheduleAnimation(); } Loading services/core/java/com/android/server/wm/WindowContainer.java +14 −14 Original line number Diff line number Diff line Loading @@ -320,7 +320,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< @Override public void onConfigurationChanged(Configuration newParentConfig) { super.onConfigurationChanged(newParentConfig); updateSurfacePosition(); updateSurfacePositionNonOrganized(); scheduleAnimation(); } Loading Loading @@ -418,7 +418,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< setSurfaceControl(b.setCallsite("WindowContainer.setInitialSurfaceControlProperties").build()); getSyncTransaction().show(mSurfaceControl); onSurfaceShown(getSyncTransaction()); updateSurfacePosition(); updateSurfacePositionNonOrganized(); } /** Loading Loading @@ -2022,7 +2022,9 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } protected void reparentSurfaceControl(Transaction t, SurfaceControl newParent) { mSurfaceAnimator.reparent(t, newParent); // Don't reparent active leashes since the animator won't know about the change. if (mSurfaceFreezer.hasLeash() || mSurfaceAnimator.hasLeash()) return; t.reparent(getSurfaceControl(), newParent); } void assignChildLayers(Transaction t) { Loading Loading @@ -2703,14 +2705,19 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } } final void updateSurfacePosition() { final void updateSurfacePositionNonOrganized() { // Avoid fighting with the organizer over Surface position. if (isOrganized()) return; updateSurfacePosition(getSyncTransaction()); } /** * Only for use internally (see PROTECTED annotation). This should only be used over * {@link #updateSurfacePositionNonOrganized} when the surface position needs to be * updated even if organized (eg. while changing to organized). */ @VisibleForTesting(visibility = VisibleForTesting.Visibility.PROTECTED) void updateSurfacePosition(Transaction t) { // Avoid fighting with the organizer over Surface position. if (isOrganized()) return; if (mSurfaceControl == null || mSurfaceAnimator.hasLeash()) { return; } Loading Loading @@ -2750,13 +2757,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } void getRelativePosition(Point outPos) { // In addition to updateSurfacePosition, we keep other code that sets // position from fighting with the organizer if (isOrganized()) { outPos.set(0, 0); return; } final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); Loading services/core/java/com/android/server/wm/WindowOrganizerController.java +19 −7 Original line number Diff line number Diff line Loading @@ -241,13 +241,26 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub final int configMask = change.getConfigSetMask() & CONTROLLABLE_CONFIGS; final int windowMask = change.getWindowSetMask() & CONTROLLABLE_WINDOW_CONFIGS; int effects = 0; final int windowingMode = change.getWindowingMode(); if (configMask != 0) { Configuration c = new Configuration(container.getRequestedOverrideConfiguration()); if (windowingMode > -1 && windowingMode != container.getWindowingMode()) { // Special handling for when we are setting a windowingMode in the same transaction. // Setting the windowingMode is going to call onConfigurationChanged so we don't // need it called right now. Additionally, some logic requires everything in the // configuration to change at the same time (ie. surface-freezer requires bounds // and mode to change at the same time). final Configuration c = container.getRequestedOverrideConfiguration(); c.setTo(change.getConfiguration(), configMask, windowMask); } else { final Configuration c = new Configuration(container.getRequestedOverrideConfiguration()); c.setTo(change.getConfiguration(), configMask, windowMask); container.onRequestedOverrideConfigurationChanged(c); // TODO(b/145675353): remove the following once we could apply new bounds to the // pinned stack together with its children. resizePinnedStackIfNeeded(container, configMask, windowMask, c); } resizePinnedStackIfNeeded(container, configMask, windowMask, container.getRequestedOverrideConfiguration()); effects |= TRANSACT_EFFECTS_CLIENT_CONFIG; } if ((change.getChangeMask() & WindowContainerTransaction.Change.CHANGE_FOCUSABLE) != 0) { Loading @@ -256,7 +269,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub } } final int windowingMode = change.getWindowingMode(); if (windowingMode > -1) { container.setWindowingMode(windowingMode); } Loading services/core/java/com/android/server/wm/WindowState.java +1 −1 Original line number Diff line number Diff line Loading @@ -5382,7 +5382,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP void prepareSurfaces() { mIsDimming = false; applyDims(); updateSurfacePosition(); updateSurfacePositionNonOrganized(); // Send information to SufaceFlinger about the priority of the current window. updateFrameRateSelectionPriorityIfNeeded(); Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +0 −7 Original line number Diff line number Diff line Loading @@ -3655,13 +3655,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } @Override protected void reparentSurfaceControl(Transaction t, SurfaceControl newParent) { if (!mSurfaceAnimator.hasLeash()) { t.reparent(mSurfaceControl, newParent); } } void logStartActivity(int tag, Task task) { final Uri data = intent.getData(); final String strData = data != null ? data.toSafeString() : null; Loading
services/core/java/com/android/server/wm/Task.java +21 −4 Original line number Diff line number Diff line Loading @@ -2384,6 +2384,15 @@ class Task extends WindowContainer<WindowContainer> { saveLaunchingStateIfNeeded(); final boolean taskOrgChanged = updateTaskOrganizerState(false /* forceUpdate */); if (taskOrgChanged) { updateSurfacePosition(getSyncTransaction()); if (!isOrganized()) { // Surface-size update was skipped before (since internally it no-ops if // isOrganized() is true); however, now that this is not organized, the surface // size needs to be updated by WM. updateSurfaceSize(getSyncTransaction()); } } // 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()) { Loading Loading @@ -3367,7 +3376,7 @@ class Task extends WindowContainer<WindowContainer> { final int boundsChange = super.setBounds(bounds); mRotation = rotation; updateSurfacePosition(); updateSurfacePositionNonOrganized(); return boundsChange; } Loading Loading @@ -3742,6 +3751,12 @@ class Task extends WindowContainer<WindowContainer> { return getAppAnimationLayer(ANIMATION_LAYER_HOME); } @Override void resetSurfacePositionForAnimationLeash(SurfaceControl.Transaction t) { if (isOrganized()) return; super.resetSurfacePositionForAnimationLeash(t); } @Override Rect getAnimationBounds(int appStackClipMode) { // TODO(b/131661052): we should remove appStackClipMode with hierarchical animations. Loading Loading @@ -4960,7 +4975,9 @@ class Task extends WindowContainer<WindowContainer> { */ boolean updateTaskOrganizerState(boolean forceUpdate) { if (!isRootTask()) { return false; final boolean result = setTaskOrganizer(null); mLastTaskOrganizerWindowingMode = -1; return result; } final int windowingMode = getWindowingMode(); Loading @@ -4979,7 +4996,7 @@ class Task extends WindowContainer<WindowContainer> { final ITaskOrganizer org = mWmService.mAtmService.mTaskOrganizerController.getTaskOrganizer(windowingMode); final boolean result = setTaskOrganizer(org); mLastTaskOrganizerWindowingMode = windowingMode; mLastTaskOrganizerWindowingMode = org != null ? windowingMode : -1; return result; } Loading Loading @@ -7621,7 +7638,7 @@ class Task extends WindowContainer<WindowContainer> { private void updateSurfaceBounds() { updateSurfaceSize(getSyncTransaction()); updateSurfacePosition(); updateSurfacePositionNonOrganized(); scheduleAnimation(); } Loading
services/core/java/com/android/server/wm/WindowContainer.java +14 −14 Original line number Diff line number Diff line Loading @@ -320,7 +320,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< @Override public void onConfigurationChanged(Configuration newParentConfig) { super.onConfigurationChanged(newParentConfig); updateSurfacePosition(); updateSurfacePositionNonOrganized(); scheduleAnimation(); } Loading Loading @@ -418,7 +418,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< setSurfaceControl(b.setCallsite("WindowContainer.setInitialSurfaceControlProperties").build()); getSyncTransaction().show(mSurfaceControl); onSurfaceShown(getSyncTransaction()); updateSurfacePosition(); updateSurfacePositionNonOrganized(); } /** Loading Loading @@ -2022,7 +2022,9 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } protected void reparentSurfaceControl(Transaction t, SurfaceControl newParent) { mSurfaceAnimator.reparent(t, newParent); // Don't reparent active leashes since the animator won't know about the change. if (mSurfaceFreezer.hasLeash() || mSurfaceAnimator.hasLeash()) return; t.reparent(getSurfaceControl(), newParent); } void assignChildLayers(Transaction t) { Loading Loading @@ -2703,14 +2705,19 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } } final void updateSurfacePosition() { final void updateSurfacePositionNonOrganized() { // Avoid fighting with the organizer over Surface position. if (isOrganized()) return; updateSurfacePosition(getSyncTransaction()); } /** * Only for use internally (see PROTECTED annotation). This should only be used over * {@link #updateSurfacePositionNonOrganized} when the surface position needs to be * updated even if organized (eg. while changing to organized). */ @VisibleForTesting(visibility = VisibleForTesting.Visibility.PROTECTED) void updateSurfacePosition(Transaction t) { // Avoid fighting with the organizer over Surface position. if (isOrganized()) return; if (mSurfaceControl == null || mSurfaceAnimator.hasLeash()) { return; } Loading Loading @@ -2750,13 +2757,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } void getRelativePosition(Point outPos) { // In addition to updateSurfacePosition, we keep other code that sets // position from fighting with the organizer if (isOrganized()) { outPos.set(0, 0); return; } final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); Loading
services/core/java/com/android/server/wm/WindowOrganizerController.java +19 −7 Original line number Diff line number Diff line Loading @@ -241,13 +241,26 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub final int configMask = change.getConfigSetMask() & CONTROLLABLE_CONFIGS; final int windowMask = change.getWindowSetMask() & CONTROLLABLE_WINDOW_CONFIGS; int effects = 0; final int windowingMode = change.getWindowingMode(); if (configMask != 0) { Configuration c = new Configuration(container.getRequestedOverrideConfiguration()); if (windowingMode > -1 && windowingMode != container.getWindowingMode()) { // Special handling for when we are setting a windowingMode in the same transaction. // Setting the windowingMode is going to call onConfigurationChanged so we don't // need it called right now. Additionally, some logic requires everything in the // configuration to change at the same time (ie. surface-freezer requires bounds // and mode to change at the same time). final Configuration c = container.getRequestedOverrideConfiguration(); c.setTo(change.getConfiguration(), configMask, windowMask); } else { final Configuration c = new Configuration(container.getRequestedOverrideConfiguration()); c.setTo(change.getConfiguration(), configMask, windowMask); container.onRequestedOverrideConfigurationChanged(c); // TODO(b/145675353): remove the following once we could apply new bounds to the // pinned stack together with its children. resizePinnedStackIfNeeded(container, configMask, windowMask, c); } resizePinnedStackIfNeeded(container, configMask, windowMask, container.getRequestedOverrideConfiguration()); effects |= TRANSACT_EFFECTS_CLIENT_CONFIG; } if ((change.getChangeMask() & WindowContainerTransaction.Change.CHANGE_FOCUSABLE) != 0) { Loading @@ -256,7 +269,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub } } final int windowingMode = change.getWindowingMode(); if (windowingMode > -1) { container.setWindowingMode(windowingMode); } Loading
services/core/java/com/android/server/wm/WindowState.java +1 −1 Original line number Diff line number Diff line Loading @@ -5382,7 +5382,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP void prepareSurfaces() { mIsDimming = false; applyDims(); updateSurfacePosition(); updateSurfacePositionNonOrganized(); // Send information to SufaceFlinger about the priority of the current window. updateFrameRateSelectionPriorityIfNeeded(); Loading