diff options
| author | 2022-02-21 11:23:13 +0000 | |
|---|---|---|
| committer | 2022-02-21 11:23:13 +0000 | |
| commit | 131be1ceedf3428d67009928f18f4fee0b087fa5 (patch) | |
| tree | ba4c1e190e9076e479e853efb430d350c25bc9b8 | |
| parent | c1ab7e53e58411ba4a061018baccae4eea9e8271 (diff) | |
| parent | 41fe93c460d54d656895ccdfb1fcfa840966ae13 (diff) | |
Merge changes from topic "presubmit-am-1d243c5f55224d3684bfc31d9ac4ff50" into tm-mainline-prod
* changes:
[automerge] Fix VibratorManagerService test handling scaling effects 2p: d2c468d40c
Fix VibratorManagerService test handling scaling effects
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/vibrator/VibratorManagerServiceTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/tests/servicestests/src/com/android/server/vibrator/VibratorManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/vibrator/VibratorManagerServiceTest.java index 52975ef8bfe1..ccdb1050d32c 100644 --- a/services/tests/servicestests/src/com/android/server/vibrator/VibratorManagerServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/vibrator/VibratorManagerServiceTest.java @@ -765,6 +765,9 @@ public class VibratorManagerServiceTest { when(mIInputManagerMock.getVibratorIds(eq(1))).thenReturn(new int[]{1}); when(mIInputManagerMock.getInputDevice(eq(1))).thenReturn(createInputDeviceWithVibrator(1)); setUserSetting(Settings.System.VIBRATE_INPUT_DEVICES, 1); + // Mock alarm intensity equals to default value to avoid scaling in this test. + setUserSetting(Settings.System.ALARM_VIBRATION_INTENSITY, + mVibrator.getDefaultVibrationIntensity(VibrationAttributes.USAGE_ALARM)); VibratorManagerService service = createSystemReadyService(); CombinedVibration effect = CombinedVibration.createParallel( @@ -804,6 +807,9 @@ public class VibratorManagerServiceTest { mockVibrators(1, 2); mVibratorProviders.get(1).setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS); mVibratorProviders.get(2).setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS); + // Mock alarm intensity equals to default value to avoid scaling in this test. + setUserSetting(Settings.System.ALARM_VIBRATION_INTENSITY, + mVibrator.getDefaultVibrationIntensity(VibrationAttributes.USAGE_ALARM)); VibratorManagerService service = createSystemReadyService(); // The native callback will be dispatched manually in this test. mTestLooper.stopAutoDispatchAndIgnoreExceptions(); |