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

Commit fceaa89c authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Ensuring vibration scale is at most 1 in magnetic pull haptics.

After calculations of vibration scale, we make sure that the resulting
scale for haptics is at most 1.0, the maximum value allowed by the
haptics framework.

Test: manual. Verified haptics continue to play correctly in magnetic
  swipes
Flag: EXEMPT bugfix
Bug: 424721504
Change-Id: Ie003be168dac6d5273ec1c45ab52bf47272a811d
parent 629fed4e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -252,7 +252,8 @@ constructor(
                STRONG_VIBRATION_SCALE
            }
        val vibrationScale = scaleFactor * normalizedTranslation.pow(VIBRATION_SCALE_EXPONENT)
        val compensatedScale = vibrationScale.pow(VIBRATION_PERCEPTION_EXPONENT)
        val compensatedScale =
            vibrationScale.pow(VIBRATION_PERCEPTION_EXPONENT).coerceAtMost(maximumValue = 1f)
        if (Flags.msdlFeedback()) {
            msdlPlayer.playToken(
                MSDLToken.DRAG_INDICATOR_CONTINUOUS,