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

Skip to content
Commit 045376e4 authored by Lais Andrade's avatar Lais Andrade
Browse files

Add scale factor field to HapticScale

Add extra field scale factor to the ExtenalVibratorService result to
support continuous scaling haptic channels based on a float scale.

The new updated scale function still converges to 1.0 when it's scaling
up the haptic data, but it no longer applies distortion of the vibration
waveform when it scales down the amplitude.

The new scaling is defined as:

(scale_factor * amplitude)
  when scale_factor <= 1

(scale_factor * amplitude) / (1 + (scale_factor - 1) * amplitude^2)
  when scale_factor > 1

Bug: 356407385
Flag: android.os.vibrator.haptics_scale_v2_enabled
Test: libvibrator_tests
Change-Id: Ibde6699bf23614e27b50e1ff79e364d942499187
parent 0335b360
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment