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:
@@ -26,12 +26,14 @@ import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.view.InputDevice;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.shadow.ShadowInputDevice;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@@ -46,6 +48,7 @@ import org.robolectric.annotation.Config;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(shadows = {
|
||||
com.android.settings.testutils.shadow.ShadowSystemSettings.class,
|
||||
com.android.settings.testutils.shadow.ShadowInputDevice.class,
|
||||
})
|
||||
public class TrackpadBottomPreferenceControllerTest {
|
||||
@Rule
|
||||
@@ -67,6 +70,12 @@ public class TrackpadBottomPreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_expected() {
|
||||
int deviceId = 1;
|
||||
ShadowInputDevice.sDeviceIds = new int[]{deviceId};
|
||||
InputDevice device = ShadowInputDevice.makeInputDevicebyIdWithSources(deviceId,
|
||||
InputDevice.SOURCE_TOUCHPAD);
|
||||
ShadowInputDevice.addDevice(deviceId, device);
|
||||
|
||||
assertThat(mController.getAvailabilityStatus())
|
||||
.isEqualTo(BasePreferenceController.AVAILABLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user