diff options
| author | 2020-07-23 12:15:42 -0700 | |
|---|---|---|
| committer | 2020-09-28 12:15:29 -0700 | |
| commit | 0cf5818391155064e778f49d3784d06e11e8a63b (patch) | |
| tree | 93efcd7f8273cccafb9a1572d835a5a2504e2eed | |
| parent | f2a595df2fcf03381b78218ee528f91ec17e3dd8 (diff) | |
WindowStateAnimator: Remove mSurfaceResized
This is a part of moving Surface size control to the client. We
currently see there are only two uses of mSurfaceResized:
1. In WindowState to emit MSG_RESIZED. However for many
releases now we have only resized surfaces from within
relayoutWindow, so the client will already receive the
result here and there is no need to emit MSG_RESIZED.
2. In WindowStateAnimator to set REDO_WALLPAPER. The
original meaning of this code is perhaps lost to archaeology.
However I think the cases where resizing would be linked
to wallpaper should be limited to rotation. This seems to match
the idea that the historical meaning of "mSurfaceResized" was more
or less "orientation changing" (back before multi-window).
We also add this REDO_WALLPAPER flag from
WindowManagerService#finishDrawingWindow, and so I think it should be
added anyway in these sort of rotation cases (assuming it's still
necessary)
Bug: 161937501
Test: Existing tests pass
Change-Id: I2f85b6a81d24eec5c4aaca205e92a5fe82aff41e
| -rw-r--r-- | data/etc/services.core.protolog.json | 12 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 6 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowStateAnimator.java | 17 |
3 files changed, 10 insertions, 25 deletions
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json index 86e7adf945b7..9eaeed11c02f 100644 --- a/data/etc/services.core.protolog.json +++ b/data/etc/services.core.protolog.json @@ -1801,6 +1801,12 @@ "group": "WM_DEBUG_FOCUS_LIGHT", "at": "com\/android\/server\/wm\/DisplayContent.java" }, + "625447638": { + "message": "Resize reasons for w=%s: %s configChanged=%b dragResizingChanged=%b reportOrientationChanged=%b", + "level": "VERBOSE", + "group": "WM_DEBUG_RESIZE", + "at": "com\/android\/server\/wm\/WindowState.java" + }, "628276090": { "message": "Delaying app transition for screen rotation animation to finish", "level": "VERBOSE", @@ -2113,12 +2119,6 @@ "group": "WM_DEBUG_WINDOW_ORGANIZER", "at": "com\/android\/server\/wm\/DisplayAreaOrganizerController.java" }, - "1160771501": { - "message": "Resize reasons for w=%s: %s surfaceResized=%b configChanged=%b dragResizingChanged=%b reportOrientationChanged=%b", - "level": "VERBOSE", - "group": "WM_DEBUG_RESIZE", - "at": "com\/android\/server\/wm\/WindowState.java" - }, "1166381079": { "message": "Execute app transition: %s, displayId: %d Callers=%s", "level": "WARN", diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 1f7457c088c5..8cdcb9b6af07 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1412,15 +1412,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // Add a window that is using blastSync to the resizing list if it hasn't been reported // already. This because the window is waiting on a finishDrawing from the client. if (didFrameInsetsChange - || winAnimator.mSurfaceResized || configChanged || dragResizingChanged || mReportOrientationChanged || shouldSendRedrawForSync()) { ProtoLog.v(WM_DEBUG_RESIZE, - "Resize reasons for w=%s: %s surfaceResized=%b configChanged=%b " + "Resize reasons for w=%s: %s configChanged=%b " + "dragResizingChanged=%b reportOrientationChanged=%b", - this, mWindowFrames.getInsetsChangedInfo(), winAnimator.mSurfaceResized, + this, mWindowFrames.getInsetsChangedInfo(), configChanged, dragResizingChanged, mReportOrientationChanged); // If it's a dead window left on screen, and the configuration changed, there is nothing @@ -3636,7 +3635,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // that may cause WINDOW_FREEZE_TIMEOUT because resizing the client keeps failing. mReportOrientationChanged = false; mDragResizingChangeReported = true; - mWinAnimator.mSurfaceResized = false; mWindowFrames.resetInsetsChanged(); final MergedConfiguration mergedConfiguration = mLastReportedConfiguration; diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 029c158814b3..7bb79555c52c 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -121,12 +121,6 @@ class WindowStateAnimator { boolean mAnimationIsEntrance; - /** - * Set when we have changed the size of the surface, to know that - * we must tell them application to resize (and thus redraw itself). - */ - boolean mSurfaceResized; - WindowSurfaceController mSurfaceController; private WindowSurfaceController mPendingDestroySurface; @@ -788,10 +782,8 @@ class WindowStateAnimator { // to find the surface size changed underneath it. final boolean relayout = !w.mRelayoutCalled || w.mInRelayout; if (relayout) { - mSurfaceResized = mSurfaceController.setBufferSizeInTransaction( + mSurfaceController.setBufferSizeInTransaction( mTmpSize.width(), mTmpSize.height(), recoveringMemory); - } else { - mSurfaceResized = false; } // If we are undergoing seamless rotation, the surface has already // been set up to persist at it's old location. We need to freeze @@ -866,10 +858,6 @@ class WindowStateAnimator { mDsDy * w.mVScale, recoveringMemory); } } - - if (mSurfaceResized) { - mWin.getDisplayContent().pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; - } } /** @@ -1288,8 +1276,7 @@ class WindowStateAnimator { pw.print(prefix); pw.print("mPendingDestroySurface="); pw.println(mPendingDestroySurface); } - if (mSurfaceResized || mSurfaceDestroyDeferred) { - pw.print(prefix); pw.print("mSurfaceResized="); pw.print(mSurfaceResized); + if (mSurfaceDestroyDeferred) { pw.print(" mSurfaceDestroyDeferred="); pw.println(mSurfaceDestroyDeferred); } if (mShownAlpha != 1 || mAlpha != 1 || mLastAlpha != 1) { |