Merge "Reset IME insets source frame at begin layout" into rvc-dev

This commit is contained in:
Tiger Huang
2020-03-11 12:52:00 +00:00
committed by Android (Google) Code Review

View File

@@ -28,6 +28,7 @@ import static android.view.Display.TYPE_INTERNAL;
import static android.view.InsetsState.ITYPE_BOTTOM_DISPLAY_CUTOUT;
import static android.view.InsetsState.ITYPE_BOTTOM_GESTURES;
import static android.view.InsetsState.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_LEFT_DISPLAY_CUTOUT;
import static android.view.InsetsState.ITYPE_LEFT_GESTURES;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
@@ -1469,8 +1470,14 @@ public class DisplayPolicy {
*/
public void beginLayoutLw(DisplayFrames displayFrames, int uiMode) {
displayFrames.onBeginLayout();
updateInsetsStateForDisplayCutout(displayFrames,
mDisplayContent.getInsetsStateController().getRawInsetsState());
final InsetsState insetsState =
mDisplayContent.getInsetsStateController().getRawInsetsState();
// Reset the frame of IME so that the layout of windows above IME won't get influenced.
// Once we layout the IME, frames will be set again on the source.
insetsState.getSource(ITYPE_IME).setFrame(0, 0, 0, 0);
updateInsetsStateForDisplayCutout(displayFrames, insetsState);
mSystemGestures.screenWidth = displayFrames.mUnrestricted.width();
mSystemGestures.screenHeight = displayFrames.mUnrestricted.height();