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:
@@ -35,6 +35,8 @@ public class ShadowInputDevice extends org.robolectric.shadows.ShadowInputDevice
|
||||
|
||||
private int mDeviceId;
|
||||
|
||||
private int mSources;
|
||||
|
||||
@Implementation
|
||||
protected static int[] getDeviceIds() {
|
||||
return sDeviceIds;
|
||||
@@ -70,4 +72,21 @@ public class ShadowInputDevice extends org.robolectric.shadows.ShadowInputDevice
|
||||
public void setId(int id) {
|
||||
mDeviceId = id;
|
||||
}
|
||||
|
||||
public static InputDevice makeInputDevicebyIdWithSources(int id, int sources) {
|
||||
final InputDevice inputDevice = Shadow.newInstanceOf(InputDevice.class);
|
||||
final ShadowInputDevice shadowInputDevice = Shadow.extract(inputDevice);
|
||||
shadowInputDevice.setId(id);
|
||||
shadowInputDevice.setSources(sources);
|
||||
return inputDevice;
|
||||
}
|
||||
|
||||
@Implementation
|
||||
public int getSources() {
|
||||
return mSources;
|
||||
}
|
||||
|
||||
public void setSources(int sources) {
|
||||
mSources = sources;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user