Fix haptics scaling to match VibrationEffect function
Fix the scale function in ExternalVibrationUtils to match the one used
by VibrationEffect. Add flagged fix with new tests for the module
libvibrator.
Bug: 356144312
Flag: android.os.vibrator.fix_audio_coupled_haptics_scaling
Test: libvibrator_test
Change-Id: I56116536d7cddab29448f0e436ee752c7181eb45
diff --git a/libs/vibrator/Android.bp b/libs/vibrator/Android.bp
index 2af51a7..d3b3a73 100644
--- a/libs/vibrator/Android.bp
+++ b/libs/vibrator/Android.bp
@@ -24,6 +24,10 @@
cc_defaults {
name: "libvibrator_defaults",
+ defaults: [
+ "aconfig_lib_cc_shared_link.defaults",
+ ],
+
cflags: [
"-Wall",
"-Werror",
@@ -50,9 +54,11 @@
"libbinder",
"liblog",
"libutils",
+ "server_configurable_flags",
],
whole_static_libs: [
+ "android.os.vibrator.flags-aconfig-cc",
"libvibratorutils",
],
@@ -79,8 +85,14 @@
vendor_available: true,
double_loadable: true,
+ static_libs: [
+ "android.os.vibrator.flags-aconfig-cc",
+ ],
+
shared_libs: [
+ "liblog",
"libutils",
+ "server_configurable_flags",
],
srcs: [
@@ -89,6 +101,7 @@
visibility: [
"//frameworks/native/libs/vibrator",
+ "//frameworks/native/libs/vibrator/tests",
"//frameworks/av/media/libeffects/hapticgenerator",
],
}