diff --git a/audio/bluejay/config/audio_platform_configuration.xml b/audio/bluejay/config/audio_platform_configuration.xml
index f510d08..f1232f6 100644
--- a/audio/bluejay/config/audio_platform_configuration.xml
+++ b/audio/bluejay/config/audio_platform_configuration.xml
@@ -224,6 +224,8 @@
+
+
diff --git a/audio/bluejay/tuning/fortemedia/HANDSFREE.dat b/audio/bluejay/tuning/fortemedia/HANDSFREE.dat
index 1b97ddc..5609b52 100644
Binary files a/audio/bluejay/tuning/fortemedia/HANDSFREE.dat and b/audio/bluejay/tuning/fortemedia/HANDSFREE.dat differ
diff --git a/audio/bluejay/tuning/fortemedia/HANDSFREE.mods b/audio/bluejay/tuning/fortemedia/HANDSFREE.mods
index 19fbd36..3648ee1 100644
--- a/audio/bluejay/tuning/fortemedia/HANDSFREE.mods
+++ b/audio/bluejay/tuning/fortemedia/HANDSFREE.mods
@@ -1,13 +1,13 @@
#PLATFORM_NAME gChip
#EXPORT_FLAG HANDSFREE
#SINGLE_API_VER 1.1.6
-#SAVE_TIME 2022-03-29 15:50:02
+#SAVE_TIME 2022-07-21 12:24:17
#CASE_NAME HANDSFREE-HANDSFREE-RESERVE1-FB
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -905,7 +905,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x006C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0004 //RX_SAMPLINGFREQ_SIG
@@ -1761,7 +1761,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -2659,7 +2659,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x006C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0004 //RX_SAMPLINGFREQ_SIG
@@ -3515,7 +3515,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -4413,7 +4413,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x006C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0004 //RX_SAMPLINGFREQ_SIG
@@ -5269,7 +5269,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -5467,10 +5467,10 @@
194 0x0000 //TX_NORMENERTH
195 0x0000 //TX_NORMENERHIGHTH
196 0x0000 //TX_NORMENERHIGHTHL
-197 0x7FF0 //TX_DTD_THR1_0
-198 0x7FF0 //TX_DTD_THR1_1
+197 0x7210 //TX_DTD_THR1_0
+198 0x7D10 //TX_DTD_THR1_1
199 0x7FF0 //TX_DTD_THR1_2
-200 0x7FF0 //TX_DTD_THR1_3
+200 0x7F00 //TX_DTD_THR1_3
201 0x7FF0 //TX_DTD_THR1_4
202 0x7FF0 //TX_DTD_THR1_5
203 0x7FF0 //TX_DTD_THR1_6
@@ -5553,17 +5553,17 @@
280 0x1000 //TX_B_POST_FLT_1
281 0x0010 //TX_NS_LVL_CTRL_0
282 0x0012 //TX_NS_LVL_CTRL_1
-283 0x0012 //TX_NS_LVL_CTRL_2
+283 0x0010 //TX_NS_LVL_CTRL_2
284 0x0015 //TX_NS_LVL_CTRL_3
-285 0x0012 //TX_NS_LVL_CTRL_4
+285 0x0010 //TX_NS_LVL_CTRL_4
286 0x0012 //TX_NS_LVL_CTRL_5
287 0x0011 //TX_NS_LVL_CTRL_6
288 0x0011 //TX_NS_LVL_CTRL_7
289 0x000F //TX_MIN_GAIN_S_0
290 0x000F //TX_MIN_GAIN_S_1
-291 0x000D //TX_MIN_GAIN_S_2
+291 0x0008 //TX_MIN_GAIN_S_2
292 0x000F //TX_MIN_GAIN_S_3
-293 0x000F //TX_MIN_GAIN_S_4
+293 0x0008 //TX_MIN_GAIN_S_4
294 0x000F //TX_MIN_GAIN_S_5
295 0x0010 //TX_MIN_GAIN_S_6
296 0x000F //TX_MIN_GAIN_S_7
@@ -5572,9 +5572,9 @@
299 0x0000 //TX_NMOS_SUP_MENSA
300 0x7FFF //TX_SNRI_SUP_0
301 0x4000 //TX_SNRI_SUP_1
-302 0x3000 //TX_SNRI_SUP_2
+302 0x6000 //TX_SNRI_SUP_2
303 0x4000 //TX_SNRI_SUP_3
-304 0x2400 //TX_SNRI_SUP_4
+304 0x6000 //TX_SNRI_SUP_4
305 0x4000 //TX_SNRI_SUP_5
306 0x4000 //TX_SNRI_SUP_6
307 0x7FFF //TX_SNRI_SUP_7
@@ -5596,7 +5596,7 @@
323 0x1000 //TX_B_POST_FILT_1
324 0x1000 //TX_B_POST_FILT_2
325 0x1000 //TX_B_POST_FILT_3
-326 0x5000 //TX_B_POST_FILT_4
+326 0x4000 //TX_B_POST_FILT_4
327 0x3000 //TX_B_POST_FILT_5
328 0x1000 //TX_B_POST_FILT_6
329 0x2000 //TX_B_POST_FILT_7
@@ -5613,7 +5613,7 @@
340 0x7900 //TX_LAMBDA_PFILT_S_1
341 0x7C00 //TX_LAMBDA_PFILT_S_2
342 0x7900 //TX_LAMBDA_PFILT_S_3
-343 0x7000 //TX_LAMBDA_PFILT_S_4
+343 0x7C00 //TX_LAMBDA_PFILT_S_4
344 0x7D00 //TX_LAMBDA_PFILT_S_5
345 0x7D00 //TX_LAMBDA_PFILT_S_6
346 0x7D00 //TX_LAMBDA_PFILT_S_7
@@ -6167,7 +6167,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x043C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0000 //RX_SAMPLINGFREQ_SIG
@@ -7023,7 +7023,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -7921,7 +7921,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x043C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0001 //RX_SAMPLINGFREQ_SIG
@@ -8777,7 +8777,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -9675,7 +9675,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x043C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0003 //RX_SAMPLINGFREQ_SIG
@@ -10531,7 +10531,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -11429,7 +11429,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x042C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0004 //RX_SAMPLINGFREQ_SIG
@@ -12285,7 +12285,7 @@
#PARAM_MODE FULL
#PARAM_TYPE TX+RX
#TOTAL_CUSTOM_STEP 7
-#TX
+#TX
0 0x0001 //TX_OPERATION_MODE_0
1 0x0001 //TX_OPERATION_MODE_1
2 0x0033 //TX_PATCH_REG
@@ -13183,7 +13183,7 @@
894 0xC000 //TX_FASTNS_SSA_THHFL
895 0xCCCC //TX_FASTNS_SSA_THLFH
896 0xD999 //TX_FASTNS_SSA_THHFH
-#RX
+#RX
0 0x042C //RX_RECVFUNC_MODE_0
1 0x0000 //RX_RECVFUNC_MODE_1
2 0x0004 //RX_SAMPLINGFREQ_SIG
diff --git a/bluejay/overlay/frameworks/base/core/res/res/values/config.xml b/bluejay/overlay/frameworks/base/core/res/res/values/config.xml
index a1b0ce3..b61c541 100644
--- a/bluejay/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/bluejay/overlay/frameworks/base/core/res/res/values/config.xml
@@ -73,7 +73,7 @@
M 480,0
h 145
- v 118
+ v 132
h -145
Z
@left
diff --git a/bluejay/overlay/frameworks/base/core/res/res/values/dimens.xml b/bluejay/overlay/frameworks/base/core/res/res/values/dimens.xml
index 9051ca3..011c49d 100644
--- a/bluejay/overlay/frameworks/base/core/res/res/values/dimens.xml
+++ b/bluejay/overlay/frameworks/base/core/res/res/values/dimens.xml
@@ -30,7 +30,7 @@
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
-->
28dp
- 118px
+ 132px
28dp
diff --git a/conf/init.bluejay.rc b/conf/init.bluejay.rc
index 1ee067c..d45d696 100644
--- a/conf/init.bluejay.rc
+++ b/conf/init.bluejay.rc
@@ -38,3 +38,10 @@ on property:sys.boot_completed=1
on override-sf-uclamp
write /proc/vendor_sched/rt_uclamp_min 0
write /proc/vendor_sched/sf_uclamp_min 0
+
+# 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
diff --git a/device-bluejay.mk b/device-bluejay.mk
index 6e3a676..de9d892 100644
--- a/device-bluejay.mk
+++ b/device-bluejay.mk
@@ -33,7 +33,7 @@ include device/google/bluejay/audio/bluejay/audio-tables.mk
include device/google/gs101/device-shipping-common.mk
include device/google/gs101/fingerprint/udfps_common.mk
include device/google/gs101/telephony/pktrouter.mk
-include hardware/google/pixel/vibrator/cs40l26/device.mk
+include device/google/bluejay/vibrator/cs40l26/device.mk
include device/google/gs101/bluetooth/bluetooth.mk
ifeq ($(filter factory_bluejay, $(TARGET_PRODUCT)),)
@@ -122,7 +122,7 @@ PRODUCT_SOONG_NAMESPACES += \
# Increment the SVN for any official public releases
PRODUCT_VENDOR_PROPERTIES += \
- ro.vendor.build.svn=21
+ ro.vendor.build.svn=24
# DCK properties based on target
PRODUCT_PROPERTY_OVERRIDES += \
@@ -226,7 +226,12 @@ PRODUCT_SHIPPING_API_LEVEL := 32
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.vibrator.hal.supported_primitives=243 \
ro.vendor.vibrator.hal.f0.comp.enabled=0 \
- ro.vendor.vibrator.hal.redc.comp.enabled=0
+ ro.vendor.vibrator.hal.redc.comp.enabled=0 \
+ persist.vendor.vibrator.hal.context.enable=false \
+ persist.vendor.vibrator.hal.context.scale=40 \
+ persist.vendor.vibrator.hal.context.fade=true \
+ persist.vendor.vibrator.hal.context.cooldowntime=1600 \
+ persist.vendor.vibrator.hal.context.settlingtime=5000
# Device features
PRODUCT_COPY_FILES += \
diff --git a/gps.xml.b3 b/gps.xml.b3
index 99e3b58..e119f41 100644
--- a/gps.xml.b3
+++ b/gps.xml.b3
@@ -35,6 +35,7 @@
SuplVersion="2"
SuplMinorVersion="0"
SuplOtdoaCapable="true"
+ SuplOtdoaCapable2="true"
SuplGlonassCapable = "true"
SuplGalileoCapable = "true"
SuplBdsCapable = "true"
diff --git a/gps_user.xml.b3 b/gps_user.xml.b3
index f105fa1..83af222 100644
--- a/gps_user.xml.b3
+++ b/gps_user.xml.b3
@@ -34,6 +34,7 @@
SuplVersion="2"
SuplMinorVersion="0"
SuplOtdoaCapable="true"
+ SuplOtdoaCapable2="true"
SuplGlonassCapable = "true"
SuplGalileoCapable = "true"
SuplBdsCapable = "true"
diff --git a/powerhint.json b/powerhint.json
index 61a6176..22f81f3 100644
--- a/powerhint.json
+++ b/powerhint.json
@@ -168,16 +168,7 @@
"ResetOnInit": true
},
{
- "Name": "UClampThreshold",
- "Path": "/proc/vendor_sched/uclamp_threshold",
- "Values": [
- "0",
- "8"
- ],
- "ResetOnInit": true
- },
- {
- "Name": "ReduceRreferIdle",
+ "Name": "ReducePreferIdle",
"Path": "/proc/vendor_sched/reduce_prefer_idle",
"Values": [
"0",
@@ -198,6 +189,7 @@
"Name": "CDCpuset",
"Path": "/dev/cpuset/camera-daemon/cpus",
"Values": [
+ "0-3",
"4-7",
"0-7"
],
@@ -207,6 +199,7 @@
"Name": "CDHighCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-high-group/cpus",
"Values": [
+ "0-3",
"6-7",
"0-7"
],
@@ -216,6 +209,7 @@
"Name": "CDMidCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-mid-group/cpus",
"Values": [
+ "0-3",
"4-5",
"0-7"
],
@@ -225,6 +219,7 @@
"Name": "CDMidHighCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-mid-high-group/cpus",
"Values": [
+ "0-3",
"4-7",
"0-7"
],
@@ -295,6 +290,16 @@
],
"Type": "Property"
},
+ {
+ "Name": "PowerHALCameraRunning",
+ "Path": "vendor.powerhal.camerarunning",
+ "Values": [
+ "1",
+ "0"
+ ],
+ "Type": "Property",
+ "ResetOnInit": true
+ },
{
"Name": "INTCAMFreq",
"Path": "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/min_freq",
@@ -479,14 +484,32 @@
],
"Actions": [
{
- "PowerHint": "LAUNCH",
- "Node": "UClampThreshold",
- "Duration": 5000,
- "Value": "0"
+ "PowerHint": "CDCPUSET_RESTRICTED",
+ "Node": "CDCpuset",
+ "Duration": 1000,
+ "Value": "0-3"
+ },
+ {
+ "PowerHint": "CDHIGHCPUSETCPUS_RESTRICTED",
+ "Node": "CDHighCpusetCpus",
+ "Duration": 1000,
+ "Value": "0-3"
+ },
+ {
+ "PowerHint": "CDMIDCPUSETCPUS_RESTRICTED",
+ "Node": "CDMidCpusetCpus",
+ "Duration": 1000,
+ "Value": "0-3"
+ },
+ {
+ "PowerHint": "CDMIDHIGHCPUSETCPUS_RESTRICTED",
+ "Node": "CDMidHighCpusetCpus",
+ "Duration": 1000,
+ "Value": "0-3"
},
{
"PowerHint": "LAUNCH",
- "Node": "ReduceRreferIdle",
+ "Node": "ReducePreferIdle",
"Duration": 5000,
"Value": "0"
},
@@ -544,6 +567,53 @@
"Duration": 5000,
"Value": "0"
},
+ {
+ "PowerHint": "LAUNCH",
+ "Type": "DoHint",
+ "Value": "LAUNCH_EXTEND"
+ },
+ {
+ "PowerHint": "LAUNCH",
+ "Type": "DoHint",
+ "EnableProperty": "vendor.powerhal.camerarunning",
+ "Value": "CDCPUSET_RESTRICTED"
+ },
+ {
+ "PowerHint": "LAUNCH",
+ "Type": "DoHint",
+ "EnableProperty": "vendor.powerhal.camerarunning",
+ "Value": "CDHIGHCPUSETCPUS_RESTRICTED"
+ },
+ {
+ "PowerHint": "LAUNCH",
+ "Type": "DoHint",
+ "EnableProperty": "vendor.powerhal.camerarunning",
+ "Value": "CDMIDCPUSETCPUS_RESTRICTED"
+ },
+ {
+ "PowerHint": "LAUNCH",
+ "Type": "DoHint",
+ "EnableProperty": "vendor.powerhal.camerarunning",
+ "Value": "CDMIDHIGHCPUSETCPUS_RESTRICTED"
+ },
+ {
+ "PowerHint": "LAUNCH_EXTEND",
+ "Node": "CPUBigClusterMaxFreq",
+ "Duration": 2000,
+ "Value": "9999999"
+ },
+ {
+ "PowerHint": "LAUNCH_EXTEND",
+ "Node": "CPUMidClusterMaxFreq",
+ "Duration": 2000,
+ "Value": "9999999"
+ },
+ {
+ "PowerHint": "LAUNCH_EXTEND",
+ "Node": "CPULittleClusterMaxFreq",
+ "Duration": 2000,
+ "Value": "9999999"
+ },
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "MemFreq",
@@ -802,6 +872,12 @@
"Duration": 3000,
"Value": "9999999"
},
+ {
+ "PowerHint": "CAMERA_STREAMING_EXTREME",
+ "Node": "PowerHALCameraRunning",
+ "Duration": 0,
+ "Value": "1"
+ },
{
"PowerHint": "CAMERA_STREAMING_EXTREME",
"Node": "CPULittleClusterMaxFreq",
@@ -880,6 +956,12 @@
"Duration": 0,
"Value": "0"
},
+ {
+ "PowerHint": "CAMERA_STREAMING_HIGH",
+ "Node": "PowerHALCameraRunning",
+ "Duration": 0,
+ "Value": "1"
+ },
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUUtilThreshold",
@@ -964,6 +1046,12 @@
"Duration": 0,
"Value": "0"
},
+ {
+ "PowerHint": "CAMERA_STREAMING_STANDARD",
+ "Node": "PowerHALCameraRunning",
+ "Duration": 0,
+ "Value": "1"
+ },
{
"PowerHint": "CAMERA_STREAMING_STANDARD",
"Node": "CDPreferHighCap",
@@ -1036,6 +1124,12 @@
"Duration": 0,
"Value": "0"
},
+ {
+ "PowerHint": "CAMERA_STREAMING_LOW",
+ "Node": "PowerHALCameraRunning",
+ "Duration": 0,
+ "Value": "1"
+ },
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CDPreferHighCap",
@@ -1114,6 +1208,26 @@
"Duration": 0,
"Value": "0"
},
+ {
+ "PowerHint": "CAMERA_VIDEO_RECORDING",
+ "Type": "MaskHint",
+ "Value": "CDCPUSET_RESTRICTED"
+ },
+ {
+ "PowerHint": "CAMERA_VIDEO_RECORDING",
+ "Type": "MaskHint",
+ "Value": "CDHIGHCPUSETCPUS_RESTRICTED"
+ },
+ {
+ "PowerHint": "CAMERA_VIDEO_RECORDING",
+ "Type": "MaskHint",
+ "Value": "CDMIDCPUSETCPUS_RESTRICTED"
+ },
+ {
+ "PowerHint": "CAMERA_VIDEO_RECORDING",
+ "Type": "MaskHint",
+ "Value": "CDMIDHIGHCPUSETCPUS_RESTRICTED"
+ },
{
"PowerHint": "CAMERA_FIXED_FPS",
"Node": "MemFreq",
diff --git a/thermal_info_config_bluejay.json b/thermal_info_config_bluejay.json
index 92c197d..7962173 100644
--- a/thermal_info_config_bluejay.json
+++ b/thermal_info_config_bluejay.json
@@ -1021,7 +1021,7 @@
"NAN",
"NAN",
"NAN",
- 115.0
+ "NAN"
],
"VrThreshold":"NAN",
"Multiplier":0.001
diff --git a/vibrator/Android.bp b/vibrator/Android.bp
new file mode 100644
index 0000000..6ba5042
--- /dev/null
+++ b/vibrator/Android.bp
@@ -0,0 +1,52 @@
+//
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_defaults {
+ name: "PixelVibratorDefaultsPrivateBluejay",
+ relative_install_path: "hw",
+ static_libs: [
+ "PixelVibratorCommonPrivateBluejay",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "libcutils",
+ "libhardware",
+ "liblog",
+ "libutils",
+ ],
+}
+
+cc_defaults {
+ name: "PixelVibratorBinaryDefaultsPrivateBluejay",
+ defaults: ["PixelVibratorDefaultsPrivateBluejay"],
+ shared_libs: [
+ "android.hardware.vibrator-V2-ndk",
+ ],
+}
+
+cc_defaults {
+ name: "PixelVibratorTestDefaultsPrivateBluejay",
+ defaults: ["PixelVibratorDefaultsPrivateBluejay"],
+ static_libs: [
+ "android.hardware.vibrator-V2-ndk",
+ ],
+ test_suites: ["device-tests"],
+ require_root: true,
+}
diff --git a/vibrator/OWNERS b/vibrator/OWNERS
new file mode 100644
index 0000000..899224c
--- /dev/null
+++ b/vibrator/OWNERS
@@ -0,0 +1,4 @@
+chasewu@google.com
+michaelwr@google.com
+taikuo@google.com
+chrispaulo@google.com
diff --git a/vibrator/common/Android.bp b/vibrator/common/Android.bp
new file mode 100644
index 0000000..6eb2456
--- /dev/null
+++ b/vibrator/common/Android.bp
@@ -0,0 +1,37 @@
+//
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_library {
+ name: "PixelVibratorCommonPrivateBluejay",
+ srcs: [
+ "HardwareBase.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "libcutils",
+ "liblog",
+ "libutils",
+ ],
+ cflags: [
+ "-DATRACE_TAG=(ATRACE_TAG_VIBRATOR | ATRACE_TAG_HAL)",
+ "-DLOG_TAG=\"android.hardware.vibrator@1.x-common\"",
+ ],
+ export_include_dirs: ["."],
+ vendor_available: true,
+}
diff --git a/vibrator/common/HardwareBase.cpp b/vibrator/common/HardwareBase.cpp
new file mode 100644
index 0000000..8e07e99
--- /dev/null
+++ b/vibrator/common/HardwareBase.cpp
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HardwareBase.h"
+
+#include
+#include
+
+#include
+#include
+
+#include "utils.h"
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace vibrator {
+
+HwApiBase::HwApiBase() {
+ mPathPrefix = std::getenv("HWAPI_PATH_PREFIX") ?: "";
+ if (mPathPrefix.empty()) {
+ ALOGE("Failed get HWAPI path prefix!");
+ }
+}
+
+void HwApiBase::saveName(const std::string &name, const std::ios *stream) {
+ mNames[stream] = name;
+}
+
+bool HwApiBase::has(const std::ios &stream) {
+ return !!stream;
+}
+
+void HwApiBase::debug(int fd) {
+ dprintf(fd, "Kernel:\n");
+
+ for (auto &entry : utils::pathsFromEnv("HWAPI_DEBUG_PATHS", mPathPrefix)) {
+ auto &path = entry.first;
+ auto &stream = entry.second;
+ std::string line;
+
+ dprintf(fd, " %s:\n", path.c_str());
+ while (std::getline(stream, line)) {
+ dprintf(fd, " %s\n", line.c_str());
+ }
+ }
+
+ mRecordsMutex.lock();
+ dprintf(fd, " Records:\n");
+ for (auto &r : mRecords) {
+ if (r == nullptr) {
+ continue;
+ }
+ dprintf(fd, " %s\n", r->toString(mNames).c_str());
+ }
+ mRecordsMutex.unlock();
+}
+
+HwCalBase::HwCalBase() {
+ std::ifstream calfile;
+ auto propertyPrefix = std::getenv("PROPERTY_PREFIX");
+
+ if (propertyPrefix != NULL) {
+ mPropertyPrefix = std::string(propertyPrefix);
+ } else {
+ ALOGE("Failed get property prefix!");
+ }
+
+ utils::fileFromEnv("CALIBRATION_FILEPATH", &calfile);
+
+ for (std::string line; std::getline(calfile, line);) {
+ if (line.empty() || line[0] == '#') {
+ continue;
+ }
+ std::istringstream is_line(line);
+ std::string key, value;
+ if (std::getline(is_line, key, ':') && std::getline(is_line, value)) {
+ mCalData[utils::trim(key)] = utils::trim(value);
+ }
+ }
+}
+
+void HwCalBase::debug(int fd) {
+ std::ifstream stream;
+ std::string path;
+ std::string line;
+ struct context {
+ HwCalBase *obj;
+ int fd;
+ } context{this, fd};
+
+ dprintf(fd, "Properties:\n");
+
+ property_list(
+ [](const char *key, const char *value, void *cookie) {
+ struct context *context = static_cast(cookie);
+ HwCalBase *obj = context->obj;
+ int fd = context->fd;
+ const std::string expect{obj->mPropertyPrefix};
+ const std::string actual{key, std::min(strlen(key), expect.size())};
+ if (actual == expect) {
+ dprintf(fd, " %s:\n", key);
+ dprintf(fd, " %s\n", value);
+ }
+ },
+ &context);
+
+ dprintf(fd, "\n");
+
+ dprintf(fd, "Persist:\n");
+
+ utils::fileFromEnv("CALIBRATION_FILEPATH", &stream, &path);
+
+ dprintf(fd, " %s:\n", path.c_str());
+ while (std::getline(stream, line)) {
+ dprintf(fd, " %s\n", line.c_str());
+ }
+}
+
+} // namespace vibrator
+} // namespace hardware
+} // namespace android
+} // namespace aidl
diff --git a/vibrator/common/HardwareBase.h b/vibrator/common/HardwareBase.h
new file mode 100644
index 0000000..5b07040
--- /dev/null
+++ b/vibrator/common/HardwareBase.h
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include
+#include