Loading core/java/android/view/ViewRootImpl.java +12 −5 Original line number Diff line number Diff line Loading @@ -2303,16 +2303,18 @@ public final class ViewRootImpl implements ViewParent, if (alwaysSeqIdLayout()) { reportDraw = seqId > mSeqId; } if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.instant(Trace.TRACE_TAG_VIEW, TextUtils.formatSimple("%s handleResized " + "frameChanged=%b configChanged=%b seqId=%d mSeqId=%d buf=%b " + "displayChanged=%b compatScaleChanged=%b attachedFrameChanged=%b", mTag, frameChanged, configChanged, seqId, mSeqId, syncWithBuffers, displayChanged, compatScaleChanged, attachedFrameChanged)); } if (!reportDraw && !frameChanged && !configChanged && !attachedFrameChanged && !displayChanged && !forceLayout && !compatScaleChanged && !dragResizingChanged) { return; } if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.instant(Trace.TRACE_TAG_VIEW, TextUtils.formatSimple("%s handleResized " + "frameChanged=%b configChanged=%b seqId=%d mSeqId=%d buf=%b", mTag, frameChanged, configChanged, seqId, mSeqId, syncWithBuffers)); } mPendingDragResizing = dragResizing; mTmpFrames.compatScale = compatScale; Loading Loading @@ -4604,6 +4606,11 @@ public final class ViewRootImpl implements ViewParent, } final int seqId = alwaysSeqIdLayout() ? mSeqId : mSyncSeqId; if (alwaysSeqIdLayout()) { // If WM asks for a redraw or sync without actually changing config, we won't have run // relayout but still need to track that we have drawn the associated frame. mLastSeqId = Math.max(mSeqId, mLastSeqId); } mWmsRequestSyncGroupState = WMS_SYNC_PENDING; mWmsRequestSyncGroup = new SurfaceSyncGroup("wmsSync-" + mTag, t -> { mWmsRequestSyncGroupState = WMS_SYNC_MERGED; Loading services/core/java/com/android/server/wm/WindowFrames.java +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class WindowFrames { /** * @return true if the width or height has changed since last reported to the client. */ boolean isFrameSizeChangeReported() { boolean isFrameSizeChanged() { return mFrameSizeChanged || didFrameSizeChange(); } Loading services/core/java/com/android/server/wm/WindowManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -2812,9 +2812,9 @@ public class WindowManagerService extends IWindowManager.Stub win.mActivityRecord.updateReportedVisibilityLocked(); } if (outFrames != null && outMergedConfiguration != null) { final boolean shouldReportActivityWindowInfo = outRelayoutResult != null && win.mLastReportedActivityWindowInfo != null; if (outRelayoutResult != null) { final boolean shouldReportActivityWindowInfo = win.mLastReportedActivityWindowInfo != null; final ActivityWindowInfo outActivityWindowInfo = shouldReportActivityWindowInfo ? new ActivityWindowInfo() : null; Loading services/core/java/com/android/server/wm/WindowState.java +11 −14 Original line number Diff line number Diff line Loading @@ -3726,13 +3726,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP ProtoLog.i(WM_DEBUG_ORIENTATION, "Resizing %s WITH DRAW PENDING", this); } // Always reset these states first, so if {@link IWindow#resized} fails, this // window won't be added to {@link WindowManagerService#mResizingWindows} and set // {@link #mOrientationChanging} to true again by {@link #updateResizingWindowIfNeeded} // that may cause WINDOW_FREEZE_TIMEOUT because resizing the client keeps failing. mDragResizingChangeReported = true; mWindowFrames.clearReportResizeHints(); final int prevRotation = mLastReportedConfiguration .getMergedConfiguration().windowConfiguration.getRotation(); fillClientWindowFramesAndConfiguration(mLastReportedFrames, mLastReportedConfiguration, Loading @@ -3749,6 +3742,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP seqIdToSend = syncWithBuffers ? mSyncSeqId : -1; } else { reportDraw = false; // If a sync is open (not-ready), or was open when this resize was queued, then we need // now wait for this new resize to report back. if (mSyncState == SYNC_STATE_READY && (mPendingSyncResize || !getSyncGroup().mReady)) { mSyncState = SYNC_STATE_WAITING_FOR_DRAW; } syncWithBuffers = mBufferSeqId > mSyncSeqId; if (syncWithBuffers) { if (mSyncState != SYNC_STATE_NONE) { Loading @@ -3760,14 +3758,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP dropBufferFrom(mSyncTransaction); } mSyncSeqId = mBufferSeqId; } else { } else if (!mLastConfigReportedToClient || mWindowFrames.isFrameSizeChanged() || mSyncState == SYNC_STATE_WAITING_FOR_DRAW) { ++mSyncSeqId; } // If a sync is open (not-ready), or was open when this resize was queued, then we need // now wait for this new resize to report back. if (mSyncState == SYNC_STATE_READY && (mPendingSyncResize || !getSyncGroup().mReady)) { mSyncState = SYNC_STATE_WAITING_FOR_DRAW; } mPendingSyncResize = false; seqIdToSend = mSyncSeqId; if (Trace.isTagEnabled(TRACE_TAG_WINDOW_MANAGER)) { Loading @@ -3785,6 +3780,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } final boolean isDragResizing = isDragResizing(); mDragResizingChangeReported = true; mWindowFrames.clearReportResizeHints(); if (!Flags.alwaysSeqIdLayout()) { markRedrawForSyncReported(); } Loading Loading @@ -5280,7 +5277,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } if (!mSurfaceAnimator.hasLeash() && !mLastSurfacePosition.equals(mSurfacePosition)) { final boolean frameSizeChanged = mWindowFrames.isFrameSizeChangeReported(); final boolean frameSizeChanged = mWindowFrames.isFrameSizeChanged(); final boolean surfaceInsetsChanged = surfaceInsetsChanging(); final boolean surfaceSizeChanged = frameSizeChanged || surfaceInsetsChanged; mLastSurfacePosition.set(mSurfacePosition.x, mSurfacePosition.y); Loading Loading
core/java/android/view/ViewRootImpl.java +12 −5 Original line number Diff line number Diff line Loading @@ -2303,16 +2303,18 @@ public final class ViewRootImpl implements ViewParent, if (alwaysSeqIdLayout()) { reportDraw = seqId > mSeqId; } if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.instant(Trace.TRACE_TAG_VIEW, TextUtils.formatSimple("%s handleResized " + "frameChanged=%b configChanged=%b seqId=%d mSeqId=%d buf=%b " + "displayChanged=%b compatScaleChanged=%b attachedFrameChanged=%b", mTag, frameChanged, configChanged, seqId, mSeqId, syncWithBuffers, displayChanged, compatScaleChanged, attachedFrameChanged)); } if (!reportDraw && !frameChanged && !configChanged && !attachedFrameChanged && !displayChanged && !forceLayout && !compatScaleChanged && !dragResizingChanged) { return; } if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.instant(Trace.TRACE_TAG_VIEW, TextUtils.formatSimple("%s handleResized " + "frameChanged=%b configChanged=%b seqId=%d mSeqId=%d buf=%b", mTag, frameChanged, configChanged, seqId, mSeqId, syncWithBuffers)); } mPendingDragResizing = dragResizing; mTmpFrames.compatScale = compatScale; Loading Loading @@ -4604,6 +4606,11 @@ public final class ViewRootImpl implements ViewParent, } final int seqId = alwaysSeqIdLayout() ? mSeqId : mSyncSeqId; if (alwaysSeqIdLayout()) { // If WM asks for a redraw or sync without actually changing config, we won't have run // relayout but still need to track that we have drawn the associated frame. mLastSeqId = Math.max(mSeqId, mLastSeqId); } mWmsRequestSyncGroupState = WMS_SYNC_PENDING; mWmsRequestSyncGroup = new SurfaceSyncGroup("wmsSync-" + mTag, t -> { mWmsRequestSyncGroupState = WMS_SYNC_MERGED; Loading
services/core/java/com/android/server/wm/WindowFrames.java +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class WindowFrames { /** * @return true if the width or height has changed since last reported to the client. */ boolean isFrameSizeChangeReported() { boolean isFrameSizeChanged() { return mFrameSizeChanged || didFrameSizeChange(); } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -2812,9 +2812,9 @@ public class WindowManagerService extends IWindowManager.Stub win.mActivityRecord.updateReportedVisibilityLocked(); } if (outFrames != null && outMergedConfiguration != null) { final boolean shouldReportActivityWindowInfo = outRelayoutResult != null && win.mLastReportedActivityWindowInfo != null; if (outRelayoutResult != null) { final boolean shouldReportActivityWindowInfo = win.mLastReportedActivityWindowInfo != null; final ActivityWindowInfo outActivityWindowInfo = shouldReportActivityWindowInfo ? new ActivityWindowInfo() : null; Loading
services/core/java/com/android/server/wm/WindowState.java +11 −14 Original line number Diff line number Diff line Loading @@ -3726,13 +3726,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP ProtoLog.i(WM_DEBUG_ORIENTATION, "Resizing %s WITH DRAW PENDING", this); } // Always reset these states first, so if {@link IWindow#resized} fails, this // window won't be added to {@link WindowManagerService#mResizingWindows} and set // {@link #mOrientationChanging} to true again by {@link #updateResizingWindowIfNeeded} // that may cause WINDOW_FREEZE_TIMEOUT because resizing the client keeps failing. mDragResizingChangeReported = true; mWindowFrames.clearReportResizeHints(); final int prevRotation = mLastReportedConfiguration .getMergedConfiguration().windowConfiguration.getRotation(); fillClientWindowFramesAndConfiguration(mLastReportedFrames, mLastReportedConfiguration, Loading @@ -3749,6 +3742,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP seqIdToSend = syncWithBuffers ? mSyncSeqId : -1; } else { reportDraw = false; // If a sync is open (not-ready), or was open when this resize was queued, then we need // now wait for this new resize to report back. if (mSyncState == SYNC_STATE_READY && (mPendingSyncResize || !getSyncGroup().mReady)) { mSyncState = SYNC_STATE_WAITING_FOR_DRAW; } syncWithBuffers = mBufferSeqId > mSyncSeqId; if (syncWithBuffers) { if (mSyncState != SYNC_STATE_NONE) { Loading @@ -3760,14 +3758,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP dropBufferFrom(mSyncTransaction); } mSyncSeqId = mBufferSeqId; } else { } else if (!mLastConfigReportedToClient || mWindowFrames.isFrameSizeChanged() || mSyncState == SYNC_STATE_WAITING_FOR_DRAW) { ++mSyncSeqId; } // If a sync is open (not-ready), or was open when this resize was queued, then we need // now wait for this new resize to report back. if (mSyncState == SYNC_STATE_READY && (mPendingSyncResize || !getSyncGroup().mReady)) { mSyncState = SYNC_STATE_WAITING_FOR_DRAW; } mPendingSyncResize = false; seqIdToSend = mSyncSeqId; if (Trace.isTagEnabled(TRACE_TAG_WINDOW_MANAGER)) { Loading @@ -3785,6 +3780,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } final boolean isDragResizing = isDragResizing(); mDragResizingChangeReported = true; mWindowFrames.clearReportResizeHints(); if (!Flags.alwaysSeqIdLayout()) { markRedrawForSyncReported(); } Loading Loading @@ -5280,7 +5277,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } if (!mSurfaceAnimator.hasLeash() && !mLastSurfacePosition.equals(mSurfacePosition)) { final boolean frameSizeChanged = mWindowFrames.isFrameSizeChangeReported(); final boolean frameSizeChanged = mWindowFrames.isFrameSizeChanged(); final boolean surfaceInsetsChanged = surfaceInsetsChanging(); final boolean surfaceSizeChanged = frameSizeChanged || surfaceInsetsChanged; mLastSurfacePosition.set(mSurfacePosition.x, mSurfacePosition.y); Loading