12 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
Jiyong Park
9171299e0f vibrator: Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m
Merged-In: I14a1c57bd06f1f2aa52491f779c7030d4de03547
Change-Id: I7b9055909b901843631314b9577a9e578a739d00
2022-09-13 16:09:30 +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
Umang Chheda
d3d75f3ddd vibrator: Fix check for no of bytes in Slate SSR monitor thread
No of bytes returned by uevent_kernel_multicast_recv() can be 0 or
equal to 1025 bytes. Add change to remove '=' check in Slate SSR
monitor thread to fix the issue of thread not processing UEVENTs
because of wrong check.

Change-Id: I6d8c35a758371b853b545e3eece2fd7788a1424e
2022-07-06 13:14:42 +02:00
Alexander Koskovich
6b6d45fe1f vibrator: Add missing chowns
Change-Id: Id9d1d1b0075e50c9918aebb456c7a0974163e6d6
2022-04-12 14:39:35 +02:00
LuK1337
b64c8238ac vibrator: Implement Oplus effects
Change-Id: Ic0cf2ed41a7d7fe55a6b5e1ea8418583981a62b0
2022-04-11 16:27:27 +01:00
Daniel Jacob Chittoor
92f894fd2a vibrator: Rebrand for Oplus
Change-Id: Ib3530fbc0f321fe88d16921ba8c381f0f2f5e385
2022-04-11 16:27:27 +01:00
Nolen Johnson
f3fdce9afd vibrator: Drop kernel header dependency
* This is a partial revert of 5fba81168e8446448da68a5e546c2aa77b8dd148.
* CAF adds the kernel headers dep to fetch one single value that is
  removed in that commit. Easier to just carry it here, especially
  considering most devices won't have this in generated_kernel_headers,
  even.

Change-Id: I5b7daab2731e4b6b529cdb1ccf0fe173f677f8fd
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
Jeongik Cha
41f8f88040 vibrator: Use new vibrator NDK platform
Change-Id: I191e1b942dea3a5cb38e79b8a05803a8b72acdc7
2022-04-11 16:27:24 +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