Fix keyboard not configured properly
The native callback getKeyboardLayoutOverlay() occurs before device added, we don't set layout properly, then call reload layouts on device added that will force native callback again. Long term solution: Include all necessary information for auto- detection of layout in InputDeviceIdentifier so that we don't need to wait for onInputDeviceAdded() to auto-select layout. InputDeviceIdentifier is sent with the native callback as parameter so we don't need to rely on getInputDevice() method to get the necessary information for auto-detection. Test: manual Bug: 259530132 Change-Id: I941bb8544cee8fee736e9cedcff10030361e45c9
This commit is contained in:
@@ -150,6 +150,10 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener {
|
||||
@Override
|
||||
public void onInputDeviceAdded(int deviceId) {
|
||||
onInputDeviceChanged(deviceId);
|
||||
if (useNewSettingsUi()) {
|
||||
// Force native callback to set up keyboard layout overlay for newly added keyboards
|
||||
reloadKeyboardLayouts();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user