Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31aa98be authored by Robert Carr's avatar Robert Carr
Browse files

Also report resize when frame changes without inset change.

Currently we report resize via two main code paths:
    1. Insets change.
    2. Drag resizing/resized while not drag resizing.
Unfortunately the case of IME dismissal with SOFT_INPUT_ADJUST_RESIZE
will not trigger either. For #1, both the content and the parent frames
are adjusted together (similar to a docked resize), and so we won't
produce any insets beyond the system ones. For #2, we would only hit this
path if we went through the Task, but this all happens in PhoneWindowManager
layout. Prior to 3ccc5273 ("only resize during relayout"), the lack of
resize reporting wasn't a significant issue, as we would go ahead
and resize the dialog anyway. Assuming it wasn't in the middle of a
frame it would eventually catch up and render things correctly. Following
this change though we need to ensure we trigger the client calling relayout.
We accomplish this simply by also reporting frame changes.

Bug: 30191926
Change-Id: I95c7553e5e219e4a50c92f4d47621a32567a626f
parent 39abe33b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -9425,7 +9425,7 @@ public class WindowManagerService extends IWindowManager.Stub
            if (task != null && task.mStack.getBoundsAnimating()) {
                return;
            }
            w.setInsetsChanged();
            w.setReportResizeHints();
            boolean configChanged = w.isConfigChanged();
            if (DEBUG_CONFIGURATION && configChanged) {
                Slog.v(TAG_WM, "Win " + w + " config changed: "
@@ -9437,11 +9437,11 @@ public class WindowManagerService extends IWindowManager.Stub
                    + ": configChanged=" + configChanged
                    + " dragResizingChanged=" + dragResizingChanged
                    + " last=" + w.mLastFrame + " frame=" + w.mFrame);
            w.mLastFrame.set(w.mFrame);
            if (w.mContentInsetsChanged
                    || w.mVisibleInsetsChanged
                    || winAnimator.mSurfaceResized
                    || w.mOutsetsChanged
                    || w.mFrameSizeChanged
                    || configChanged
                    || dragResizingChanged
                    || !w.isResizedWhileNotDragResizingReported()) {
@@ -9474,6 +9474,7 @@ public class WindowManagerService extends IWindowManager.Stub
                w.mLastVisibleInsets.set(w.mVisibleInsets);
                w.mLastStableInsets.set(w.mStableInsets);
                w.mLastOutsets.set(w.mOutsets);
                w.mLastFrame.set(w.mFrame);
                makeWindowFreezingScreenIfNeededLocked(w);
                // If the orientation is changing, or we're starting or ending
                // a drag resizing action, then we need to hold off on unfreezing
+6 −2
Original line number Diff line number Diff line
@@ -287,6 +287,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    // "Real" frame that the application sees, in display coordinate space.
    final Rect mFrame = new Rect();
    final Rect mLastFrame = new Rect();
    boolean mFrameSizeChanged = false;
    // Frame that is scaled to the application's coordinate space when in
    // screen size compatibility mode.
    final Rect mCompatFrame = new Rect();
@@ -1055,14 +1056,16 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        return mAppToken != null && mAppToken.voiceInteraction;
    }

    boolean setInsetsChanged() {
    boolean setReportResizeHints() {
        mOverscanInsetsChanged |= !mLastOverscanInsets.equals(mOverscanInsets);
        mContentInsetsChanged |= !mLastContentInsets.equals(mContentInsets);
        mVisibleInsetsChanged |= !mLastVisibleInsets.equals(mVisibleInsets);
        mStableInsetsChanged |= !mLastStableInsets.equals(mStableInsets);
        mOutsetsChanged |= !mLastOutsets.equals(mOutsets);
        mFrameSizeChanged |= (mLastFrame.width() != mFrame.width()) ||
                (mLastFrame.height() != mFrame.height());
        return mOverscanInsetsChanged || mContentInsetsChanged || mVisibleInsetsChanged
                || mOutsetsChanged;
                || mOutsetsChanged || mFrameSizeChanged;
    }

    public DisplayContent getDisplayContent() {
@@ -2344,6 +2347,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
            mVisibleInsetsChanged = false;
            mStableInsetsChanged = false;
            mOutsetsChanged = false;
            mFrameSizeChanged = false;
            mResizedWhileNotDragResizingReported = true;
            mWinAnimator.mSurfaceResized = false;
        } catch (RemoteException e) {
+1 −1
Original line number Diff line number Diff line
@@ -974,7 +974,7 @@ class WindowSurfacePlacer {
            // windows, since that means "perform layout as normal,
            // just don't display").
            if (!gone || !win.mHaveFrame || win.mLayoutNeeded
                    || ((win.isConfigChanged() || win.setInsetsChanged())
                    || ((win.isConfigChanged() || win.setReportResizeHints())
                            && !win.isGoneForLayoutLw() &&
                            ((win.mAttrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 ||
                            (win.mHasSurface && win.mAppToken != null &&