Merge "Fix KeyboardLayoutTest when new_settings flag is on" into udc-dev am: 370a76b2a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21521191 Change-Id: Id30fd25df2bc54edcf3dbe6d6d60ab72adeac4eb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -283,7 +283,8 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener {
|
|||||||
public KeyboardLayout[] getKeyboardLayoutsForInputDevice(
|
public KeyboardLayout[] getKeyboardLayoutsForInputDevice(
|
||||||
final InputDeviceIdentifier identifier) {
|
final InputDeviceIdentifier identifier) {
|
||||||
if (useNewSettingsUi()) {
|
if (useNewSettingsUi()) {
|
||||||
return new KeyboardLayout[0];
|
// Provide all supported keyboard layouts since Ime info is not provided
|
||||||
|
return getKeyboardLayouts();
|
||||||
}
|
}
|
||||||
final String[] enabledLayoutDescriptors =
|
final String[] enabledLayoutDescriptors =
|
||||||
getEnabledKeyboardLayoutsForInputDevice(identifier);
|
getEnabledKeyboardLayoutsForInputDevice(identifier);
|
||||||
|
|||||||
@@ -256,13 +256,17 @@ class KeyboardLayoutManagerTests {
|
|||||||
@Test
|
@Test
|
||||||
fun testNewUi_getKeyboardLayoutsForInputDevice() {
|
fun testNewUi_getKeyboardLayoutsForInputDevice() {
|
||||||
NewSettingsApiFlag(true).use {
|
NewSettingsApiFlag(true).use {
|
||||||
val keyboardLayouts =
|
val keyboardLayouts = keyboardLayoutManager.keyboardLayouts
|
||||||
keyboardLayoutManager.getKeyboardLayoutsForInputDevice(keyboardDevice.identifier)
|
assertNotEquals(
|
||||||
assertEquals(
|
"New UI: getKeyboardLayoutsForInputDevice API should not return empty array",
|
||||||
"New UI: getKeyboardLayoutsForInputDevice API should always return empty array",
|
|
||||||
0,
|
0,
|
||||||
keyboardLayouts.size
|
keyboardLayouts.size
|
||||||
)
|
)
|
||||||
|
assertTrue(
|
||||||
|
"New UI: getKeyboardLayoutsForInputDevice API should provide English(US) " +
|
||||||
|
"layout",
|
||||||
|
hasLayout(keyboardLayouts, ENGLISH_US_LAYOUT_DESCRIPTOR)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user