Reset IME insets source frame at begin layout

In this way, the windows shown above IME won't fit IME.

Fix: 150706726
Test: Check if the layout of "Change keyboard" dialog is as expected.
Change-Id: Ic825787d75a2be4070d309bc6cfa18ac80d9ba7a
This commit is contained in:
Tiger Huang
2020-03-05 21:47:28 +08:00
parent 82f3ed2925
commit 83ed9440ff

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();