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

Commit 70f9869e authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Improved docstring of SliderStateListener and delegating primitive

durations call to the vibrator service.

Test: atest SliderHapticFeedbackProviderTest
Bug: 295932558
Change-Id: If641995b2d5eba259b1867b77762623c26b969e9
parent 036c9104
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -37,7 +37,9 @@ interface SliderStateListener {
     * Notification that the slider reached a certain progress on the slider track.
     *
     * This method is called in all intermediate steps of a continuous progress change as the slider
     * moves through the slider track.
     * moves through the slider track. A single discrete movement of the handle by an external
     * button or by a jump on the slider track will not trigger this callback. See
     * [onSelectAndArrow] and [onProgressJump] for these cases.
     *
     * @param[progress] The progress of the slider in the range from 0F to 1F (inclusive).
     */
@@ -56,7 +58,7 @@ interface SliderStateListener {
    fun onProgressJump(@FloatRange(from = 0.0, to = 1.0) progress: Float)

    /**
     * Notification that the slider handle was moved by a button press.
     * Notification that the slider handle was moved discretely by one step via a button press.
     *
     * @param[progress] The progress of the slider in the range from 0F to 1F (inclusive).
     */
+1 −5
Original line number Diff line number Diff line
@@ -167,12 +167,8 @@ public class VibratorHelper {
     * @see Vibrator#getPrimitiveDurations(int...)
     */
    public int[] getPrimitiveDurations(int... primitiveIds) {
        if (!hasVibrator()) {
            return new int[]{0};
        } else {
        return mVibrator.getPrimitiveDurations(primitiveIds);
    }
    }

    /**
     * Perform a vibration using a view and the one-way API with flags