Update Touchpad settings page to include mouse.
Make each setting conditionally available based on touchpad or mouse connected to device. Bug: 269100659 Test: TrackpadBottomPreferenceControllerTest Test: TrackpadReverseScrollingPreferenceControllerTest Test: TrackpadTapToClickPreferenceControllerTest Test: TrackpadSettingsControllerTest Flag: android.view.flags.enable_vector_cursor_a11y_settings Change-Id: I601c29e20d69227779481c0a491256e36cfd268f
This commit is contained in:
@@ -66,6 +66,20 @@ public class NewKeyboardSettingsUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean isMouse() {
|
||||
for (int deviceId : InputDevice.getDeviceIds()) {
|
||||
final InputDevice device = InputDevice.getDevice(deviceId);
|
||||
if (device == null) {
|
||||
continue;
|
||||
}
|
||||
if ((device.getSources() & InputDevice.SOURCE_MOUSE)
|
||||
== InputDevice.SOURCE_MOUSE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@Nullable
|
||||
static String getSelectedKeyboardLayoutLabelForUser(Context context, @UserIdInt int userId,
|
||||
|
||||
Reference in New Issue
Block a user