Loading services/core/java/com/android/server/input/KeyboardLayoutManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -283,7 +283,8 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener { public KeyboardLayout[] getKeyboardLayoutsForInputDevice( final InputDeviceIdentifier identifier) { if (useNewSettingsUi()) { return new KeyboardLayout[0]; // Provide all supported keyboard layouts since Ime info is not provided return getKeyboardLayouts(); } final String[] enabledLayoutDescriptors = getEnabledKeyboardLayoutsForInputDevice(identifier); Loading services/tests/servicestests/src/com/android/server/input/KeyboardLayoutManagerTests.kt +10 −6 Original line number Diff line number Diff line Loading @@ -256,13 +256,17 @@ class KeyboardLayoutManagerTests { @Test fun testNewUi_getKeyboardLayoutsForInputDevice() { NewSettingsApiFlag(true).use { val keyboardLayouts = keyboardLayoutManager.getKeyboardLayoutsForInputDevice(keyboardDevice.identifier) assertEquals( "New UI: getKeyboardLayoutsForInputDevice API should always return empty array", val keyboardLayouts = keyboardLayoutManager.keyboardLayouts assertNotEquals( "New UI: getKeyboardLayoutsForInputDevice API should not return empty array", 0, keyboardLayouts.size ) assertTrue( "New UI: getKeyboardLayoutsForInputDevice API should provide English(US) " + "layout", hasLayout(keyboardLayouts, ENGLISH_US_LAYOUT_DESCRIPTOR) ) } } Loading Loading
services/core/java/com/android/server/input/KeyboardLayoutManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -283,7 +283,8 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener { public KeyboardLayout[] getKeyboardLayoutsForInputDevice( final InputDeviceIdentifier identifier) { if (useNewSettingsUi()) { return new KeyboardLayout[0]; // Provide all supported keyboard layouts since Ime info is not provided return getKeyboardLayouts(); } final String[] enabledLayoutDescriptors = getEnabledKeyboardLayoutsForInputDevice(identifier); Loading
services/tests/servicestests/src/com/android/server/input/KeyboardLayoutManagerTests.kt +10 −6 Original line number Diff line number Diff line Loading @@ -256,13 +256,17 @@ class KeyboardLayoutManagerTests { @Test fun testNewUi_getKeyboardLayoutsForInputDevice() { NewSettingsApiFlag(true).use { val keyboardLayouts = keyboardLayoutManager.getKeyboardLayoutsForInputDevice(keyboardDevice.identifier) assertEquals( "New UI: getKeyboardLayoutsForInputDevice API should always return empty array", val keyboardLayouts = keyboardLayoutManager.keyboardLayouts assertNotEquals( "New UI: getKeyboardLayoutsForInputDevice API should not return empty array", 0, keyboardLayouts.size ) assertTrue( "New UI: getKeyboardLayoutsForInputDevice API should provide English(US) " + "layout", hasLayout(keyboardLayouts, ENGLISH_US_LAYOUT_DESCRIPTOR) ) } } Loading