Commit Graph

6 Commits

Author SHA1 Message Date
jabashque
12fcd01d96 vibrator: Redo LedVibratorDevice effects and vibrator timeout handling
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
2022-11-12 20:20:44 +00:00
jabashque
83cfc07394 vibrator: Ensure waveform_index and vmax is set for other effects
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
2022-10-21 17:40:04 +02:00
jabashque
cf2723baa3 vibrator: Implement Effect::TICK
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
2022-07-14 16:04:17 +02:00
LuK1337
b64c8238ac vibrator: Implement Oplus effects
Change-Id: Ic0cf2ed41a7d7fe55a6b5e1ea8418583981a62b0
2022-04-11 16:27:27 +01:00
Pig
fdfa73426a vibrator: Simplify soc check and drop prop dep
[npjohnson]: adapt to reflect 18.1 upstream merges as well as
include now required headers.

Change-Id: I8581d22deac451d0c44e4b3135d2729da2865a36
2022-04-11 16:27:27 +01:00
Daniel Jacob Chittoor
8e38bbd395 aidl: Import QTI Vibrator AIDL
* CAF tag LA.UM.9.1.r1-11600.03-SMxxx0.QSSI12.0

Change-Id: I48b8326aab719b236ff6b39c05dc4df1eeb6f688
2022-04-11 16:24:12 +01:00