Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0105682 authored by Ahmad Khalil's avatar Ahmad Khalil Committed by Android (Google) Code Review
Browse files

Merge "Fix for the following flaky tests:...

Merge "Fix for the following flaky tests: VibrationThreadTest#vibrate_singleWaveformWithAdaptiveHapticsScaling_scalesAmplitudesProperly VibratorManagerServiceTest#vibrate_withAdaptiveHaptics_appliesCorrectAdaptiveScales" into main
parents 04aa9a14 e6116ff8
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -251,9 +251,9 @@ public class VibrationThreadTest {


        VibrationEffect effect = VibrationEffect.createWaveform(
        VibrationEffect effect = VibrationEffect.createWaveform(
                new long[]{5, 5, 5}, new int[]{1, 1, 1}, -1);
                new long[]{5, 5, 5}, new int[]{1, 1, 1}, -1);
        CompletableFuture<Void> mRequestVibrationParamsFuture = CompletableFuture.runAsync(() -> {
        mVibrationScaler.updateAdaptiveHapticsScale(USAGE_RINGTONE, 0.5f);
        mVibrationScaler.updateAdaptiveHapticsScale(USAGE_RINGTONE, 0.5f);
        });
        CompletableFuture<Void> mRequestVibrationParamsFuture = CompletableFuture.completedFuture(
                null);
        long vibrationId = startThreadAndDispatcher(effect, mRequestVibrationParamsFuture,
        long vibrationId = startThreadAndDispatcher(effect, mRequestVibrationParamsFuture,
                USAGE_RINGTONE);
                USAGE_RINGTONE);
        waitForCompletion();
        waitForCompletion();
+2 −1
Original line number Original line Diff line number Diff line
@@ -1589,7 +1589,8 @@ public class VibratorManagerServiceTest {
        assertEquals(1f, ((PrimitiveSegment) segments.get(2)).getScale(), 1e-5);
        assertEquals(1f, ((PrimitiveSegment) segments.get(2)).getScale(), 1e-5);
        verify(mVibratorFrameworkStatsLoggerMock).logVibrationAdaptiveHapticScale(UID, 0.7f);
        verify(mVibratorFrameworkStatsLoggerMock).logVibrationAdaptiveHapticScale(UID, 0.7f);
        verify(mVibratorFrameworkStatsLoggerMock).logVibrationAdaptiveHapticScale(UID, 0.4f);
        verify(mVibratorFrameworkStatsLoggerMock).logVibrationAdaptiveHapticScale(UID, 0.4f);
        verify(mVibratorFrameworkStatsLoggerMock).logVibrationAdaptiveHapticScale(UID, 1f);
        verify(mVibratorFrameworkStatsLoggerMock,
                timeout(TEST_TIMEOUT_MILLIS)).logVibrationAdaptiveHapticScale(UID, 1f);
    }
    }


    @Test
    @Test