From 9b758e6ddedc883e1d238c5bea2a1fca3aaa6d10 Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Tue, 2 Aug 2022 23:22:35 +0800 Subject: [PATCH] Set SOFT_INPUT_STATE_ALWAYS_HIDDEN for ImeEditorPopupDialogActivity In CloseImeEditorPopupDialogTest#imeLayerAndImeSnapshotVisibleOnScreen that we are mainly verifying the IME snapshot animation will visible as expected and not expect IME visible after dismissing the editor popup dialog to back to the main window. In case IME may visible on top of the main window by the fallback input connection to cause the IME flicker, set SOFT_INPUT_STATE_ALWAYS_HIDDEN on the main activity to ensure IME window will end up hidden as expected. Fix: 240587808 Test: atest FlickerTests#CloseImeEditorPopupDialogTest \ --rerun-until-failure 10 Change-Id: I569feb7b8f8bb50abd69d09eb982e362d74515fe --- .../wm/flicker/testapp/ImeEditorPopupDialogActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/ImeEditorPopupDialogActivity.java b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/ImeEditorPopupDialogActivity.java index a8613f531e1c8..95f933f97bb2f 100644 --- a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/ImeEditorPopupDialogActivity.java +++ b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/ImeEditorPopupDialogActivity.java @@ -16,6 +16,8 @@ package com.android.server.wm.flicker.testapp; +import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN; + import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; @@ -30,6 +32,7 @@ public class ImeEditorPopupDialogActivity extends Activity { WindowManager.LayoutParams p = getWindow().getAttributes(); p.layoutInDisplayCutoutMode = WindowManager.LayoutParams .LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + p.softInputMode = SOFT_INPUT_STATE_ALWAYS_HIDDEN; getWindow().setAttributes(p); LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL);