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:
@@ -160,6 +160,10 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
||||
final Context context = getContext();
|
||||
ThreadUtils.postOnBackgroundThread(() -> {
|
||||
final List<HardKeyboardDeviceInfo> newHardKeyboards = getHardKeyboards(context);
|
||||
if (newHardKeyboards.isEmpty()) {
|
||||
getActivity().finish();
|
||||
return;
|
||||
}
|
||||
ThreadUtils.postOnMainThread(() -> updateHardKeyboards(newHardKeyboards));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user