Show IME switcher only when physical keyboard is connected in 3 button nav (instead of also when virtual keyboard is visible)

Bug: 226489759
Test: connect to a physical keyboard in 3 button nav and make sure the ime switcher shows; and doesn't show with virtual keyboard
Change-Id: Ib9a5880eb1bd6d5b877a9f3789ce858f399c4910
This commit is contained in:
Tracy Zhou
2022-06-24 23:37:01 -07:00
parent 804feb76e7
commit 849a0c4e81
3 changed files with 20 additions and 4 deletions

View File

@@ -108,8 +108,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 11;
private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12;
private static final int MASK_IME_SWITCHER_VISIBLE = FLAG_SWITCHER_SUPPORTED | FLAG_IME_VISIBLE;
private static final String NAV_BUTTONS_SEPARATE_WINDOW_TITLE = "Taskbar Nav Buttons";
public static final int ALPHA_INDEX_IMMERSIVE_MODE = 0;
@@ -191,7 +189,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
isThreeButtonNav ? mStartContextualContainer : mEndContextualContainer,
mControllers.navButtonController, R.id.ime_switcher);
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
flags -> ((flags & MASK_IME_SWITCHER_VISIBLE) != 0)
flags -> ((flags & FLAG_SWITCHER_SUPPORTED) != 0)
&& ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)));
}
@@ -506,6 +504,13 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
return (mState & FLAG_IME_VISIBLE) != 0;
}
/**
* Returns true if IME switcher is visible
*/
public boolean isImeSwitcherVisible() {
return (mState & FLAG_SWITCHER_SUPPORTED) != 0;
}
/**
* Returns true if the home button is disabled
*/