For aw8697_haptic, OOS 12 never really properly implemented any effect
other than CLICK and HEAVY_CLICK. Let's implement our own TEXTURE_TICK,
TICK, CLICK, and HEAVY_CLICK so that the user can actually feel a
noticeable difference between each haptic effect.
As a quick summary:
- CLICK: same as oplus CLICK, but with vmax set to 2500.
- DOUBLE_CLICK: replaced with our CLICK played twice in a row, w/ a
100ms delay
- TICK: same as oplus CLICK, but with vmax set to 1400.
- HEAVY_CLICK: same as oplus CLICK, but with vmax set to 2500 and
waveform_index set to 4.
- TEXTURE_TICK: same as oplus CLICK, but with vmax set to 60 and
waveform_index set to 2.
In addition, modify LedVibratorDevice's on() to better reflect the
timeout duration actually being passed in to the function. The original
tried to change waveforms instead for various durations at 102 ms or
lower, which didn't really work out in practice for our vibrator.
Change-Id: Ifb769bc2292774afa4977026787a7882430c09d0
It seems that the DOUBLE_CLICK and HEAVY_CLICK effects assume that
`waveform_index` is always set to 1 and `vmax` is set to 1600, because
if the last played effect is TICK, then all the other effects (aside
from CLICK) end up feeling different, presumably because
`waveform_index` is left as set to 2 and `vmax` is left as set to 1600.
Fix this by having DOUBLE_CLICK and HEAVY_CLICK set `waveform_index`
back to 1 and `vmax` back to 1600.
Change-Id: Ic116f45894cf4af25bcd25b66764eeb472631af5
The AOSP TICK effect generated from the following test app:
- https://github.com/luk1337/VibeTest
was used as the starting point. It is more or less the same as oplus
CLICK, except waveform_index is set to 2.
The vibration effect from this TICK was stronger than oplus CLICK, which
is not really desirable, so adjustments were made to vmax in an
unscientific manner until it felt and sounded just right.
Change-Id: I472db022c2b0182e9a0d544c9d439bc3e47e4d82