To hide the soft input window when press skip button on Skip setup for

PIN and face dialog of Set a PIN screen to avoid flash during transition.

bug:191181054
Test: SUW
Test: make -j RunSettingsRoboTests

Change-Id: I229b190de5e6dc714bbb8408e91c363e90b18f30
This commit is contained in:
prochinwang
2021-06-23 18:08:12 +08:00
committed by Prochin Wang
parent 416a24d821
commit b6b2485796
3 changed files with 24 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ import static org.robolectric.RuntimeEnvironment.application;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import androidx.appcompat.app.AlertDialog;
@@ -55,6 +56,7 @@ import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.shadows.ShadowActivity;
import org.robolectric.shadows.ShadowDialog;
import org.robolectric.shadows.ShadowInputMethodManager;
import java.util.Collections;
import java.util.List;
@@ -149,6 +151,9 @@ public class SetupChooseLockPasswordTest {
@Test
public void createActivity_skipButtonInIntroductionStage_shouldBeVisible() {
SetupChooseLockPassword activity = createSetupChooseLockPassword();
final InputMethodManager inputMethodManager = activity
.getSystemService(InputMethodManager.class);
final ShadowInputMethodManager shadowImm = Shadows.shadowOf(inputMethodManager);
final PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton =
@@ -159,6 +164,7 @@ public class SetupChooseLockPasswordTest {
skipOrClearButton.performClick();
final AlertDialog chooserDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(chooserDialog).isNotNull();
assertThat(shadowImm.isSoftInputVisible()).isFalse();
}
@Test