device/vibrator: Add contextual haptics feature

Add capability for vibrator HAL to detect whether the device is face-up
and adjust/scale haptic alerts to avoid loud and startling buzzing when
there is no case on the device. Added global compile-time disable that
can be set in the environment.

Bug: 198239103
Test: Verified tests and functionality
Change-Id: I6b2355acb7fa5e0323b8eca6327bb19ac42a2c56
Signed-off-by: Chris Paulo <chrispaulo@google.com>
这个提交包含在:
Chris Paulo
2022-11-02 22:21:50 +00:00
提交者 TreeHugger Robot
父节点 24789fe332
当前提交 0db068b63c
修改 18 个文件,包含 730 行新增56 行删除

查看文件

@@ -110,3 +110,10 @@ on override-sf-uclamp
# it should be written by the system init.
on property:ro.boot.hardware.sku=G82U8
setprop audio.camerasound.force true
# Route vibrator.adaptive_haptics.enabled to persist
on property:vibrator.adaptive_haptics.enabled=0
setprop persist.vendor.vibrator.hal.context.enable false
on property:vibrator.adaptive_haptics.enabled=1
setprop persist.vendor.vibrator.hal.context.enable true