TAPL: add setIgnoreTaskbarVisibility in LauncherInstrumentation

As now FlickerTests is leveraging TAPL to interact devices CUJs,
we realized in LauncherInstrumentation will verify task bar visibility
automatically to expect it always visible when quick-switch, which is
not always reliable since the task bar may be hidden by manual or
when the activity requests to show IME.

Add setIgnoreTaskbarVisibility in LauncherInstrumentation for the caller
to ignore taskbar visibility if the test does not need to verify it.

Bug: 228012334
Bug: 240306344
Test: atest FlickerTests:SwitchImeWindowsFromGestureNavTest
      in tablet device
Test: atest NexusLauncherOutOfProcTests:com.android.quickstep.\
       TaplTestsQuickstep#testQuickSwitchToPreviousAppForTablet

Change-Id: Id0a35561523d733b8434acb702ec7dcaa466a1c2
This commit is contained in:
Ming-Shin Lu
2022-09-15 09:36:45 +08:00
parent f733a716fd
commit 4d4f62ac77
9 changed files with 127 additions and 6 deletions
@@ -24,7 +24,9 @@ import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.view.WindowInsets;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
@@ -81,6 +83,20 @@ public class BaseTestingActivity extends Activity implements View.OnClickListene
mView.addView(button, lp);
}
protected void addEditor(String initText, String hint, boolean requestIme) {
EditText editText = new EditText(this);
editText.setHint(hint);
editText.setText(initText);
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
lp.bottomMargin = mMargin;
mView.addView(editText, lp);
if (requestIme) {
editText.requestFocus();
mView.getWindowInsetsController().show(WindowInsets.Type.ime());
}
}
@Override
protected void onResume() {
super.onResume();