[a11y] Fix Switch Access keyboard input issue in AA+.

See https://buganizer.corp.google.com/issues/308704236#comment7. The issue is only reproducible when "Swipe up to start search" is OFF.

Video: https://drive.google.com/file/d/14ONBHL-qK3xaDWVruSMdQXWRGisyBSc2/view?usp=sharing

Bug: 308704236
Flag: NA
Test: manual
Change-Id: If84c1fcdb65add658022520018e34ad958be6bc2
This commit is contained in:
Holly Sun
2023-11-06 12:29:29 -08:00
parent 8ed8d67d63
commit 38c0102aef
2 changed files with 14 additions and 0 deletions
@@ -28,6 +28,9 @@ public class KeyboardStateManager {
// Height of the keyboard when it's shown.
// mImeShownHeightPx>=mImeHeightPx always.
private int mImeShownHeightPx;
// Indicate if the latest All Apps session was started from a11y action (rather than a direct
// user interaction).
private boolean mLaunchedFromA11y;
public enum KeyboardState {
NO_IME_ACTION,
@@ -89,4 +92,14 @@ public class KeyboardStateManager {
mImeShownHeightPx = mImeHeightPx;
}
}
/** Getter for {@code mLaunchedFromA11y} */
public boolean getLaunchedFromA11y() {
return mLaunchedFromA11y;
}
/** Setter for {@code mLaunchedFromA11y} */
public void setLaunchedFromA11y(boolean fromA11y) {
mLaunchedFromA11y = fromA11y;
}
}
@@ -79,6 +79,7 @@ public class AccessibilityActionsView extends View implements StateListener<Laun
}
Launcher l = Launcher.getLauncher(getContext());
if (action == R.string.all_apps_button_label) {
l.getStatsLogManager().keyboardStateManager().setLaunchedFromA11y(true);
l.getStateManager().goToState(ALL_APPS);
return true;
}