Set preference visible to false when there is no keyboard.
1. Physical keyboard settings should only show up if at least one PK is connected. 2. Update tests. 3. Fix NullPointerException. Bug: 269983475 Bug: 270109384 Bug: 271357910 Test: atest and manual Change-Id: If7798587fb386dbf669fc249cab304d91a26879b
This commit is contained in:
@@ -308,6 +308,12 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
|
||||
public Keyboards loadInBackground() {
|
||||
Keyboards keyboards = new Keyboards();
|
||||
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
|
||||
if (mInputDeviceIdentifier == null || NewKeyboardSettingsUtils.getInputDevice(
|
||||
im, mInputDeviceIdentifier) == null) {
|
||||
keyboards.keyboardLayouts.add(null); // default layout
|
||||
keyboards.current = 0;
|
||||
return keyboards;
|
||||
}
|
||||
String[] keyboardLayoutDescriptors = im.getEnabledKeyboardLayoutsForInputDevice(
|
||||
mInputDeviceIdentifier);
|
||||
for (String keyboardLayoutDescriptor : keyboardLayoutDescriptors) {
|
||||
|
Reference in New Issue
Block a user