Snap for 6948038 from 4ee646461dc54a52e6fe0199c3c0cd657b60a56d to rvc-platform-release
Change-Id: Id2d883ed733dbcb8bb928dd8d6549fbb6c937767
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 0000000..2f8d947
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,50 @@
+# Copyright 2020 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.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# Vibrator HAL switch to AIDL
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.vibrator@1.3-service.redfin.rc)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.vibrator@1.3-service.redfin)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.vibrator@1.3-service.redfin.xml)
diff --git a/aosp_redfin.mk b/aosp_redfin.mk
index 58b15b9..25756bc 100644
--- a/aosp_redfin.mk
+++ b/aosp_redfin.mk
@@ -46,6 +46,10 @@
$(call inherit-product-if-exists, vendor/google_devices/redfin/proprietary/device-vendor.mk)
$(call inherit-product-if-exists, vendor/google_devices/redfin/prebuilts/device-vendor-redfin.mk)
+# Exclude features that are not available on AOSP devices.
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/aosp_excluded_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/aosp_excluded_hardware.xml
+
# Don't build super.img.
PRODUCT_BUILD_SUPER_PARTITION := false
diff --git a/audio/acdbdata/Bluetooth_cal.acdb b/audio/acdbdata/Bluetooth_cal.acdb
index b8cfc08..cef7545 100644
--- a/audio/acdbdata/Bluetooth_cal.acdb
+++ b/audio/acdbdata/Bluetooth_cal.acdb
Binary files differ
diff --git a/audio/acdbdata/General_cal.acdb b/audio/acdbdata/General_cal.acdb
index 5b7455b..bc94942 100644
--- a/audio/acdbdata/General_cal.acdb
+++ b/audio/acdbdata/General_cal.acdb
Binary files differ
diff --git a/audio/acdbdata/Global_cal.acdb b/audio/acdbdata/Global_cal.acdb
index e654c89..f70001c 100644
--- a/audio/acdbdata/Global_cal.acdb
+++ b/audio/acdbdata/Global_cal.acdb
Binary files differ
diff --git a/audio/acdbdata/Handset_cal.acdb b/audio/acdbdata/Handset_cal.acdb
index 387e536..cdc22ed 100644
--- a/audio/acdbdata/Handset_cal.acdb
+++ b/audio/acdbdata/Handset_cal.acdb
Binary files differ
diff --git a/audio/acdbdata/Headset_cal.acdb b/audio/acdbdata/Headset_cal.acdb
index 9458183..7a79a15 100644
--- a/audio/acdbdata/Headset_cal.acdb
+++ b/audio/acdbdata/Headset_cal.acdb
Binary files differ
diff --git a/audio/acdbdata/Speaker_cal.acdb b/audio/acdbdata/Speaker_cal.acdb
index ce5c6e4..a721254 100644
--- a/audio/acdbdata/Speaker_cal.acdb
+++ b/audio/acdbdata/Speaker_cal.acdb
Binary files differ
diff --git a/audio/acdbdata/workspaceFile.qwsp b/audio/acdbdata/workspaceFile.qwsp
index 26598f3..794cc7e 100644
--- a/audio/acdbdata/workspaceFile.qwsp
+++ b/audio/acdbdata/workspaceFile.qwsp
Binary files differ
diff --git a/audio/audio_platform_info_noextcodec_snd.xml b/audio/audio_platform_info_noextcodec_snd.xml
index df6f553..ac1926a 100644
--- a/audio/audio_platform_info_noextcodec_snd.xml
+++ b/audio/audio_platform_info_noextcodec_snd.xml
@@ -79,9 +79,22 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" acdb_id="144"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" acdb_id="145"/>
<device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" acdb_id="147"/>
- <device name="SND_DEVICE_IN_USB_HEADSET_MIC" acdb_id="4"/>
+ <device name="SND_DEVICE_IN_USB_HEADSET_MIC" acdb_id="44"/>
+ <device name="SND_DEVICE_IN_VOICE_RECOG_USB_HEADSET_MIC" acdb_id="143"/>
<device name="SND_DEVICE_IN_VOICE_TTY_VCO_SPEAKER_MIC" acdb_id="19"/>
+ <device name="SND_DEVICE_IN_VOICE_REC_DMIC_STEREO" acdb_id="144"/>
</acdb_ids>
+
+ <audio_input_source_delay>
+ <audio_source_delay name="AUDIO_SOURCE_CAMCORDER" delay="130"/>
+ <audio_source_delay name="AUDIO_SOURCE_MIC" delay="10"/>
+ </audio_input_source_delay>
+
+ <audio_output_usecase_delay>
+ <audio_usecase_delay name="USECASE_AUDIO_PLAYBACK_DEEP_BUFFER" delay="20"/>
+ </audio_output_usecase_delay>
+
+
<external_specific_dev>
<!-- condor -->
<ext_device name="SND_DEVICE_OUT_VOICE_USB_HEADSET" usbid="18d1:5034" acdb_id="56" />
@@ -135,10 +148,10 @@
<usecase name="USECASE_VOWLAN_CALL" type="out" id="-1"/>
<usecase name="USECASE_AUDIO_PLAYBACK_FM" type="out" id="30"/>
<usecase name="USECASE_AUDIO_PLAYBACK_FM" type="in" id="38"/>
- <!-- The pcm device for QUIN TDM hostless playback is 64 -->
- <usecase name="USECASE_AUDIO_SPKR_CALIB_RX" type="out" id="64"/>
- <!-- The pcm device for QUIN TDM hostless capture is 65 -->
- <usecase name="USECASE_AUDIO_SPKR_CALIB_TX" type="in" id="65"/>
+ <!-- The pcm device for QUIN TDM hostless playback is 54 -->
+ <usecase name="USECASE_AUDIO_SPKR_CALIB_RX" type="out" id="54"/>
+ <!-- The pcm device for QUIN TDM hostless capture is 55 -->
+ <usecase name="USECASE_AUDIO_SPKR_CALIB_TX" type="in" id="55"/>
<usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="in" id="-1"/>
<usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
<usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
@@ -328,22 +341,17 @@
group="0" index_in_the_group="0" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="93"
frequencies="100.00 106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00 20000.00"
responses="-0.78 -0.71 -0.64 -0.60 -0.55 -0.50 -0.47 -0.42 -0.39 -0.36 -0.34 -0.33 -0.32 -0.29 -0.28 -0.28 -0.27 -0.25 -0.25 -0.24 -0.23 -0.23 -0.22 -0.22 -0.19 -0.17 -0.15 -0.15 -0.14 -0.14 -0.12 -0.11 -0.10 -0.10 -0.08 -0.07 -0.07 -0.04 -0.03 -0.01 0.00 0.04 0.06 0.07 0.08 0.13 0.09 0.14 0.19 0.23 0.28 0.29 0.31 0.37 0.88 0.86 0.77 0.78 0.84 0.86 1.05 1.12 1.18 1.25 1.43 1.66 1.83 2.02 2.23 2.59 2.84 3.35 4.01 6.82 6.62 6.42 7.30 8.23 7.54 12.68 13.76 18.69 19.68 20.90 23.70 25.10 21.65 16.18 18.84 25.44 23.48 23.22 24.89"
- sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 0.0 1.0" geometric_location="0.0269 0.0058 0.0079" />
+ sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 -1.0 0.0" geometric_location="0.0269 0.0058 0.0079" />
<microphone valid_mask="31" device_id="builtin_mic_2" type="AUDIO_DEVICE_IN_BACK_MIC" address="back" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
group="0" index_in_the_group="1" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="92"
frequencies="106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00 20000.00"
responses="-0.75 -0.74 -0.69 -0.65 -0.62 -0.61 -0.56 -0.53 -0.50 -0.47 -0.43 -0.40 -0.37 -0.36 -0.33 -0.30 -0.28 -0.25 -0.24 -0.24 -0.24 -0.25 -0.24 -0.12 -0.10 -0.08 -0.09 -0.07 -0.07 -0.06 -0.06 -0.06 -0.05 -0.04 -0.05 -0.04 -0.01 0.02 0.02 0.00 0.02 0.03 0.07 0.10 0.10 0.13 0.01 0.01 0.10 0.11 0.19 0.24 0.38 0.46 0.26 0.27 0.43 0.76 0.75 1.09 1.09 0.94 1.06 1.21 1.47 1.45 1.36 2.07 2.85 2.90 3.85 4.65 5.84 5.46 6.15 7.50 8.30 10.62 12.70 16.65 20.95 25.41 26.32 20.20 16.60 11.24 7.85 7.62 20.19 7.32 2.87 5.18"
- sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 1.0 0.0" geometric_location="0.0546 0.1456 0.00415" />
- <microphone valid_mask="31" device_id="builtin_mic_3" type="AUDIO_DEVICE_IN_BUILTIN_MIC" address="" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
+ sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 0.0 -1.0" geometric_location="0.0546 0.1456 0.00415" />
+ <microphone valid_mask="31" device_id="builtin_mic_3" type="AUDIO_DEVICE_IN_BUILTIN_MIC" address="bottom" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
group="0" index_in_the_group="2" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="92"
frequencies="100.00 106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00"
responses="-9.24 -9.31 -9.39 -9.45 -9.46 -9.47 -9.50 -9.52 -9.51 -9.52 -9.51 -9.50 -9.49 -9.47 -9.48 -9.49 -9.48 -9.50 -9.51 -9.53 -9.55 -9.59 -9.63 -9.67 -9.58 -9.57 -9.65 -9.68 -9.71 -9.75 -9.79 -9.84 -9.87 -9.87 -9.90 -9.90 -9.91 -9.97 -10.01 -10.05 -9.85 -9.93 -9.94 -9.98 -10.04 -10.12 -10.28 -10.25 -10.01 -9.86 -9.81 -9.82 -9.61 -9.46 -8.27 -8.42 -8.98 -8.99 -8.82 -9.21 -8.92 -8.97 -9.30 -9.44 -9.52 -9.28 -9.09 -8.81 -7.02 -5.72 -5.30 -7.26 -8.39 -12.28 -8.23 -6.99 -5.52 -4.87 -3.82 -6.09 0.00 -2.15 -0.26 1.48 5.22 10.92 6.41 9.55 12.96 3.35 22.00 19.75"
- sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 0.0 1.0" geometric_location="0.0274 0.14065 0.0079" />
- <microphone valid_mask="31" device_id="builtin_mic_4" type="AUDIO_DEVICE_IN_BACK_MIC" address="" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
- group="0" index_in_the_group="3" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="92"
- frequencies="106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00 20000.00"
- responses="-0.75 -0.74 -0.69 -0.65 -0.62 -0.61 -0.56 -0.53 -0.50 -0.47 -0.43 -0.40 -0.37 -0.36 -0.33 -0.30 -0.28 -0.25 -0.24 -0.24 -0.24 -0.25 -0.24 -0.12 -0.10 -0.08 -0.09 -0.07 -0.07 -0.06 -0.06 -0.06 -0.05 -0.04 -0.05 -0.04 -0.01 0.02 0.02 0.00 0.02 0.03 0.07 0.10 0.10 0.13 0.01 0.01 0.10 0.11 0.19 0.24 0.38 0.46 0.26 0.27 0.43 0.76 0.75 1.09 1.09 0.94 1.06 1.21 1.47 1.45 1.36 2.07 2.85 2.90 3.85 4.65 5.84 5.46 6.15 7.50 8.30 10.62 12.70 16.65 20.95 25.41 26.32 20.20 16.60 11.24 7.85 7.62 20.19 7.32 2.87 5.18"
- sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 1.0 0.0" geometric_location="0.0546 0.1456 0.00415" />
+ sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 1.0 0.0" geometric_location="0.0274 0.14065 0.0079" />
</microphone_characteristics>
<snd_devices>
<input_snd_device>
@@ -352,90 +360,6 @@
<mic_info mic_device_id="builtin_mic_1"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
</snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_MIC_AEC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_MIC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_MIC_AEC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_AEC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_MIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_MIC_AEC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_MIC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_AEC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_SPEAKER_MIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_CAMCORDER_MIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_CAMCORDER_LANDSCAPE">
<mic_info mic_device_id="builtin_mic_1"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
@@ -484,211 +408,41 @@
<mic_info mic_device_id="builtin_mic_3"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
</snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_DMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_SPEAKER_DMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_SPEAKER_TMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_SPEAKER_QMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_4"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC">
<mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
</snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_NS">
<mic_info mic_device_id="builtin_mic_1"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
</snd_dev>
+ <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_AEC">
+ <mic_info mic_device_id="builtin_mic_1"
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ </snd_dev>
+ <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS">
+ <mic_info mic_device_id="builtin_mic_1"
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ </snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_DMIC_STEREO">
<mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_AANC_HANDSET_MIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
<mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
</snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_QUAD_MIC">
+ <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_STEREO">
<mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
<mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_4"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_STEREO_DMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_STEREO_DMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_QMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_QMIC_AEC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_QMIC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
</snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_THREE_MIC">
<mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
<mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
<mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_TMIC_FLUENCE_PRO">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_TMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_TMIC_AEC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_TMIC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_TMIC_AEC_NS">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_TMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
+ channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
</snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_MIC">
<mic_info mic_device_id="builtin_mic_1"
@@ -697,7 +451,7 @@
<snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC">
<mic_info mic_device_id="builtin_mic_1"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
- <mic_info mic_device_id="builtin_mic_2"
+ <mic_info mic_device_id="builtin_mic_3"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
</snd_dev>
<snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_THREE_MIC">
@@ -708,22 +462,6 @@
<mic_info mic_device_id="builtin_mic_3"
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
</snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
- </snd_dev>
- <snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_GENERIC_QMIC">
- <mic_info mic_device_id="builtin_mic_1"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_2"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- <mic_info mic_device_id="builtin_mic_3"
- channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
- </snd_dev>
</input_snd_device_mic_mapping>
</input_snd_device>
</snd_devices>
diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml
index c11cb5f..83a4995 100644
--- a/audio/audio_policy_configuration.xml
+++ b/audio/audio_policy_configuration.xml
@@ -165,7 +165,7 @@
<route type="mix" sink="Earpiece"
sources="primary output,raw,deep_buffer,mmap_no_irq_out,voip_rx"/>
<route type="mix" sink="Speaker"
- sources="primary output,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/>
+ sources="primary output,raw,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,raw,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/>
<route type="mix" sink="Wired Headset"
diff --git a/audio/cs35l41/B2/R-cs35l41-revB2-dsp1-spk-prot.bin b/audio/cs35l41/B2/R-cs35l41-revB2-dsp1-spk-prot.bin
index 7b5284d..e2d80ae 100644
--- a/audio/cs35l41/B2/R-cs35l41-revB2-dsp1-spk-prot.bin
+++ b/audio/cs35l41/B2/R-cs35l41-revB2-dsp1-spk-prot.bin
Binary files differ
diff --git a/audio/cs35l41/B2/cs35l41-revB2-dsp1-spk-prot.bin b/audio/cs35l41/B2/cs35l41-revB2-dsp1-spk-prot.bin
index 76bdaae..2170b0d 100644
--- a/audio/cs35l41/B2/cs35l41-revB2-dsp1-spk-prot.bin
+++ b/audio/cs35l41/B2/cs35l41-revB2-dsp1-spk-prot.bin
Binary files differ
diff --git a/audio/mixer_paths_noextcodec_snd.xml b/audio/mixer_paths_noextcodec_snd.xml
index dfc6139..2725e50 100644
--- a/audio/mixer_paths_noextcodec_snd.xml
+++ b/audio/mixer_paths_noextcodec_snd.xml
@@ -535,8 +535,8 @@
<ctl name="R ASP TX4 Source" value="Zero" />
<!-- CS35L41 TX source end -->
<!-- CS35L41 TX slot(to QCT ADSP) -->
- <ctl name="ASPTX1 Slot Position" value="0" />
- <ctl name="R ASPTX1 Slot Position" value="1" />
+ <ctl name="ASPTX1 Slot Position" value="1" />
+ <ctl name="R ASPTX1 Slot Position" value="0" />
<ctl name="ASPTX2 Slot Position" value="4" />
<ctl name="R ASPTX2 Slot Position" value="5" />
<ctl name="ASPTX3 Slot Position" value="2" />
@@ -550,6 +550,22 @@
<ctl name="DSP RX2 Source" value="ASPRX1" />
<ctl name="R DSP RX2 Source" value="ASPRX1" />
<!-- CS35L41 dsp(firmware) source end-->
+ <!-- CS35L41 VP brownout start-->
+ <ctl name="VPBR Enable" value="Enabled" />
+ <ctl name="R VPBR Enable" value="Enabled" />
+ <ctl name="VPBR Release Rate" value="250ms" />
+ <ctl name="R VPBR Release Rate" value="250ms" />
+ <ctl name="VPBR Wait" value="100ms" />
+ <ctl name="R VPBR Wait" value="100ms" />
+ <ctl name="VPBR Attack Rate" value="10us" />
+ <ctl name="R VPBR Attack Rate" value="10us" />
+ <ctl name="VPBR Attack Volume" value="0.125dB" />
+ <ctl name="R VPBR Attack Volume" value="0.125dB" />
+ <ctl name="VPBR Max Attenuation" value="9" />
+ <ctl name="R VPBR Max Attenuation" value="9" />
+ <ctl name="VPBR Threshold 1" value="2.639" />
+ <ctl name="R VPBR Threshold 1" value="2.639" />
+ <!-- CS35L41 VP brownout end-->
<!-- CS35L41 config end-->
<ctl name="HAC AMP EN" value="0" />
@@ -560,7 +576,7 @@
</path>
<path name="echo-reference">
- <ctl name="AUDIO_REF_EC_UL1 MUX" value="QUIN_TDM_RX_0" />
+ <ctl name="AUDIO_REF_EC_UL1 MUX" value="QUIN_TDM_TX_0" />
<ctl name="EC Reference Channels" value="Two"/>
</path>
@@ -570,7 +586,7 @@
</path>
<path name="echo-reference speaker">
- <ctl name="AUDIO_REF_EC_UL10 MUX" value="QUIN_TDM_RX_0"/>
+ <ctl name="AUDIO_REF_EC_UL10 MUX" value="QUIN_TDM_TX_0"/>
<ctl name="EC Reference Channels" value="Two"/>
</path>
@@ -583,15 +599,28 @@
<path name="echo-reference headphones" />
</path>
- <path name="echo-reference usb-headset">
- <ctl name="AUDIO_REF_EC_UL10 MUX" value="USB_AUDIO_RX" />
- <ctl name="EC Reference Channels" value="Two"/>
- </path>
+ <path name="echo-reference usb-headset">
+ <ctl name="AUDIO_REF_EC_UL10 MUX" value="USB_AUDIO_RX" />
+ <ctl name="EC Reference Channels" value="Two"/>
+ </path>
- <path name="echo-reference usb-headphones">
- <ctl name="AUDIO_REF_EC_UL10 MUX" value="USB_AUDIO_RX" />
- <ctl name="EC Reference Channels" value="Two"/>
- </path>
+ <path name="echo-reference usb-headphones">
+ <ctl name="AUDIO_REF_EC_UL10 MUX" value="USB_AUDIO_RX" />
+ <ctl name="EC Reference Channels" value="Two"/>
+ </path>
+
+ <path name="echo-reference bt-sco">
+ <ctl name="AUDIO_REF_EC_UL10 MUX" value="SLIM_7_RX" />
+ <ctl name="EC Reference Channels" value="One"/>
+ </path>
+
+ <path name="echo-reference bt-sco-wb">
+ <path name="echo-reference bt-sco" />
+ </path>
+
+ <path name="echo-reference bt-sco-swb">
+ <path name="echo-reference bt-sco" />
+ </path>
<path name="echo-reference display-port">
<ctl name="AUDIO_REF_EC_UL1 MUX" value="DISPLAY_PORT" />
@@ -633,7 +662,19 @@
<path name="echo-reference-voip usb-headphones">
<path name="echo-reference usb-headphones" />
- </path>
+ </path>
+
+ <path name="echo-reference-voip bt-sco">
+ <path name="echo-reference bt-sco" />
+ </path>
+
+ <path name="echo-reference-voip bt-sco-wb">
+ <path name="echo-reference bt-sco" />
+ </path>
+
+ <path name="echo-reference-voip bt-sco-swb">
+ <path name="echo-reference bt-sco" />
+ </path>
<path name="echo-reference-voip headphones-44.1">
<path name="echo-reference headphones-44.1" />
@@ -1569,6 +1610,7 @@
</path>
<path name="voicemmode1-call speaker">
+ <ctl name="VOC_EXT_EC MUX" value="QUIN_TDM_TX" />
<ctl name="QUIN_TDM_RX_0_Voice Mixer VoiceMMode1" value="1"/>
<ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1"/>
</path>
@@ -2117,9 +2159,9 @@
</path>
<path name="voice-hac-handset">
- <ctl name="HAC AMP EN" value="1" />
- <ctl name="Main AMP Enable Switch" value="1"/>
- <ctl name="R Main AMP Enable Switch" value="0"/>
+ <path name="handset" />
+ <ctl name="PCM Source" value="ASP" />
+ <ctl name="AMP PCM Gain" value="0" />
</path>
<path name="voice-handset-tmus">
@@ -2220,13 +2262,14 @@
<path name="voice-rec-mic">
<path name="handset-mic" />
+ <ctl name="ADC1 Capture Volume" id="0" value="52"/>
</path>
<path name="camcorder-mic">
<ctl name="ADC1 Capture Volume" id="0" value="23"/>
<ctl name="ADC2 Capture Volume" id="0" value="23"/>
<ctl name="ADC2 Capture Volume" id="1" value="23"/>
- <ctl name="PRI TDM TX Channel Offset" id="0" value="12" />
+ <ctl name="PRI TDM TX Channel Offset" id="0" value="12"/>
<ctl name="PRI TDM TX Channel Offset" id="1" value="8" />
<ctl name="PRI TDM TX Channel Offset" id="2" value="0" />
<ctl name="PRI_TDM_TX_0 Channels" value="Three"/>
@@ -2242,7 +2285,7 @@
<ctl name="ADC1 Capture Volume" id="0" value="23"/>
<ctl name="ADC2 Capture Volume" id="0" value="23"/>
<ctl name="ADC2 Capture Volume" id="1" value="23"/>
- <ctl name="PRI TDM TX Channel Offset" id="0" value="12" />
+ <ctl name="PRI TDM TX Channel Offset" id="0" value="12"/>
<ctl name="PRI TDM TX Channel Offset" id="1" value="8" />
<ctl name="PRI TDM TX Channel Offset" id="2" value="0" />
<ctl name="PRI_TDM_TX_0 Channels" value="Three"/>
@@ -2339,6 +2382,8 @@
<path name="handset-stereo-dmic-ef">
<path name="handset-dmic-endfire" />
+ <ctl name="ADC1 Capture Volume" id="0" value="23"/>
+ <ctl name="ADC2 Capture Volume" id="1" value="23"/>
</path>
<path name="speaker-stereo-dmic-ef">
@@ -2363,6 +2408,8 @@
<path name="voice-rec-dmic-ef">
<path name="dmic-endfire" />
+ <ctl name="ADC1 Capture Volume" id="0" value="52"/>
+ <ctl name="ADC2 Capture Volume" id="1" value="52"/>
</path>
<path name="voice-rec-dmic-ef-fluence">
@@ -2412,10 +2459,18 @@
<!-- Tri MIC devices -->
<path name="three-mic">
+ <ctl name="ADC1 Capture Volume" id="0" value="52"/>
+ <ctl name="ADC2 Capture Volume" id="0" value="52"/>
+ <ctl name="ADC2 Capture Volume" id="1" value="52"/>
+ <ctl name="PRI TDM TX Channel Offset" id="0" value="12"/>
+ <ctl name="PRI TDM TX Channel Offset" id="1" value="8" />
+ <ctl name="PRI TDM TX Channel Offset" id="2" value="0" />
<ctl name="PRI_TDM_TX_0 Channels" value="Three"/>
<ctl name="Sto1 ADC MIXL DMIC Switch" value="1" />
<ctl name="Sto2 ADC MIXL DMIC Switch" value="1" />
<ctl name="Sto2 ADC MIXR DMIC Switch" value="1" />
+ <ctl name="Stereo1 DMIC Mux" value="DMIC1" />
+ <ctl name="Stereo2 DMIC Mux" value="DMIC2" />
</path>
<path name="speaker-tmic">
@@ -2515,14 +2570,20 @@
<path name="unprocessed-mic">
<path name="unprocessed-handset-mic" />
+ <ctl name="ADC1 Capture Volume" id="0" value="30"/>
</path>
<path name="unprocessed-stereo-mic">
<path name="voice-rec-dmic-ef" />
+ <ctl name="ADC1 Capture Volume" id="0" value="30"/>
+ <ctl name="ADC2 Capture Volume" id="1" value="30"/>
</path>
<path name="unprocessed-three-mic">
<path name="three-mic" />
+ <ctl name="ADC1 Capture Volume" id="0" value="30"/>
+ <ctl name="ADC2 Capture Volume" id="0" value="30"/>
+ <ctl name="ADC2 Capture Volume" id="1" value="30"/>
</path>
<path name="unprocessed-quad-mic">
diff --git a/audio/sound_trigger_mixer_paths.xml b/audio/sound_trigger_mixer_paths.xml
new file mode 100644
index 0000000..c717802
--- /dev/null
+++ b/audio/sound_trigger_mixer_paths.xml
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--- Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. -->
+<!--- -->
+<!--- Redistribution and use in source and binary forms, with or without -->
+<!--- modification, are permitted provided that the following conditions are -->
+<!--- met: -->
+<!--- * Redistributions of source code must retain the above copyright -->
+<!--- notice, this list of conditions and the following disclaimer. -->
+<!--- * Redistributions in binary form must reproduce the above -->
+<!--- copyright notice, this list of conditions and the following -->
+<!--- disclaimer in the documentation and/or other materials provided -->
+<!--- with the distribution. -->
+<!--- * Neither the name of The Linux Foundation nor the names of its -->
+<!--- contributors may be used to endorse or promote products derived -->
+<!--- from this software without specific prior written permission. -->
+<!--- -->
+<!--- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -->
+<!--- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -->
+<!--- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -->
+<!--- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -->
+<!--- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!--- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!--- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -->
+<!--- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -->
+<!--- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -->
+<!--- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
+<!--- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
+
+<mixer>
+ <!-- These are the initial mixer settings -->
+ <ctl name="LSM1 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM2 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM3 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM4 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM5 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM6 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM7 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM8 Mixer PRI_TDM_TX_0" value="0" />
+ <ctl name="LSM1 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM2 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM3 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM4 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM5 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM6 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM7 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM8 Mixer VA_CDC_DMA_TX_0" value="0" />
+ <ctl name="LSM1 Port" value="None" />
+ <ctl name="LSM2 Port" value="None" />
+ <ctl name="LSM3 Port" value="None" />
+ <ctl name="LSM4 Port" value="None" />
+ <ctl name="LSM5 Port" value="None" />
+ <ctl name="LSM6 Port" value="None" />
+ <ctl name="LSM7 Port" value="None" />
+ <ctl name="LSM8 Port" value="None" />
+ <ctl name="VA_CDC_DMA_TX_0 Channels" value="One" />
+ <ctl name="VA_AIF1_CAP Mixer DEC0" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC1" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC2" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC3" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC4" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC5" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC6" value="0" />
+ <ctl name="VA_AIF1_CAP Mixer DEC7" value="0" />
+ <ctl name="VA DEC0 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC1 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC2 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC3 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC4 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC5 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC6 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC7 MUX" value="MSM_DMIC" />
+ <ctl name="VA DMIC MUX0" value="ZERO" />
+ <ctl name="VA DMIC MUX1" value="ZERO" />
+ <ctl name="VA DMIC MUX2" value="ZERO" />
+ <ctl name="VA DMIC MUX3" value="ZERO" />
+ <ctl name="VA DMIC MUX4" value="ZERO" />
+ <ctl name="VA DMIC MUX5" value="ZERO" />
+ <ctl name="VA DMIC MUX6" value="ZERO" />
+ <ctl name="VA DMIC MUX7" value="ZERO" />
+ <ctl name="VA SMIC MUX0" value="ZERO" />
+ <ctl name="VA SMIC MUX1" value="ZERO" />
+ <ctl name="VA SMIC MUX2" value="ZERO" />
+ <ctl name="VA SMIC MUX3" value="ZERO" />
+ <ctl name="VA SMIC MUX4" value="ZERO" />
+ <ctl name="VA SMIC MUX5" value="ZERO" />
+ <ctl name="VA SMIC MUX6" value="ZERO" />
+ <ctl name="VA SMIC MUX7" value="ZERO" />
+ <ctl name="AUDIO_REF_EC_UL1 MUX" value="None"/>
+ <ctl name="EC Reference Channels" value="Zero"/>
+ <ctl name="EC Reference Bit Format" value="0"/>
+ <ctl name="EC Reference SampleRate" value="0"/>
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="None" />
+ <ctl name="PRI_TDM_TX_0 Channels" value="One" />
+ <ctl name="Sto1 ADC MIXL DMIC Switch" value="0" />
+ <ctl name="Sto2 ADC MIXL DMIC Switch" value="0" />
+ <ctl name="Sto2 ADC MIXR DMIC Switch" value="0" />
+ <ctl name="PRI TDM TX Channel Offset" id="0" value="0" />
+ <ctl name="PRI TDM TX Channel Offset" id="1" value="8" />
+ <ctl name="PRI TDM TX Channel Offset" id="2" value="12" />
+
+ <path name="listen-voice-wakeup-1">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM1 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM1 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-2">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM2 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM2 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-3">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM3 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM3 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-4">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM4 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM4 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-5">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM5 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM5 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-6">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM6 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM6 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-7">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM7 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM7 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-8">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="AUDIO" />
+ <ctl name="LSM8 Port" value="PRI_TDM_TX_0" />
+ <ctl name="LSM8 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-1 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM1 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM1 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-2 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM2 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM2 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-3 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM3 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM3 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-4 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM4 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM4 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-5 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM5 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM5 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-6 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM6 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM6 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-7 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM7 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM7 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-8 preproc">
+ <ctl name="PRI_TDM_TX_0 LSM Function" value="SWAUDIO" />
+ <ctl name="LSM8 Port" value="ADM_LSM_TX" />
+ <ctl name="LSM8 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="listen-voice-wakeup-1 port">
+ <ctl name="LSM1 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-2 port">
+ <ctl name="LSM2 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-3 port">
+ <ctl name="LSM3 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-4 port">
+ <ctl name="LSM4 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-5 port">
+ <ctl name="LSM5 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-6 port">
+ <ctl name="LSM6 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-7 port">
+ <ctl name="LSM7 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-8 port">
+ <ctl name="LSM8 Port" value="PRI_TDM_TX_0" />
+ </path>
+
+ <path name="listen-voice-wakeup-1 preproc port">
+ <ctl name="LSM1 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-2 preproc port">
+ <ctl name="LSM2 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-3 preproc port">
+ <ctl name="LSM3 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-4 preproc port">
+ <ctl name="LSM4 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-5 preproc port">
+ <ctl name="LSM5 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-6 preproc port">
+ <ctl name="LSM6 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-7 preproc port">
+ <ctl name="LSM7 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-voice-wakeup-8 preproc port">
+ <ctl name="LSM8 Port" value="ADM_LSM_TX" />
+ </path>
+
+ <path name="listen-ape-handset-mic">
+ <ctl name="ADC1 Capture Volume" value="23" />
+ <ctl name="ADC2 Capture Volume" value="23" />
+ <ctl name="PRI_TDM_TX_0 Channels" value="One" />
+ <ctl name="Sto1 ADC MIXL DMIC Switch" value="1" />
+ </path>
+
+ <path name="listen-ape-handset-dmic">
+ <ctl name="ADC1 Capture Volume" value="23"/>
+ <ctl name="ADC2 Capture Volume" value="23"/>
+ <ctl name="PRI TDM TX Channel Offset" id="0" value="0"/>
+ <ctl name="PRI TDM TX Channel Offset" id="1" value="12"/>
+ <ctl name="PRI_TDM_TX_0 Channels" value="Two"/>
+ <ctl name="Sto1 ADC MIXL DMIC Switch" value="1" />
+ <ctl name="Sto2 ADC MIXR DMIC Switch" value="1" />
+ </path>
+
+ <path name="listen-ape-handset-tmic">
+ <ctl name="ADC1 Capture Volume" value="23" />
+ <ctl name="ADC2 Capture Volume" value="23" />
+ <ctl name="PRI_TDM_TX_0 Channels" value="Three" />
+ </path>
+
+ <path name="listen-ape-handset-qmic">
+ <ctl name="VA_CDC_DMA_TX_0 Channels" value="Four" />
+ <ctl name="VA_AIF1_CAP Mixer DEC0" value="1" />
+ <ctl name="VA_AIF1_CAP Mixer DEC1" value="1" />
+ <ctl name="VA_AIF1_CAP Mixer DEC2" value="1" />
+ <ctl name="VA_AIF1_CAP Mixer DEC3" value="1" />
+ <ctl name="VA DEC0 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC1 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC2 MUX" value="MSM_DMIC" />
+ <ctl name="VA DEC3 MUX" value="MSM_DMIC" />
+ <ctl name="VA DMIC MUX0" value="DMIC4" />
+ <ctl name="VA DMIC MUX1" value="DMIC0" />
+ <ctl name="VA DMIC MUX2" value="DMIC1" />
+ <ctl name="VA DMIC MUX3" value="DMIC2" />
+ </path>
+
+ <path name="listen-ape-headset-mic">
+ <ctl name="VA_AIF1_CAP Mixer DEC0" value="1" />
+ <ctl name="VA DEC0 MUX" value="SWR_MIC" />
+ <ctl name="VA SMIC MUX0" value="ADC1" />
+ <ctl name="ADC2 Volume" value="62" />
+ <ctl name="ADC2_MIXER Switch" value="1" />
+ <ctl name="ADC2 MUX" value="INP2" />
+ </path>
+
+ <path name="echo-reference">
+ <ctl name="AUDIO_REF_EC_UL1 MUX" value="QUIN_TDM_TX_0"/>
+ <ctl name="EC Reference Channels" value="Two"/>
+ <ctl name="EC Reference Bit Format" value="S16_LE"/>
+ <ctl name="EC Reference SampleRate" value="48000"/>
+ </path>
+
+ <path name="echo-reference headset">
+ <ctl name="AUDIO_REF_EC_UL1 MUX" value="WSA_CDC_DMA_RX_0"/>
+ <ctl name="EC Reference Channels" value="One"/>
+ <ctl name="EC Reference Bit Format" value="S16_LE"/>
+ <ctl name="EC Reference SampleRate" value="48000"/>
+ </path>
+
+ <path name="echo-reference a2dp">
+ <ctl name="AUDIO_REF_EC_UL1 MUX" value="SLIM_7_RX"/>
+ <ctl name="EC Reference Channels" value="Two"/>
+ <ctl name="EC Reference Bit Format" value="S16_LE"/>
+ <ctl name="EC Reference SampleRate" value="48000"/>
+ </path>
+
+</mixer>
diff --git a/audio_policy_volumes.xml b/audio_policy_volumes.xml
index 635f721..8720ecf 100644
--- a/audio_policy_volumes.xml
+++ b/audio_policy_volumes.xml
@@ -30,9 +30,9 @@
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_SPEAKER">
- <point>0,-2400</point>
- <point>33,-1600</point>
- <point>66,-800</point>
+ <point>0,-2700</point>
+ <point>33,-1770</point>
+ <point>66,-850</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EARPIECE">
diff --git a/bluetooth_power_limits_redfin_ROW.csv b/bluetooth_power_limits_redfin_ROW.csv
new file mode 100644
index 0000000..fbd763d
--- /dev/null
+++ b/bluetooth_power_limits_redfin_ROW.csv
@@ -0,0 +1,67 @@
+Head,BTHotspot,WIFI5Ghz,HotspotVoice,BTMedia,Cell,IMU,BluetoothBDRPower,BluetoothEDRPower,BluetoothLEPower
+0,0,0,0,0,0,1,70,71,67
+0,0,0,0,0,1,1,70,71,67
+0,0,0,0,1,0,1,70,71,67
+0,0,0,0,1,1,1,70,71,67
+0,0,0,1,0,0,1,70,71,67
+0,0,0,1,0,1,1,70,71,67
+0,0,0,1,1,0,1,70,71,67
+0,0,0,1,1,1,1,70,71,67
+0,0,1,0,0,0,1,70,71,43
+0,0,1,0,0,1,1,70,71,43
+0,0,1,0,1,0,1,70,71,43
+0,0,1,0,1,1,1,70,71,43
+0,0,1,1,0,0,1,70,71,43
+0,0,1,1,0,1,1,70,71,43
+0,0,1,1,1,0,1,70,71,43
+0,0,1,1,1,1,1,70,71,43
+0,1,0,0,0,0,1,70,71,67
+0,1,0,0,0,1,1,70,71,67
+0,1,0,0,1,0,1,70,71,67
+0,1,0,0,1,1,1,70,71,67
+0,1,0,1,0,0,1,70,71,67
+0,1,0,1,0,1,1,70,71,67
+0,1,0,1,1,0,1,70,71,67
+0,1,0,1,1,1,1,70,71,67
+0,1,1,0,0,0,1,70,71,43
+0,1,1,0,0,1,1,70,71,43
+0,1,1,0,1,0,1,70,71,43
+0,1,1,0,1,1,1,70,71,43
+0,1,1,1,0,0,1,70,71,43
+0,1,1,1,0,1,1,70,71,43
+0,1,1,1,1,0,1,70,71,43
+0,1,1,1,1,1,1,70,71,43
+1,0,0,0,0,0,-1,43,44,43
+1,0,0,0,0,1,-1,43,44,43
+1,0,0,0,1,0,-1,43,44,43
+1,0,0,0,1,1,-1,43,44,43
+1,0,0,1,0,0,-1,43,44,43
+1,0,0,1,0,1,-1,43,44,43
+1,0,0,1,1,0,-1,43,44,43
+1,0,0,1,1,1,-1,43,44,43
+1,0,1,0,0,0,-1,43,44,43
+1,0,1,0,0,1,-1,43,44,43
+1,0,1,0,1,0,-1,43,44,43
+1,0,1,0,1,1,-1,43,44,43
+1,0,1,1,0,0,-1,43,44,43
+1,0,1,1,0,1,-1,43,44,43
+1,0,1,1,1,0,-1,43,44,43
+1,0,1,1,1,1,-1,43,44,43
+1,1,0,0,0,0,-1,43,44,43
+1,1,0,0,0,1,-1,43,44,43
+1,1,0,0,1,0,-1,43,44,43
+1,1,0,0,1,1,-1,43,44,43
+1,1,0,1,0,0,-1,43,44,43
+1,1,0,1,0,1,-1,43,44,43
+1,1,0,1,1,0,-1,43,44,43
+1,1,0,1,1,1,-1,43,44,43
+1,1,1,0,0,0,-1,43,44,43
+1,1,1,0,0,1,-1,43,44,43
+1,1,1,0,1,0,-1,43,44,43
+1,1,1,0,1,1,-1,43,44,43
+1,1,1,1,0,0,-1,43,44,43
+1,1,1,1,0,1,-1,43,44,43
+1,1,1,1,1,0,-1,43,44,43
+1,1,1,1,1,1,-1,43,44,43
+0,-1,0,-1,-1,-1,0,70,71,67
+0,-1,1,-1,-1,-1,0,70,71,43
\ No newline at end of file
diff --git a/bluetooth_power_limits_redfin_eu.csv b/bluetooth_power_limits_redfin_eu.csv
new file mode 100644
index 0000000..f8e824f
--- /dev/null
+++ b/bluetooth_power_limits_redfin_eu.csv
@@ -0,0 +1,66 @@
+Head,BTHotspot,WIFI5Ghz,HotspotVoice,BTMedia,Cell,IMU,BluetoothBDRPower,BluetoothEDRPower,BluetoothLEPower
+0,0,0,0,0,0,1,73,74,42
+0,0,0,0,0,1,1,73,74,42
+0,0,0,0,1,0,1,73,74,42
+0,0,0,0,1,1,1,73,74,42
+0,0,0,1,0,0,1,73,74,42
+0,0,0,1,0,1,1,73,74,42
+0,0,0,1,1,0,1,73,74,42
+0,0,0,1,1,1,1,73,74,42
+0,0,1,0,0,0,1,73,74,42
+0,0,1,0,0,1,1,73,74,42
+0,0,1,0,1,0,1,73,74,42
+0,0,1,0,1,1,1,73,74,42
+0,0,1,1,0,0,1,73,74,42
+0,0,1,1,0,1,1,73,74,42
+0,0,1,1,1,0,1,73,74,42
+0,0,1,1,1,1,1,73,74,42
+0,1,0,0,0,0,1,73,74,42
+0,1,0,0,0,1,1,73,74,42
+0,1,0,0,1,0,1,73,74,42
+0,1,0,0,1,1,1,73,74,42
+0,1,0,1,0,0,1,73,74,42
+0,1,0,1,0,1,1,73,74,42
+0,1,0,1,1,0,1,73,74,42
+0,1,0,1,1,1,1,73,74,42
+0,1,1,0,0,0,1,73,74,42
+0,1,1,0,0,1,1,73,74,42
+0,1,1,0,1,0,1,73,74,42
+0,1,1,0,1,1,1,73,74,42
+0,1,1,1,0,0,1,73,74,42
+0,1,1,1,0,1,1,73,74,42
+0,1,1,1,1,0,1,73,74,42
+0,1,1,1,1,1,1,73,74,42
+1,0,0,0,0,0,-1,73,74,42
+1,0,0,0,0,1,-1,73,74,42
+1,0,0,0,1,0,-1,73,74,42
+1,0,0,0,1,1,-1,73,74,42
+1,0,0,1,0,0,-1,73,74,42
+1,0,0,1,0,1,-1,73,74,42
+1,0,0,1,1,0,-1,73,74,42
+1,0,0,1,1,1,-1,73,74,42
+1,0,1,0,0,0,-1,73,74,42
+1,0,1,0,0,1,-1,73,74,42
+1,0,1,0,1,0,-1,73,74,42
+1,0,1,0,1,1,-1,73,74,42
+1,0,1,1,0,0,-1,73,74,42
+1,0,1,1,0,1,-1,73,74,42
+1,0,1,1,1,0,-1,73,74,42
+1,0,1,1,1,1,-1,73,74,42
+1,1,0,0,0,0,-1,73,74,42
+1,1,0,0,0,1,-1,73,74,42
+1,1,0,0,1,0,-1,73,74,42
+1,1,0,0,1,1,-1,73,74,42
+1,1,0,1,0,0,-1,73,74,42
+1,1,0,1,0,1,-1,73,74,42
+1,1,0,1,1,0,-1,73,74,42
+1,1,0,1,1,1,-1,73,74,42
+1,1,1,0,0,0,-1,73,74,42
+1,1,1,0,0,1,-1,73,74,42
+1,1,1,0,1,0,-1,73,74,42
+1,1,1,0,1,1,-1,73,74,42
+1,1,1,1,0,0,-1,73,74,42
+1,1,1,1,0,1,-1,73,74,42
+1,1,1,1,1,0,-1,73,74,42
+1,1,1,1,1,1,-1,73,74,42
+0,-1,-1,-1,-1,-1,0,73,74,42
\ No newline at end of file
diff --git a/bluetooth_power_limits_redfin_jp.csv b/bluetooth_power_limits_redfin_jp.csv
new file mode 100644
index 0000000..1cd20f5
--- /dev/null
+++ b/bluetooth_power_limits_redfin_jp.csv
@@ -0,0 +1,66 @@
+Head,BTHotspot,WIFI5Ghz,HotspotVoice,BTMedia,Cell,IMU,BluetoothBDRPower,BluetoothEDRPower,BluetoothLEPower
+0,0,0,0,0,0,1,65,64,29
+0,0,0,0,0,1,1,65,64,29
+0,0,0,0,1,0,1,65,64,29
+0,0,0,0,1,1,1,65,64,29
+0,0,0,1,0,0,1,65,64,29
+0,0,0,1,0,1,1,65,64,29
+0,0,0,1,1,0,1,65,64,29
+0,0,0,1,1,1,1,65,64,29
+0,0,1,0,0,0,1,65,64,29
+0,0,1,0,0,1,1,65,64,29
+0,0,1,0,1,0,1,65,64,29
+0,0,1,0,1,1,1,65,64,29
+0,0,1,1,0,0,1,65,64,29
+0,0,1,1,0,1,1,65,64,29
+0,0,1,1,1,0,1,65,64,29
+0,0,1,1,1,1,1,65,64,29
+0,1,0,0,0,0,1,65,64,29
+0,1,0,0,0,1,1,65,64,29
+0,1,0,0,1,0,1,65,64,29
+0,1,0,0,1,1,1,65,64,29
+0,1,0,1,0,0,1,65,64,29
+0,1,0,1,0,1,1,65,64,29
+0,1,0,1,1,0,1,65,64,29
+0,1,0,1,1,1,1,65,64,29
+0,1,1,0,0,0,1,65,64,29
+0,1,1,0,0,1,1,65,64,29
+0,1,1,0,1,0,1,65,64,29
+0,1,1,0,1,1,1,65,64,29
+0,1,1,1,0,0,1,65,64,29
+0,1,1,1,0,1,1,65,64,29
+0,1,1,1,1,0,1,65,64,29
+0,1,1,1,1,1,1,65,64,29
+1,0,0,0,0,0,-1,65,64,29
+1,0,0,0,0,1,-1,65,64,29
+1,0,0,0,1,0,-1,65,64,29
+1,0,0,0,1,1,-1,65,64,29
+1,0,0,1,0,0,-1,65,64,29
+1,0,0,1,0,1,-1,65,64,29
+1,0,0,1,1,0,-1,65,64,29
+1,0,0,1,1,1,-1,65,64,29
+1,0,1,0,0,0,-1,65,64,29
+1,0,1,0,0,1,-1,65,64,29
+1,0,1,0,1,0,-1,65,64,29
+1,0,1,0,1,1,-1,65,64,29
+1,0,1,1,0,0,-1,65,64,29
+1,0,1,1,0,1,-1,65,64,29
+1,0,1,1,1,0,-1,65,64,29
+1,0,1,1,1,1,-1,65,64,29
+1,1,0,0,0,0,-1,65,64,29
+1,1,0,0,0,1,-1,65,64,29
+1,1,0,0,1,0,-1,65,64,29
+1,1,0,0,1,1,-1,65,64,29
+1,1,0,1,0,0,-1,65,64,29
+1,1,0,1,0,1,-1,65,64,29
+1,1,0,1,1,0,-1,65,64,29
+1,1,0,1,1,1,-1,65,64,29
+1,1,1,0,0,0,-1,65,64,29
+1,1,1,0,0,1,-1,65,64,29
+1,1,1,0,1,0,-1,65,64,29
+1,1,1,0,1,1,-1,65,64,29
+1,1,1,1,0,0,-1,65,64,29
+1,1,1,1,0,1,-1,65,64,29
+1,1,1,1,1,0,-1,65,64,29
+1,1,1,1,1,1,-1,65,64,29
+0,-1,-1,-1,-1,-1,0,65,64,29
\ No newline at end of file
diff --git a/bluetooth_power_limits_redfin_us.csv b/bluetooth_power_limits_redfin_us.csv
new file mode 100644
index 0000000..d3be956
--- /dev/null
+++ b/bluetooth_power_limits_redfin_us.csv
@@ -0,0 +1,67 @@
+Head,BTHotspot,WIFI5Ghz,HotspotVoice,BTMedia,Cell,IMU,BluetoothBDRPower,BluetoothEDRPower,BluetoothLEPower
+0,0,0,0,0,0,1,70,71,67
+0,0,0,0,0,1,1,70,71,67
+0,0,0,0,1,0,1,70,71,67
+0,0,0,0,1,1,1,70,71,67
+0,0,0,1,0,0,1,70,71,67
+0,0,0,1,0,1,1,70,71,67
+0,0,0,1,1,0,1,70,71,67
+0,0,0,1,1,1,1,70,71,67
+0,0,1,0,0,0,1,70,71,48
+0,0,1,0,0,1,1,70,71,48
+0,0,1,0,1,0,1,70,71,48
+0,0,1,0,1,1,1,70,71,48
+0,0,1,1,0,0,1,70,71,48
+0,0,1,1,0,1,1,70,71,48
+0,0,1,1,1,0,1,70,71,48
+0,0,1,1,1,1,1,70,71,48
+0,1,0,0,0,0,1,70,71,67
+0,1,0,0,0,1,1,70,71,67
+0,1,0,0,1,0,1,70,71,67
+0,1,0,0,1,1,1,70,71,67
+0,1,0,1,0,0,1,70,71,67
+0,1,0,1,0,1,1,70,71,67
+0,1,0,1,1,0,1,70,71,67
+0,1,0,1,1,1,1,70,71,67
+0,1,1,0,0,0,1,70,71,48
+0,1,1,0,0,1,1,70,71,48
+0,1,1,0,1,0,1,70,71,48
+0,1,1,0,1,1,1,70,71,48
+0,1,1,1,0,0,1,70,71,48
+0,1,1,1,0,1,1,70,71,48
+0,1,1,1,1,0,1,70,71,48
+0,1,1,1,1,1,1,70,71,48
+1,0,0,0,0,0,-1,43,44,43
+1,0,0,0,0,1,-1,43,44,43
+1,0,0,0,1,0,-1,43,44,43
+1,0,0,0,1,1,-1,43,44,43
+1,0,0,1,0,0,-1,43,44,43
+1,0,0,1,0,1,-1,43,44,43
+1,0,0,1,1,0,-1,43,44,43
+1,0,0,1,1,1,-1,43,44,43
+1,0,1,0,0,0,-1,43,44,43
+1,0,1,0,0,1,-1,43,44,43
+1,0,1,0,1,0,-1,43,44,43
+1,0,1,0,1,1,-1,43,44,43
+1,0,1,1,0,0,-1,43,44,43
+1,0,1,1,0,1,-1,43,44,43
+1,0,1,1,1,0,-1,43,44,43
+1,0,1,1,1,1,-1,43,44,43
+1,1,0,0,0,0,-1,43,44,43
+1,1,0,0,0,1,-1,43,44,43
+1,1,0,0,1,0,-1,43,44,43
+1,1,0,0,1,1,-1,43,44,43
+1,1,0,1,0,0,-1,43,44,43
+1,1,0,1,0,1,-1,43,44,43
+1,1,0,1,1,0,-1,43,44,43
+1,1,0,1,1,1,-1,43,44,43
+1,1,1,0,0,0,-1,43,44,43
+1,1,1,0,0,1,-1,43,44,43
+1,1,1,0,1,0,-1,43,44,43
+1,1,1,0,1,1,-1,43,44,43
+1,1,1,1,0,0,-1,43,44,43
+1,1,1,1,0,1,-1,43,44,43
+1,1,1,1,1,0,-1,43,44,43
+1,1,1,1,1,1,-1,43,44,43
+0,-1,0,-1,-1,-1,0,70,71,67
+0,-1,1,-1,-1,-1,0,70,71,48
\ No newline at end of file
diff --git a/device-redfin.mk b/device-redfin.mk
index 06ae9a9..6d72b97 100644
--- a/device-redfin.mk
+++ b/device-redfin.mk
@@ -17,7 +17,11 @@
PRODUCT_HARDWARE := redfin
ifeq ($(TARGET_PREBUILT_KERNEL),)
- LOCAL_KERNEL := device/google/redfin-kernel/Image.lz4
+ ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+ LOCAL_KERNEL := device/google/redfin-kernel/Image.lz4
+ else
+ LOCAL_KERNEL := device/google/redfin-kernel/vintf/Image.lz4
+ endif
else
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
endif
@@ -43,6 +47,7 @@
PRODUCT_COPY_FILES += \
$(foreach f,$(shell find $(LOCAL_PATH)/audio/ -type f -name "mixer_paths*.xml"),$(f):$(TARGET_COPY_OUT_VENDOR)/etc/$(notdir $(f))) \
+ $(LOCAL_PATH)/audio/sound_trigger_mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths.xml \
$(LOCAL_PATH)/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
$(LOCAL_PATH)/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
$(LOCAL_PATH)/audio/audio_policy_configuration_a2dp_offload_disabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_a2dp_offload_disabled.xml \
@@ -112,6 +117,14 @@
PRODUCT_PROPERTY_OVERRIDES += \
vendor.audio.feature.devicestate_listener.enable=true
+# Audio Thermal Listener configuration
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/audio/audio_thermal_listener.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_thermal_listener.xml
+
+# Audio Features
+PRODUCT_PROPERTY_OVERRIDES += \
+ vendor.audio.feature.thermal_listener.enable=true \
+
ifeq ($(wildcard vendor/google_devices/redfin/proprietary/device-vendor-redfin.mk),)
BUILD_WITHOUT_VENDOR := true
endif
@@ -121,7 +134,7 @@
# Vibrator HAL
PRODUCT_PACKAGES += \
- android.hardware.vibrator@1.3-service.redfin
+ android.hardware.vibrator-service.redfin
# DRV2624 Haptics Waveform
PRODUCT_COPY_FILES += \
@@ -129,15 +142,15 @@
# Vibrator HAL
PRODUCT_PRODUCT_PROPERTIES +=\
- ro.vibrator.hal.config.dynamic=1 \
- ro.vibrator.hal.click.duration=8 \
- ro.vibrator.hal.tick.duration=8 \
- ro.vibrator.hal.heavyclick.duration=8 \
- ro.vibrator.hal.short.voltage=161 \
- ro.vibrator.hal.long.voltage=161 \
- ro.vibrator.hal.long.frequency.shift=10 \
- ro.vibrator.hal.steady.shape=1 \
- ro.vibrator.hal.lptrigger=0
+ ro.vendor.vibrator.hal.config.dynamic=1 \
+ ro.vendor.vibrator.hal.click.duration=6 \
+ ro.vendor.vibrator.hal.tick.duration=6 \
+ ro.vendor.vibrator.hal.heavyclick.duration=6 \
+ ro.vendor.vibrator.hal.short.voltage=161 \
+ ro.vendor.vibrator.hal.long.voltage=161 \
+ ro.vendor.vibrator.hal.long.frequency.shift=10 \
+ ro.vendor.vibrator.hal.steady.shape=1 \
+ ro.vendor.vibrator.hal.lptrigger=0
# Dumpstate HAL
PRODUCT_PACKAGES += \
@@ -153,8 +166,7 @@
# Recovery
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/init.recovery.device.rc:recovery/root/init.recovery.redfin.rc \
- $(LOCAL_PATH)/thermal-engine-$(PRODUCT_HARDWARE).conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-$(PRODUCT_HARDWARE).conf
+ $(LOCAL_PATH)/init.recovery.device.rc:recovery/root/init.recovery.redfin.rc
PRODUCT_PACKAGES += \
sensors.$(PRODUCT_HARDWARE) \
@@ -167,15 +179,23 @@
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.hardware.chamber.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(PRODUCT_HARDWARE).chamber.rc
+ PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/init.hardware.wlc.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(PRODUCT_PLATFORM).wlc.rc
endif
+# GPS ANTENNA_INFO configuration file
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/gnss_antenna_info.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss_antenna_info.conf
+
# Audio effects
PRODUCT_PACKAGES += \
libqcomvoiceprocessingdescriptors
# SKU specific RROs
PRODUCT_PACKAGES += \
- SettingsOverlayG5NZ6
+ SettingsOverlayG5NZ6 \
+ SettingsOverlayGD1YQ \
+ SettingsOverlayGTT9Q
# Fingerprint HIDL
include device/google/redfin/fingerprint.mk
@@ -184,7 +204,20 @@
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=80
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_touch_timer_ms=200
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_display_power_timer_ms=1000
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.support_kernel_idle_timer=true
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_content_detection_for_refresh_rate=true
-# Keyboard height ratio
-PRODUCT_PRODUCT_PROPERTIES += ro.com.google.ime.height_ratio=1.2
+PRODUCT_PROPERTY_OVERRIDES += \
+ vendor.display.defer_fps_frame_count=2
+
+# Keyboard height ratio and bottom padding in dp for portrait mode
+PRODUCT_PRODUCT_PROPERTIES += \
+ ro.com.google.ime.height_ratio=1.2 \
+ ro.com.google.ime.kb_pad_port_b=10
+
+# Bluetooth Tx power caps for redfin
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/bluetooth_power_limits_redfin_ROW.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits.csv \
+ $(LOCAL_PATH)/bluetooth_power_limits_redfin_us.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_US.csv \
+ $(LOCAL_PATH)/bluetooth_power_limits_redfin_eu.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_EU.csv \
+ $(LOCAL_PATH)/bluetooth_power_limits_redfin_jp.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_JP.csv
diff --git a/device_framework_matrix.xml b/device_framework_matrix.xml
new file mode 100644
index 0000000..bbba187
--- /dev/null
+++ b/device_framework_matrix.xml
@@ -0,0 +1,10 @@
+<compatibility-matrix version="1.0" type="framework">
+ <hal format="hidl" optional="true">
+ <name>vendor.google.wireless_charger</name>
+ <version>1.2</version>
+ <interface>
+ <name>IWirelessCharger</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</compatibility-matrix>
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index f014f6b..85aa453 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -196,6 +196,9 @@
char* strTmpTime = arrStrTime;
struct pcap_pkthdr pcap_hdr;
while ((strTime = strtok_r(strTmpTime, ".", &strTmpTime))) {
+ if(strTmpTime == NULL) {
+ break;
+ }
time_t time;
struct tm timeStruct;
memset(&timeStruct, 0, sizeof(struct tm));
@@ -205,6 +208,9 @@
pcap_hdr.ts.tv_sec = time;
}
strTimeMsec = strtok_r(strTmpTime, ".", &strTmpTime);
+ if(strTimeMsec == NULL) {
+ break;
+ }
timeMSec = atoi(strTimeMsec);
pcap_hdr.ts.tv_usec = timeMSec;
}
@@ -398,6 +404,13 @@
touch_spi_path, touch_spi_path);
RunCommandToFd(fd, "Force Touch Active", {"/vendor/bin/sh", "-c", cmd});
+ //Change data format from portrait to landscape
+ snprintf(cmd, sizeof(cmd),
+ "echo %s > %s/cmd && cat %s/cmd_result",
+ "set_print_format,1",
+ touch_spi_path, touch_spi_path);
+ RunCommandToFd(fd, "Print Format", {"/vendor/bin/sh", "-c", cmd});
+
//Firmware info
snprintf(cmd, sizeof(cmd), "%s/fw_version", touch_spi_path);
DumpFileToFd(fd, "LSI firmware version", cmd);
@@ -469,6 +482,14 @@
touch_spi_path, touch_spi_path);
RunCommandToFd(fd, "TYPE_NOI_P2P_MAX", {"/vendor/bin/sh", "-c", cmd});
+ //Change data format back to default(portrait)
+ snprintf(cmd, sizeof(cmd),
+ "echo %s > %s/cmd && cat %s/cmd_result",
+ "set_print_format,0",
+ touch_spi_path, touch_spi_path);
+ RunCommandToFd(fd, "Print Format", {"/vendor/bin/sh", "-c", cmd});
+
+
//Disable: force touch active
snprintf(cmd, sizeof(cmd),
"echo %s > %s/cmd && cat %s/cmd_result",
@@ -519,6 +540,11 @@
DumpFileToFd(fd, "UFS Slow IO Unmap", "/sys/devices/platform/soc/" + bootdev + "/slowio_unmap_cnt");
DumpFileToFd(fd, "UFS Slow IO Sync", "/sys/devices/platform/soc/" + bootdev + "/slowio_sync_cnt");
+ RunCommandToFd(fd, "UFS err_stats", {"/vendor/bin/sh", "-c",
+ "path=\"/sys/devices/platform/soc/" + bootdev + "/err_stats\"; "
+ "for node in `ls $path/err_*`; do "
+ "printf \"%s:%d\\n\" $(basename $node) $(cat $node); done;"});
+
RunCommandToFd(fd, "UFS io_stats", {"/vendor/bin/sh", "-c",
"path=\"/sys/devices/platform/soc/" + bootdev + "/io_stats\"; "
"printf \"\\t\\t%-10s %-10s %-10s %-10s %-10s %-10s\\n\" "
@@ -660,21 +686,27 @@
RunCommandToFd(fd, "CPU cpuidle", {"/vendor/bin/sh", "-c", "for cpu in /sys/devices/system/cpu/cpu*; do for d in $cpu/cpuidle/state*; do if [ ! -d $d ]; then continue; fi; echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done; done"});
RunCommandToFd(fd, "Airbrush debug info", {"/vendor/bin/sh", "-c", "for f in `ls /sys/devices/platform/soc/c84000.i2c/i2c-4/4-0066/@(*curr|temperature|vbat|total_power)`; do echo \"$f: `cat $f`\" ; done; file=/d/airbrush/airbrush_sm/chip_state; echo \"$file: `cat $file`\""});
DumpFileToFd(fd, "TCPM logs", "/d/usb/tcpm-usbpd0");
- DumpFileToFd(fd, "PD Engine", "/d/logbuffer/usbpd");
- DumpFileToFd(fd, "PPS", "/d/logbuffer/pps");
- DumpFileToFd(fd, "BMS", "/d/logbuffer/ssoc");
- DumpFileToFd(fd, "smblib", "/d/logbuffer/smblib");
- DumpFileToFd(fd, "WLC logs", "/d/logbuffer/wireless");
- DumpFileToFd(fd, "RTX logs", "/d/logbuffer/rtx");
- DumpFileToFd(fd, "TTF", "/d/logbuffer/ttf");
+ DumpFileToFd(fd, "TCPM logs", "/dev/logbuffer_tcpm");
+ DumpFileToFd(fd, "PD Engine", "/dev/logbuffer_usbpd");
+ DumpFileToFd(fd, "PPS", "/dev/logbuffer_pps");
+ DumpFileToFd(fd, "BMS", "/dev/logbuffer_ssoc");
+ DumpFileToFd(fd, "smblib", "/dev/logbuffer_smblib");
+ DumpFileToFd(fd, "WLC logs", "/dev/logbuffer_wireless");
+ DumpFileToFd(fd, "RTX logs", "/dev/logbuffer_rtx");
+ DumpFileToFd(fd, "TTF", "/dev/logbuffer_ttf");
DumpFileToFd(fd, "TTF details", "/sys/class/power_supply/battery/ttf_details");
DumpFileToFd(fd, "TTF stats", "/sys/class/power_supply/battery/ttf_stats");
DumpFileToFd(fd, "ipc-local-ports", "/d/msm_ipc_router/dump_local_ports");
RunCommandToFd(fd, "USB Device Descriptors", {"/vendor/bin/sh", "-c", "cd /sys/bus/usb/devices/1-1 && cat product && cat bcdDevice; cat descriptors | od -t x1 -w16 -N96"});
RunCommandToFd(fd, "Power supply properties", {"/vendor/bin/sh", "-c", "for f in `ls /sys/class/power_supply/*/uevent` ; do echo \"------ $f\\n`cat $f`\\n\" ; done"});
RunCommandToFd(fd, "PMIC Votables", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/pmic-votable/*/status"});
- RunCommandToFd(fd, "Google Charger", {"/vendor/bin/sh", "-c", "cd /d/google_charger/; for f in `ls pps_*` ; do echo \"$f: `cat $f`\" ; done"});
- RunCommandToFd(fd, "Google Battery", {"/vendor/bin/sh", "-c", "cd /d/google_battery/; for f in `ls ssoc_*` ; do echo \"$f: `cat $f`\" ; done"});
+
+ if (!PropertiesHelper::IsUserBuild()) {
+ RunCommandToFd(fd, "Google Charger", {"/vendor/bin/sh", "-c", "cd /d/google_charger/; for f in `ls pps_*` ; do echo \"$f: `cat $f`\" ; done"});
+ RunCommandToFd(fd, "Google Battery", {"/vendor/bin/sh", "-c", "cd /d/google_battery/; for f in `ls ssoc_*` ; do echo \"$f: `cat $f`\" ; done"});
+ }
+
+ RunCommandToFd(fd, "Battery EEPROM", {"/vendor/bin/sh", "-c", "xxd /sys/devices/platform/soc/98c000.i2c/i2c-1/1-0050/1-00500/nvmem"});
DumpFileToFd(fd, "WLC VER", "/sys/devices/platform/soc/98c000.i2c/i2c-1/1-003b/version");
DumpFileToFd(fd, "WLC STATUS", "/sys/devices/platform/soc/98c000.i2c/i2c-1/1-003b/status");
@@ -697,6 +729,12 @@
// Keep this at the end as very long on not for humans
DumpFileToFd(fd, "WLAN FW Log Symbol Table", "/vendor/firmware/Data.msc");
+ // Dump camera profiler log
+ RunCommandToFd(fd, "Camera Profiler Logs", {"/vendor/bin/sh", "-c", "for f in /data/vendor/camera/profiler/camx_*; do echo [$f]; cat \"$f\";done"});
+
+ // Dump fastrpc dma buffer size
+ DumpFileToFd(fd, "Fastrpc dma buffer", "/sys/kernel/fastrpc/total_dma_kb");
+
if (modemThreadHandle) {
pthread_join(modemThreadHandle, NULL);
}
diff --git a/factory-images/generate-factory-images-package.sh b/factory-images/generate-factory-images-package.sh
new file mode 100755
index 0000000..fad6c0b
--- /dev/null
+++ b/factory-images/generate-factory-images-package.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Copyright 2020 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.
+
+source ../../../common/clear-factory-images-variables.sh
+BUILD=6291635
+DEVICE=redfin
+PRODUCT=redfin
+VERSION=rd1a.200312.002
+SRCPREFIX=signed-
+BOOTLOADER=r3-0.3-6265493
+RADIO=g7250-00014-200305-B-6264959
+source ../../../common/generate-factory-images-common.sh
diff --git a/gnss_antenna_info.conf b/gnss_antenna_info.conf
new file mode 100644
index 0000000..2b5ba03
--- /dev/null
+++ b/gnss_antenna_info.conf
@@ -0,0 +1,126 @@
+###################################
+##### ANTENNA INFORMATION #####
+###################################
+
+###################################
+# ANTENNA INFO VECTOR SIZE
+###################################
+# The number of antenna info
+# structures in the vector. Each
+# entry in this vector is a structure
+# with the following elements:
+#
+# - CARRIER_FREQUENCY
+# - PC_OFFSET
+# - PC_VARIATION_CORRECTION
+# - PC_VARIATION_CORRECTION_UNC
+# - SIGNAL_GAIN_CORRECTION
+# - SIGNAL_GAIN_CORRECTION_UNC
+#
+# Notes:
+# CARRIER_FREQUENCY
+# The carrier frequency in MHz.
+#
+# PC = PHASE CENTER
+# PC_OFFSET is a structure with six
+# elements: x, y, z and their associated uncertainties
+# Phase center offset (PCO) is defined with
+# respect to the origin of the Android sensor coordinate system, e.g.,
+# center of primary screen for mobiles
+#
+# PC_VARIATION_CORRECTION
+# 2D vectors representing the phase center variation (PCV) corrections,
+# in millimeters, at regularly spaced azimuthal angle (theta) and zenith angle
+# (phi). The PCV correction is added to the phase measurement to obtain the
+# corrected value.
+# The azimuthal angle, theta, is defined with respect to the X axis of the
+# Android sensor coordinate system, increasing toward the Y axis. The zenith
+# angle, phi, is defined with respect to the Z axis of the Android Sensor
+# coordinate system, increasing toward the X-Y plane.
+# Each row vector (outer vectors) represents a fixed theta. The first row
+# corresponds to a theta angle of 0 degrees. The last row corresponds to a
+# theta angle of (360 - deltaTheta) degrees, where deltaTheta is the regular
+# spacing between azimuthal angles, i.e., deltaTheta = 360 / (number of rows).
+# The columns (inner vectors) represent fixed zenith angles, beginning at 0
+# degrees and ending at 180 degrees. They are separated by deltaPhi, the regular
+# spacing between zenith angles, i.e., deltaPhi = 180 / (number of columns - 1).
+#
+# PC_VARIATION_CORRECTION_UNC
+# 2D vectors of 1-sigma uncertainty in millimeters associated with the PCV
+# correction values.
+#
+# SIGNAL_GAIN_CORRECTION
+# 2D vectors representing the signal gain corrections at regularly spaced
+# azimuthal angle (theta) and zenith angle (phi). The values are calculated or
+# measured at the antenna feed point without considering the radio and receiver
+# noise figure and path loss contribution, in dBi, i.e., decibel over isotropic
+# antenna with the same total power. The signal gain correction is added the
+# signal gain measurement to obtain the corrected value.
+# The azimuthal angle, theta, is defined with respect to the X axis of the
+# Android sensor coordinate system, increasing toward the Y axis. The zenith
+# angle, phi, is defined with respect to the Z axis of the Android Sensor
+# coordinate system, increasing toward the X-Y plane.
+# Each row vector (outer vectors) represents a fixed theta. The first row
+# corresponds to a theta angle of 0 degrees. The last row corresponds to a
+# theta angle of (360 - deltaTheta) degrees, where deltaTheta is the regular
+# spacing between azimuthal angles, i.e., deltaTheta = 360 / (number of rows).
+# The columns (inner vectors) represent fixed zenith angles, beginning at 0
+# degrees and ending at 180 degrees. They are separated by deltaPhi, the regular
+# spacing between zenith angles, i.e., deltaPhi = 180 / (number of columns - 1).
+#
+# SIGNAL_GAIN_CORRECTION_UNC
+# 2D vectors of 1-sigma uncertainty in dBi associated with the signal
+# gain correction values.
+
+ANTENNA_INFO_VECTOR_SIZE = 2
+
+CARRIER_FREQUENCY_0 = 1575.42
+
+PC_OFFSET_0 = 1.2 0.1 3.4 0.2 5.6 0.3
+
+NUMBER_OF_ROWS_0 = 3
+NUMBER_OF_COLUMNS_0 = 4
+
+PC_VARIATION_CORRECTION_0_ROW_0 = 11.22 33.44 55.66 77.88
+PC_VARIATION_CORRECTION_0_ROW_1 = 10.2 30.4 50.6 70.8
+PC_VARIATION_CORRECTION_0_ROW_2 = 12.2 34.4 56.6 78.8
+
+PC_VARIATION_CORRECTION_UNC_0_ROW_0 = 0.1 0.2 0.3 0.4
+PC_VARIATION_CORRECTION_UNC_0_ROW_1 = 1.1 1.2 1.3 1.4
+PC_VARIATION_CORRECTION_UNC_0_ROW_2 = 2.1 2.2 2.3 2.4
+
+SIGNAL_GAIN_CORRECTION_0_ROW_0 = 9.8 8.7 7.6 6.5
+SIGNAL_GAIN_CORRECTION_0_ROW_1 = 5.4 4.3 3.2 2.1
+SIGNAL_GAIN_CORRECTION_0_ROW_2 = 1.3 2.4 3.5 4.6
+
+SIGNAL_GAIN_CORRECTION_UNC_0_ROW_0 = 0.11 0.22 0.33 0.44
+SIGNAL_GAIN_CORRECTION_UNC_0_ROW_1 = 0.55 0.66 0.77 0.88
+SIGNAL_GAIN_CORRECTION_UNC_0_ROW_2 = 0.91 0.92 0.93 0.94
+
+
+CARRIER_FREQUENCY_1 = 1227.6
+
+PC_OFFSET_1 = 3.4 0.2 5.6 0.3 1.2 0.1
+
+NUMBER_OF_ROWS_1 = 4
+NUMBER_OF_COLUMNS_1 = 2
+
+PC_VARIATION_CORRECTION_1_ROW_0 = 55.66 77.88
+PC_VARIATION_CORRECTION_1_ROW_1 = 11.22 33.44
+PC_VARIATION_CORRECTION_1_ROW_2 = 56.6 78.8
+PC_VARIATION_CORRECTION_1_ROW_3 = 12.2 34.4
+
+PC_VARIATION_CORRECTION_UNC_1_ROW_0 = 0.3 0.4
+PC_VARIATION_CORRECTION_UNC_1_ROW_1 = 1.1 1.2
+PC_VARIATION_CORRECTION_UNC_1_ROW_2 = 2.1 2.2
+PC_VARIATION_CORRECTION_UNC_1_ROW_3 = 0.1 0.2
+
+SIGNAL_GAIN_CORRECTION_1_ROW_0 = 7.6 6.5
+SIGNAL_GAIN_CORRECTION_1_ROW_1 = 5.4 4.3
+SIGNAL_GAIN_CORRECTION_1_ROW_2 = 1.3 2.4
+SIGNAL_GAIN_CORRECTION_1_ROW_3 = 9.8 8.7
+
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_0 = 0.91 0.92
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_1 = 0.55 0.66
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_2 = 0.11 0.22
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_3 = 0.93 0.94
diff --git a/init.hardware.chamber.rc.userdebug b/init.hardware.chamber.rc.userdebug
index ba76a59..2c1df4f 100644
--- a/init.hardware.chamber.rc.userdebug
+++ b/init.hardware.chamber.rc.userdebug
@@ -14,25 +14,41 @@
# limitations under the License.
#
-on property:init.svc.vendor.thermal-engine=running && property:persist.vendor.disable.thermal.control=1
- stop vendor.thermal-engine
-
-on property:init.svc.vendor.thermal-engine=stopped && property:persist.vendor.disable.thermal.control=0
- start vendor.thermal-engine
-
on property:persist.vendor.disable.thermal.control=1
- write /sys/devices/virtual/thermal/tz-by-name/skin-therm-adc/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm/emul_temp 25000
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm-cpu/emul_temp 25000
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm-cpu/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/emul_temp 25000
write /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/emul_temp 25000
+ write /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/cellular-emergency/emul_temp 25000
+ write /sys/devices/virtual/thermal/tz-by-name/cellular-emergency/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/sdm-therm/emul_temp 25000
write /sys/devices/virtual/thermal/tz-by-name/sdm-therm/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-adc/emul_temp 25000
write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-adc/mode disabled
+ write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/emul_temp 25000
write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/mode disabled
write /sys/module/overheat_mitigation/parameters/enable 0
on property:persist.vendor.disable.thermal.control=0
- write /sys/devices/virtual/thermal/tz-by-name/skin-therm-adc/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm/emul_temp 0
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm-cpu/emul_temp 0
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm-cpu/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/emul_temp 0
write /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/emul_temp 0
+ write /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/cellular-emergency/emul_temp 0
+ write /sys/devices/virtual/thermal/tz-by-name/cellular-emergency/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/sdm-therm/emul_temp 0
write /sys/devices/virtual/thermal/tz-by-name/sdm-therm/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-adc/emul_temp 0
write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-adc/mode enabled
+ write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/emul_temp 0
write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/mode enabled
write /sys/module/overheat_mitigation/parameters/enable 1
diff --git a/init.hardware.wlc.rc.userdebug b/init.hardware.wlc.rc.userdebug
new file mode 100644
index 0000000..dee7b6b
--- /dev/null
+++ b/init.hardware.wlc.rc.userdebug
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2018 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.
+#
+
+on property:sys.boot_completed=1 && property:persist.vendor.limit.wlc.current=1
+ write /sys/class/power_supply/dc/current_max 75000
+
+on property:sys.boot_completed=1 && property:persist.vendor.limit.wlc.current=0
+ write /sys/class/power_supply/dc/current_max 1100000
+
+on property:vendor.disable.wlc=1
+ write /sys/class/power_supply/wireless/online 0
diff --git a/init.insmod.redfin.cfg b/init.insmod.redfin.cfg
index ad77b2d..4f65487 100644
--- a/init.insmod.redfin.cfg
+++ b/init.insmod.redfin.cfg
@@ -5,7 +5,8 @@
#############################################
# Load kernel modules
-modprobe|adsp_loader_dlkm.ko apr_dlkm.ko atomic64_test.ko bolero_cdc_dlkm.ko br_netfilter.ko hdmi_dlkm.ko lcd.ko lkdtm.ko llcc_perfmon.ko locktorture.ko machine_dlkm.ko mbhc_dlkm.ko native_dlkm.ko pinctrl_lpi_dlkm.ko platform_dlkm.ko q6_dlkm.ko q6_notifier_dlkm.ko q6_pdr_dlkm.ko rcutorture.ko rx_macro_dlkm.ko snd_event_dlkm.ko stub_dlkm.ko swr_ctrl_dlkm.ko swr_dlkm.ko test_user_copy.ko torture.ko tx_macro_dlkm.ko usf_dlkm.ko va_macro_dlkm.ko wcd938x_dlkm.ko wcd938x_slave_dlkm.ko wcd9xxx_dlkm.ko wcd_core_dlkm.ko wlan.ko wsa881x_dlkm.ko wsa_macro_dlkm.ko heatmap.ko sec_touch.ko drv2624.ko
+modprobe|-b *
+modprobe|sec_touch.ko
# All modules loaded
setprop|vendor.all.modules.ready
@@ -15,4 +16,4 @@
enable|/sys/kernel/boot_cdsp/boot
# All devices enabled
-setporp|vendor.all.devices.ready
+setprop|vendor.all.devices.ready
diff --git a/init.recovery.device.rc b/init.recovery.device.rc
index 72fc15a..474831d 100644
--- a/init.recovery.device.rc
+++ b/init.recovery.device.rc
@@ -12,3 +12,7 @@
# Block layer tuning: discard chunk size up to 128MB
# Otherwise, contiguous discards can be merged
write /sys/block/sda/queue/discard_max_bytes 134217728
+
+on early-init
+ # Wait to make sure we do not try to talk too early to the display
+ wait /sys/class/drm/card0
diff --git a/manifest.xml b/manifest.xml
new file mode 100644
index 0000000..a663664
--- /dev/null
+++ b/manifest.xml
@@ -0,0 +1,39 @@
+<!-- Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<manifest version="1.0" type="device" target-level="5">
+ <kernel target-level="5"/>
+ <hal format="hidl">
+ <name>vendor.google.wireless_charger</name>
+ <transport>hwbinder</transport>
+ <version>1.2</version>
+ <interface>
+ <name>IWirelessCharger</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/redfin/BoardConfig.mk b/redfin/BoardConfig.mk
index 5f08d37..aa3bc5a 100644
--- a/redfin/BoardConfig.mk
+++ b/redfin/BoardConfig.mk
@@ -17,57 +17,13 @@
TARGET_BOOTLOADER_BOARD_NAME := redfin
TARGET_SCREEN_DENSITY := 440
TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165
-
-include device/google/redbull/BoardConfig-common.mk
-include device/google/redfin-sepolicy/redfin-sepolicy.mk
-
-TARGET_BOARD_INFO_FILE := device/google/redfin/board-info.txt
USES_DEVICE_GOOGLE_REDFIN := true
-TARGET_BOARD_COMMON_PATH := device/google/redfin/sm7250
-
-# DTBO partition definitions
-BOARD_PREBUILT_DTBOIMAGE := device/google/redfin-kernel/dtbo.img
-
-TARGET_FS_CONFIG_GEN := device/google/redfin/config.fs
-
-# Kernel modules
-ifeq (,$(filter-out redfin_kasan, $(TARGET_PRODUCT)))
-BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
- $(wildcard device/google/redfin-kernel/kasan/*.ko)
-else ifeq (,$(filter-out redfin_kernel_debug_memory, $(TARGET_PRODUCT)))
-BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
- $(wildcard device/google/redfin-kernel/debug_memory/*.ko)
-else ifeq (,$(filter-out redfin_kernel_debug_locking, $(TARGET_PRODUCT)))
-BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
- $(wildcard device/google/redfin-kernel/debug_locking/*.ko)
-else ifeq (,$(filter-out redfin_kernel_debug_hang, $(TARGET_PRODUCT)))
-BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
- $(wildcard device/google/redfin-kernel/debug_hang/*.ko)
-else ifeq (,$(filter-out redfin_kernel_debug_api, $(TARGET_PRODUCT)))
-BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
- $(wildcard device/google/redfin-kernel/debug_api/*.ko)
-else
-BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
- $(wildcard device/google/redfin-kernel/*.ko)
-endif
-
-# DTB
-ifeq (,$(filter-out redfin_kasan, $(TARGET_PRODUCT)))
-BOARD_PREBUILT_DTBIMAGE_DIR := device/google/redfin-kernel/kasan
-else ifeq (,$(filter-out redfin_kernel_debug_memory, $(TARGET_PRODUCT)))
-BOARD_PREBUILT_DTBIMAGE_DIR := device/google/redfin-kernel/debug_memory
-else ifeq (,$(filter-out redfin_kernel_debug_locking, $(TARGET_PRODUCT)))
-BOARD_PREBUILT_DTBIMAGE_DIR := device/google/redfin-kernel/debug_locking
-else ifeq (,$(filter-out redfin_kernel_debug_hang, $(TARGET_PRODUCT)))
-BOARD_PREBUILT_DTBIMAGE_DIR := device/google/redfin-kernel/debug_hang
-else ifeq (,$(filter-out redfin_kernel_debug_api, $(TARGET_PRODUCT)))
-BOARD_PREBUILT_DTBIMAGE_DIR := device/google/redfin-kernel/debug_api
-else
-BOARD_PREBUILT_DTBIMAGE_DIR := device/google/redfin-kernel
-endif
+include device/google/redbull/BoardConfig-common.mk
+DEVICE_MANIFEST_FILE += device/google/redfin/manifest.xml
+DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += device/google/redfin/device_framework_matrix.xml
# Testing related defines
#BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/r3-setup.sh
--include vendor/google_devices/redfin/proprietary/BoardConfigVendor.mk
+-include vendor/google_devices/$(TARGET_BOOTLOADER_BOARD_NAME)/proprietary/BoardConfigVendor.mk
diff --git a/redfin/init.redfin.rc b/redfin/init.redfin.rc
index 48e4652..e786c18 100644
--- a/redfin/init.redfin.rc
+++ b/redfin/init.redfin.rc
@@ -16,6 +16,14 @@
import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.rc
+on property:graphics.display.kernel_idle_timer.enabled=true
+ # Switch display mode to 60hz when idle
+ write /sys/devices/platform/soc/soc:qcom,dsi-display-primary/idle_mode "@60"
+
+on property:graphics.display.kernel_idle_timer.enabled=false
+ # Disable aggressive idle mode switching
+ write /sys/devices/platform/soc/soc:qcom,dsi-display-primary/idle_mode "none"
+
on property:vendor.all.modules.ready=1
chown system system /sys/devices/virtual/sec/tsp/fw_version
chown system system /sys/devices/virtual/sec/tsp/cmd
@@ -32,6 +40,22 @@
on property:sys.retaildemo.enabled=0
write /sys/class/thermal/cdev-by-name/dc_icl/cur_state 0
+# Toggle glove_mode according to touch_sensitivity_mode
+on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1
+ write /sys/devices/virtual/sec/tsp/cmd "glove_mode,0"
+
+on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1
+ write /sys/devices/virtual/sec/tsp/cmd "glove_mode,1"
+
+# Route touch_sensitivity_mode to persist
+on property:debug.touch_sensitivity_mode=0
+ setprop persist.vendor.touch_sensitivity_mode 0
+
+on property:debug.touch_sensitivity_mode=1
+ setprop persist.vendor.touch_sensitivity_mode 1
+
on late-init
chown system system /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/trip_point_0_temp
chown system system /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/trip_point_0_hyst
+ chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-virt-monitor/trip_point_0_temp
+ chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-virt-monitor/trip_point_0_hyst
diff --git a/redfin/overlay/frameworks/base/core/res/res/values/config.xml b/redfin/overlay/frameworks/base/core/res/res/values/config.xml
index 08a99fc..23cee03 100755
--- a/redfin/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/redfin/overlay/frameworks/base/core/res/res/values/config.xml
@@ -55,6 +55,42 @@
<!-- MMS user agent profile url -->
<string name="config_mms_user_agent_profile_url" translatable="false">http://www.gstatic.com/android/sms/GD1YQ.xml</string>
+ <!-- Array of desired screen brightness in nits corresponding to the lux values
+ in the config_autoBrightnessLevels array. As with config_screenBrightnessMinimumNits and
+ config_screenBrightnessMaximumNits, the display brightness is defined as the measured
+ brightness of an all-white image.
+
+ If this is defined then:
+ - config_autoBrightnessLcdBacklightValues should not be defined
+ - config_screenBrightnessNits must be defined
+ - config_screenBrightnessBacklight must be defined
+
+ This array should have size one greater than the size of the config_autoBrightnessLevels
+ array. The brightness values must be non-negative and non-decreasing. This must be
+ overridden in platform specific overlays -->
+ <array name="config_autoBrightnessDisplayValuesNits">
+ <item>5.139055</item> <!-- 0 - 1 -->
+ <item>9.962018965</item> <!-- 1 - 2 -->
+ <item>18.34822964</item> <!-- 2 - 3 -->
+ <item>21.55068128</item> <!-- 3 - 4 -->
+ <item>24.0167788</item> <!-- 4 - 8 -->
+ <item>30.62162162</item> <!-- 8 - 12 -->
+ <item>35.09486396</item> <!-- 12 - 20 -->
+ <item>41.2249643</item> <!-- 20 - 33 -->
+ <item>47.6760716</item> <!-- 33 - 55 -->
+ <item>55.73002427</item> <!-- 55 - 90 -->
+ <item>66.24126116</item> <!-- 90 - 148 -->
+ <item>79.67614115</item> <!-- 148 - 245 -->
+ <item>98.04727274</item> <!-- 245 - 403 -->
+ <item>125.1221991</item> <!-- 403 - 665 -->
+ <item>161.6875093</item> <!-- 665 - 1097 -->
+ <item>208.4885553</item> <!-- 1097 - 1808 -->
+ <item>264.8221315</item> <!-- 1808 - 2981 -->
+ <item>327.8974352</item> <!-- 2981 - 5000 -->
+ <item>401.1676739</item> <!-- 5000 - 10000 -->
+ <item>600.0</item> <!-- 10000+ -->
+ </array>
+
<!-- Minimum screen brightness allowed by the power manager. -->
<integer name="config_screenBrightnessDim">6</integer>
@@ -64,6 +100,9 @@
<!-- Whether the always on display mode is available. -->
<bool name="config_dozeAlwaysOnDisplayAvailable">true</bool>
+ <!-- Disable AOD by default -->
+ <bool name="config_dozeAlwaysOnEnabled">false</bool>
+
<!-- True if the display hardware only has brightness buckets rather than a full range of
backlight values -->
<bool name="config_displayBrightnessBucketsInDoze">true</bool>
@@ -117,6 +156,13 @@
<!-- Nominal White Z --> <item>1.089366</item>
</string-array>
+ <!-- The default refresh rate. Redfin manages this using the peak refresh rate setting, so set
+ this value to 0 so it has no effect. -->
+ <integer name="config_defaultRefreshRate">0</integer>
+
+ <!-- The default peak refresh rate. -->
+ <integer name="config_defaultPeakRefreshRate">90</integer>
+
<!-- Shutdown if the battery temperature exceeds (this value * 0.1) Celsius. -->
<integer name="config_shutdownBatteryTemperature">600</integer>
@@ -170,10 +216,22 @@
<!-- Height of the status bar in portrait. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
- <dimen name="status_bar_height_portrait">136px</dimen>
+ <dimen name="status_bar_height_portrait">145px</dimen>
<dimen name="status_bar_height_landscape">28dp</dimen>
<!-- Height of area above QQS where battery/time go (equal to status bar) -->
- <dimen name="quick_qs_offset_height">136px</dimen>
- <!-- Total height of QQS (quick_qs_offset_height + 128) -->
- <dimen name="quick_qs_total_height">488px</dimen>
+ <dimen name="quick_qs_offset_height">145px</dimen>
+
+ <!-- Not allow to switch to higher refresh rate when display brightness setting is
+ equal or less than this value -->
+ <integer-array name="config_brightnessThresholdsOfPeakRefreshRate">
+ <item>10</item> <!-- 33% UI brightness -->
+ <item>14</item> <!-- 40% UI brightness -->
+ </integer-array>
+ <integer-array name="config_ambientThresholdsOfPeakRefreshRate">
+ <item>-1</item>
+ <item>20</item>
+ </integer-array>
+
+ <!-- default refresh rate in the zone defined by birghtness and ambient thresholds -->
+ <integer name="config_defaultRefreshRateInZone">90</integer>
</resources>
diff --git a/redfin/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/redfin/overlay/frameworks/base/core/res/res/xml/power_profile.xml
index bb0ea65..9d6bae0 100644
--- a/redfin/overlay/frameworks/base/core/res/res/xml/power_profile.xml
+++ b/redfin/overlay/frameworks/base/core/res/res/xml/power_profile.xml
@@ -169,6 +169,12 @@
<item name="gps.voltage">3700</item>
<!-- Idle Receive current for wifi radio in mA.-->
- <!-- Wifi missing due to bug: (b/149748526) -->
+ <item name="wifi.controller.idle">79</item>
+ <!-- Rx current for wifi radio in mA.-->
+ <item name="wifi.controller.rx">118</item>
+ <!-- Tx current for wifi radio in mA-->
+ <item name="wifi.controller.tx">331</item>
+ <!-- Operating volatage for wifi radio in mV.-->
+ <item name="wifi.controller.voltage">3700</item>
</device>
diff --git a/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml b/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml
index 4b7f416..cbb5426 100644
--- a/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml
+++ b/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml
@@ -12,12 +12,12 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="156px"
- android:height="156px"
- android:viewportWidth="156.0"
- android:viewportHeight="156.0">
+ android:width="180px"
+ android:height="180px"
+ android:viewportWidth="180.0"
+ android:viewportHeight="180.0">
<path
- android:pathData="M 0,0 V 156 C 4,76 5,58 31,31 58,5 76,4 156,0 Z"
+ android:pathData="M 0,0 V 180 C 1.4411876,134 1.505881,127 3.3686813,107.95867 5.0938474,90.32422 8.1241216,73.789162 14.16279,59.944117 20.388815,45.669515 28,36.695738 34.69603,30.211518 45.292279,19.95045 61.154139,9.3642976 83.27273,5.1711125 100,2 116,1 180,0 Z"
android:fillColor="#000000" />
</vector>
diff --git a/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_bottom.xml b/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_bottom.xml
new file mode 100644
index 0000000..e62f04f
--- /dev/null
+++ b/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_bottom.xml
@@ -0,0 +1,23 @@
+<!--
+ Copyright (C) 2020 The Android Open Source Project
+
+ 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="260px"
+ android:height="237px"
+ android:viewportWidth="260.0"
+ android:viewportHeight="237.0">
+
+ <path
+ android:pathData="M259.51,0C226.69,0 180.55,-0.1 147.73,0.89C137.84,1.19 127.96,1.6 118.09,2.3C109.36,2.92 100.68,3.76 92.02,5.14C73.26,8.13 56.11,13.49 40.55,25.27C32.5,31.36 25.5,38.72 19.83,47.06C14.93,54.25 11.23,61.78 8.47,70.03C5.73,78.23 4.15,86.55 3.09,95.11C1.86,105.12 1.33,115.14 0.96,125.21C-0.11,154.31 0,207.89 0,237L0,0L259.51,0Z"
+ android:fillColor="#000000" />
+</vector>
diff --git a/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_top.xml b/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_top.xml
new file mode 100644
index 0000000..a9d8302
--- /dev/null
+++ b/redfin/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_top.xml
@@ -0,0 +1,23 @@
+<!--
+ Copyright (C) 2020 The Android Open Source Project
+
+ 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="216px"
+ android:height="216px"
+ android:viewportWidth="216.0"
+ android:viewportHeight="216.0">
+
+ <path
+ android:pathData="M0,216C0,187.36 -0.13,148.14 1.23,119.51C1.64,110.9 2.2,102.32 3.16,93.76C3.99,86.31 5.11,78.95 6.9,71.65C8.66,64.49 11.01,57.69 14.35,51.09C18.34,43.19 23.47,36.1 29.74,29.84C36,23.58 43.09,18.46 50.99,14.47C57.6,11.14 64.4,8.79 71.56,7.04C78.86,5.25 86.22,4.13 93.68,3.3C102.25,2.34 110.83,1.78 119.44,1.37C148.1,0.01 187.34,0.15 216,0.15L0.07,0L0,216Z"
+ android:fillColor="#000000" />
+</vector>
diff --git a/redfin/overlay/frameworks/base/packages/SystemUI/res/values-land/dimen.xml b/redfin/overlay/frameworks/base/packages/SystemUI/res/values-land/dimens.xml
similarity index 83%
rename from redfin/overlay/frameworks/base/packages/SystemUI/res/values-land/dimen.xml
rename to redfin/overlay/frameworks/base/packages/SystemUI/res/values-land/dimens.xml
index e244502..613aebf 100644
--- a/redfin/overlay/frameworks/base/packages/SystemUI/res/values-land/dimen.xml
+++ b/redfin/overlay/frameworks/base/packages/SystemUI/res/values-land/dimens.xml
@@ -16,10 +16,6 @@
*/
-->
<resources>
- <!-- Landscape, just use the regular values -->
- <dimen name="status_bar_padding_start">8dp</dimen>
- <dimen name="status_bar_padding_end">8dp</dimen>
-
<!-- the padding on the top of the statusbar (usually 0) -->
<dimen name="status_bar_padding_top">0dp</dimen>
</resources>
diff --git a/redfin/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/redfin/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
index 0c6a800..0e34711 100644
--- a/redfin/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
+++ b/redfin/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -30,19 +30,33 @@
brightness, suitable to listen to while the device is asleep (e.g. during
always-on display) -->
<string name="doze_brightness_sensor_type" translatable="false">com.google.sensor.binned_brightness</string>
-
+
<!-- Override value to use for proximity sensor. -->
- <string name="proximity_sensor_type" translatable="false">com.google.sensor.binned_brightness</string>
+ <string name="proximity_sensor_type" translatable="false">android.sensor.light</string>
<!-- If using proximity_sensor_type, specifies a threshold value to distinguish near and
- far break points.-->
- <item name="proximity_sensor_threshold" translatable="false" format="float" type="dimen">1</item>
+ far break points. A sensor value less than this is considered "near". -->
+ <item name="proximity_sensor_threshold" translatable="false" format="float" type="dimen">12</item>
+
+ <!-- If using proximity_sensor_type, specifies a threshold value to distinguish near and
+ far break points. A sensor value more than this is considered "far". If not set,
+ proximity_sensor_threshold is used. This allows one to implement a latching mechanism for
+ noisy sensors. -->
+ <item name="proximity_sensor_threshold_latch" translatable="false" format="float" type="dimen">24</item>
+
+ <string name="proximity_sensor_secondary_type" translatable="false">com.google.sensor.binned_brightness</string>
+ <item name="proximity_sensor_secondary_threshold" translatable="false" format="float"
+ type="dimen">1</item>
+
<!-- Doze: can we assume the pickup sensor includes a proximity check? -->
<bool name="doze_pickup_performs_proximity_check">true</bool>
<!-- Doze: whether the double tap sensor reports 2D touch coordinates -->
<bool name="doze_double_tap_reports_touch_coordinates">true</bool>
+ <!-- Height of the status bar header bar when on Keyguard (match status_bar_portrait) -->
+ <dimen name="status_bar_header_height_keyguard">@*android:dimen/status_bar_height_portrait</dimen>
+
<!-- Doze: Table that translates sensor values from the doze_brightness_sensor_type sensor
to brightness values; -1 means keeping the current brightness. -->
<integer-array name="config_doze_brightness_sensor_to_brightness">
@@ -85,5 +99,9 @@
<!-- Camera 1 is the front camera on bramble -->
<string translatable="false" name="config_protectedCameraId">1</string>
+ <!-- Comma-separated list of packages to exclude from camera protection. In our case,
+ ignore the gaze detection package -->
+ <string translatable="false" name="config_cameraProtectionExcludedPackages">com.google.android.as</string>
+
<bool name="config_enableDisplayCutoutProtection">true</bool>
</resources>
diff --git a/redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimen.xml b/redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
similarity index 88%
rename from redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimen.xml
rename to redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
index bb9b2b8..f5a3f24 100644
--- a/redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimen.xml
+++ b/redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
@@ -16,12 +16,10 @@
*/
-->
<resources>
- <!-- Don't need the left side padding due to being inset from the cutout -->
- <dimen name="status_bar_padding_start">0dp</dimen>
<!-- for 20dp of padding at 3.5px/dp at default density -->
<dimen name="rounded_corner_content_padding">50px</dimen>
<!-- the padding on the top of the statusbar (usually 0) -->
- <dimen name="status_bar_padding_top">1dp</dimen>
+ <dimen name="status_bar_padding_top">2dp</dimen>
<!-- Padding for the system icons on the keyguard (when no multi user switch is showing).
The icons always have a 4dp padding in the container so we only need 56 extra px of padding
for the corners -->
diff --git a/redfin/overlay/packages/apps/Nfc/res/values/config.xml b/redfin/overlay/packages/apps/Nfc/res/values/config.xml
index 99e1df5..f26e67f 100644
--- a/redfin/overlay/packages/apps/Nfc/res/values/config.xml
+++ b/redfin/overlay/packages/apps/Nfc/res/values/config.xml
@@ -15,7 +15,7 @@
-->
<resources>
<bool name="polling_disable_allowed">true</bool>
- <bool name="enable_antenna_blocked_alert">true</bool>
+ <bool name="enable_antenna_blocked_alert">false</bool>
<integer name="max_antenna_blocked_failure_count">10</integer>
<integer name="unknown_tag_polling_delay">2000</integer>
<string name="antenna_blocked_alert_link" translatable="false">https://support.google.com/pixelphone?p=nfc_tag_notification</string>
diff --git a/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/drawable/r3_compensation_image_15k.png b/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/drawable/r3_compensation_image_15k.png
new file mode 100644
index 0000000..4a0b43e
--- /dev/null
+++ b/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/drawable/r3_compensation_image_15k.png
Binary files differ
diff --git a/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/drawable/r3_compensation_image_30k.png b/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/drawable/r3_compensation_image_30k.png
new file mode 100644
index 0000000..62a6136
--- /dev/null
+++ b/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/drawable/r3_compensation_image_30k.png
Binary files differ
diff --git a/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/values/config.xml b/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/values/config.xml
new file mode 100644
index 0000000..ca54c4e
--- /dev/null
+++ b/redfin/overlay/vendor/google_devices/sunfish/proprietary/display/HbmSVManager/res/values/config.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2020, 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.
+*/
+-->
+
+<resources>
+ <array name="config_compensation_thresholds">
+ <item>15000.0</item>
+ <item>30000.0</item>
+ </array>
+
+ <array name="config_compensation_images">
+ <item>@drawable/r3_compensation_image_15k</item>
+ <item>@drawable/r3_compensation_image_30k</item>
+ </array>
+
+ <integer name="config_compensation_filter_horizon">3500</integer>
+</resources>
diff --git a/redfin/overlay_packages/SettingsOverlayG5NZ6/res/drawable/regulatory_info.png b/redfin/overlay_packages/SettingsOverlayG5NZ6/res/drawable/regulatory_info.png
index 40c1ddc..ef5b004 100644
--- a/redfin/overlay_packages/SettingsOverlayG5NZ6/res/drawable/regulatory_info.png
+++ b/redfin/overlay_packages/SettingsOverlayG5NZ6/res/drawable/regulatory_info.png
Binary files differ
diff --git a/redfin/overlay_packages/SettingsOverlayGD1YQ/Android.bp b/redfin/overlay_packages/SettingsOverlayGD1YQ/Android.bp
new file mode 100644
index 0000000..54043e4
--- /dev/null
+++ b/redfin/overlay_packages/SettingsOverlayGD1YQ/Android.bp
@@ -0,0 +1,4 @@
+runtime_resource_overlay {
+ name: "SettingsOverlayGD1YQ",
+ product_specific: true,
+}
diff --git a/redfin/overlay_packages/SettingsOverlayGD1YQ/AndroidManifest.xml b/redfin/overlay_packages/SettingsOverlayGD1YQ/AndroidManifest.xml
new file mode 100644
index 0000000..bd37487
--- /dev/null
+++ b/redfin/overlay_packages/SettingsOverlayGD1YQ/AndroidManifest.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.settings.overlay.gd1yq">
+ <application android:hasCode="false" />
+ <overlay android:targetPackage="com.android.settings"
+ android:requiredSystemPropertyName="ro.boot.hardware.sku"
+ android:requiredSystemPropertyValue="GD1YQ"
+ android:isStatic="true" />
+</manifest>
diff --git a/redfin/overlay_packages/SettingsOverlayGD1YQ/res/drawable/regulatory_info.png b/redfin/overlay_packages/SettingsOverlayGD1YQ/res/drawable/regulatory_info.png
new file mode 100644
index 0000000..540c363
--- /dev/null
+++ b/redfin/overlay_packages/SettingsOverlayGD1YQ/res/drawable/regulatory_info.png
Binary files differ
diff --git a/redfin/overlay_packages/SettingsOverlayGTT9Q/Android.bp b/redfin/overlay_packages/SettingsOverlayGTT9Q/Android.bp
new file mode 100644
index 0000000..814157b
--- /dev/null
+++ b/redfin/overlay_packages/SettingsOverlayGTT9Q/Android.bp
@@ -0,0 +1,4 @@
+runtime_resource_overlay {
+ name: "SettingsOverlayGTT9Q",
+ product_specific: true,
+}
diff --git a/redfin/overlay_packages/SettingsOverlayGTT9Q/AndroidManifest.xml b/redfin/overlay_packages/SettingsOverlayGTT9Q/AndroidManifest.xml
new file mode 100644
index 0000000..7820567
--- /dev/null
+++ b/redfin/overlay_packages/SettingsOverlayGTT9Q/AndroidManifest.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.settings.overlay.gtt9q">
+ <application android:hasCode="false" />
+ <overlay android:targetPackage="com.android.settings"
+ android:requiredSystemPropertyName="ro.boot.hardware.sku"
+ android:requiredSystemPropertyValue="GTT9Q"
+ android:isStatic="true" />
+</manifest>
diff --git a/redfin/overlay_packages/SettingsOverlayGTT9Q/res/drawable/regulatory_info.png b/redfin/overlay_packages/SettingsOverlayGTT9Q/res/drawable/regulatory_info.png
new file mode 100644
index 0000000..9224ad9
--- /dev/null
+++ b/redfin/overlay_packages/SettingsOverlayGTT9Q/res/drawable/regulatory_info.png
Binary files differ
diff --git a/self-extractors/Android.mk b/self-extractors/Android.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/self-extractors/Android.mk
diff --git a/self-extractors/PART1 b/self-extractors/PART1
new file mode 100644
index 0000000..935267e
--- /dev/null
+++ b/self-extractors/PART1
@@ -0,0 +1,12 @@
+#
+# Usage is subject to the enclosed license agreement
+
+echo
+echo The license for this software will now be displayed.
+echo You must agree to this license before using this software.
+echo
+echo -n Press Enter to view the license
+read dummy
+echo
+
+more << __EOF__
diff --git a/self-extractors/PART2 b/self-extractors/PART2
new file mode 100644
index 0000000..30e8d43
--- /dev/null
+++ b/self-extractors/PART2
@@ -0,0 +1,22 @@
+__EOF__
+
+if test $? != 0
+then
+ echo ERROR: Couldn\'t display license file 1>&2
+ exit 1
+fi
+
+echo
+
+echo -n Type \"I ACCEPT\" if you agree to the terms of the license:\
+read typed
+
+if test "$typed" != I\ ACCEPT
+then
+ echo
+ echo You didn\'t accept the license. Extraction aborted.
+ exit 2
+fi
+
+echo
+
diff --git a/self-extractors/PART3 b/self-extractors/PART3
new file mode 100644
index 0000000..6847be5
--- /dev/null
+++ b/self-extractors/PART3
@@ -0,0 +1,12 @@
+
+if test $? != 0
+then
+ echo
+ echo ERROR: Couldn\'t extract files. 1>&2
+ exit 3
+else
+ echo
+ echo Files extracted successfully.
+fi
+exit 0
+
diff --git a/self-extractors/PROLOGUE b/self-extractors/PROLOGUE
new file mode 100644
index 0000000..c856ef1
--- /dev/null
+++ b/self-extractors/PROLOGUE
@@ -0,0 +1,2 @@
+#!/bin/bash
+#
diff --git a/self-extractors/extract-lists.txt b/self-extractors/extract-lists.txt
new file mode 100644
index 0000000..5bcef9e
--- /dev/null
+++ b/self-extractors/extract-lists.txt
@@ -0,0 +1,55 @@
+ google_devices)
+ TO_EXTRACT="\
+ IMAGES/vendor.img \
+ RADIO/bootloader.img \
+ RADIO/radio.img \
+ "
+ ;;
+ qcom)
+ TO_EXTRACT="\
+ system_ext/etc/permissions/com.qualcomm.qcrilmsgtunnel.xml \
+ system_ext/etc/permissions/org_codeaurora_ims.xml \
+ system_ext/etc/permissions/qcrilhook.xml \
+ system_ext/etc/permissions/telephonyservice.xml \
+ system_ext/framework/com.qualcomm.qti.imscmservice-V2.0-java.jar \
+ system_ext/framework/com.qualcomm.qti.imscmservice-V2.1-java.jar \
+ system_ext/framework/com.qualcomm.qti.imscmservice-V2.2-java.jar \
+ system_ext/framework/com.qualcomm.qti.uceservice-V2.0-java.jar \
+ system_ext/framework/com.qualcomm.qti.uceservice-V2.1-java.jar \
+ system_ext/framework/ConnectivityExt.jar \
+ system_ext/framework/qcrilhook.jar \
+ system_ext/framework/qti-telephony-hidl-wrapper.jar \
+ system_ext/framework/qti-telephony-utils.jar \
+ system_ext/framework/remotesimlockmanagerlibrary.jar \
+ system_ext/framework/uimremotesimlocklibrary.jar \
+ system_ext/framework/vendor.qti.hardware.data.connection-V1.0-java.jar \
+ system_ext/framework/vendor.qti.hardware.data.dynamicdds-V1.0-java.jar \
+ system_ext/framework/vendor.qti.hardware.data.iwlan-V1.0-java.jar \
+ system_ext/framework/vendor.qti.hardware.data.latency-V1.0-java.jar \
+ system_ext/framework/vendor.qti.hardware.fingerprint-V1.0-java.jar \
+ system_ext/framework/vendor.qti.ims.callinfo-V1.0-java.jar \
+ system_ext/framework/vendor.qti.ims.rcsconfig-V1.0-java.jar \
+ system_ext/framework/vendor.qti.latency-V2.0-java.jar \
+ system_ext/framework/vendor.qti.voiceprint-V1.0-java.jar \
+ system_ext/lib64/libhoaeffects_csim.so \
+ system_ext/lib64/libimscamera_jni.so \
+ system_ext/lib64/libimsmedia_jni.so \
+ system_ext/lib64/lib-imsvideocodec.so \
+ system_ext/lib64/liblistensoundmodel2.qti.so \
+ system_ext/lib64/libmmosal.so \
+ system_ext/lib64/libvr_amb_engine.so \
+ system_ext/lib64/libvr_object_engine.so \
+ system_ext/lib/libhoaeffects_csim.so \
+ system_ext/lib/libimscamera_jni.so \
+ system_ext/lib/libimsmedia_jni.so \
+ system_ext/lib/lib-imsvideocodec.so \
+ system_ext/lib/liblistensoundmodel2.qti.so \
+ system_ext/lib/libmmosal.so \
+ system_ext/lib/libqct_resampler.so \
+ system_ext/lib/libvr_amb_engine.so \
+ system_ext/lib/libvr_object_engine.so \
+ system_ext/app/QtiTelephonyService/QtiTelephonyService.apk \
+ system_ext/priv-app/ims/ims.apk \
+ system_ext/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk \
+ "
+ ;;
diff --git a/self-extractors/google_devices/COPYRIGHT b/self-extractors/google_devices/COPYRIGHT
new file mode 100644
index 0000000..db593ae
--- /dev/null
+++ b/self-extractors/google_devices/COPYRIGHT
@@ -0,0 +1 @@
+# (C) Google Inc.
diff --git a/self-extractors/google_devices/LICENSE b/self-extractors/google_devices/LICENSE
new file mode 100644
index 0000000..6b4042b
--- /dev/null
+++ b/self-extractors/google_devices/LICENSE
@@ -0,0 +1,264 @@
+THIS DEVELOPER SOFTWARE LICENSE AGREEMENT (THE "AGREEMENT") IS A LEGALLY
+BINDING AGREEMENT BETWEEN Google Inc. ("LICENSOR") AND
+YOU OR THE LEGAL ENTITY YOU REPRESENT ("You" or its possessive, "Your"). BY
+TYPING "I ACCEPT" WHERE INDICATED YOU ACKNOWLEDGE THAT YOU HAVE READ THIS
+AGREEMENT, UNDERSTAND IT AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS.
+IF YOU DO NOT AGREE TO THESE TERMS YOU MUST DISCONTINUE THE INSTALLATION
+PROCESS AND YOU SHALL NOT USE THE SOFTWARE OR RETAIN ANY COPIES OF THE
+SOFTWARE OR DOCUMENTATION. ANY USE OR POSSESSION OF THE SOFTWARE BY YOU IS
+SUBJECT TO THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT. IF THE
+SOFTWARE IS INSTALLED ON A COMPUTER OWNED BY A CORPORATION OR OTHER LEGAL
+ENTITY, THEN YOU REPRESENT AND WARRANT THAT YOU HAVE THE AUTHORITY TO BIND
+SUCH ENTITY TO THE TERMS AND CONDITIONS OF THIS AGREEMENT.
+
+ 1. Special Definitions
+
+ a. The term "Android" means the open source mobile platform, software
+ stack, operating system, middleware, application programming
+ interfaces and mobile applications under the trade-name "Android"
+ distributed at Android.com.
+
+ b. The term "Android Applications" means a software application or
+ open-source contribution developed by You, designed to operate with
+ Android that does not contain or incorporate any of the Software.
+
+ c. The term "Authorized Android Enabled Device" means only the device
+ identified on the site from which You downloaded the Software.
+ The term "Software" means the Licensor's proprietary software and
+ libraries in object code form, designed for use on the Authorized
+ Android Enabled Device.
+
+ d. The term "Authorized Android Enabled Device Software" means a
+ packaged build for Authorized Android Enabled Devices, consisting
+ of files suitable for installation on an Authorized Android Enabled
+ Device using a mechanism such as fastboot mode or recovery mode.
+
+ 2. License Grant
+
+ a. Subject to the terms of this Agreement, Licensor hereby grants to
+ You, free of charge, a non-exclusive, non-sublicensable,
+ non-transferable, limited copyright license, during the term of
+ this Agreement, to download, install and use the Software
+ internally in machine-readable (i.e., object code) form and the
+ Documentation for non-commercial use on an Authorized Android
+ Enabled Device and non-commercial redistribution for academic
+ purposes only of a reasonable number of copies of the Authorized
+ Android Enabled Device Software (the "Limited Purpose"). You may
+ grant your end users the right to use the Software for
+ non-commercial purposes on an Authorized Android Enabled Device.
+ The license to the Software granted to You hereunder is solely for
+ the Limited Purpose set forth in this section, and the Software
+ shall not be used for any other purpose.
+
+ 3. Restrictions
+
+ a. Retention of Rights. The entire right, title and interest in the
+ Software shall remain with Licensor and, unless specified in
+ writing hereunder, no rights are granted to any of the Software.
+ Except for the right to use the Software for the Limited Purpose,
+ the delivery of the Software to You does not convey to You any
+ intellectual property rights in the Software, including, but not
+ limited to any rights under any patent, trademark, copyright, or
+ trade secret. Neither the delivery of the Software to You nor any
+ terms set forth herein shall be construed to grant to You, either
+ expressly, by implication or by way of estoppel, any license under
+ any patents or other intellectual property rights covering or
+ relating to any other product or invention or any combination of
+ the Software with any other product. Any rights not expressly
+ granted to You herein are reserved by Licensor.
+
+ b. No Commercialization or Distribution of the Software and
+ Documentation. Except as expressly provided in Section 2 of this
+ Agreement, You shall have no right to (i) copy, disclose,
+ distribute, publically perform, publically display, transfer,
+ alter, modify, translate, disassemble, decompile, reverse engineer,
+ or adapt the Software and Documentation, or any portion thereof, or
+ create any derivative works based thereon; (ii) rent, lease,
+ assign, sublicense, resell, disclose or otherwise transfer the
+ Software and Documentation in whole or in part to any third party
+ (iii) use the Software and Documentation except for the Limited
+ Purpose, (iv) remove or alter any of the copyright or proprietary
+ notices contained in any of the Software and Documentation. For the
+ purposes of clarity, nothing in this Agreement prohibits You from
+ making and distributing Android Applications under commercial or
+ non-commercial terms, provided that You shall not contain,
+ incorporate, and/or compile the Software or any of its derivative
+ works, in whole or in part, into Your Android Applications and/or
+ any software/devices created by You or by third parties acting on
+ Your behalf. You and any such third party shall comply with all of
+ the terms and conditions of this Agreement.
+
+ c. No Reverse Engineering. Except for any portions of the Software
+ provided to You in source code format and except for any third
+ party code distributed with the Software that is licensed under
+ contrary terms, You will not reverse engineer, disassemble,
+ decompile, or translate the Software, or otherwise attempt to
+ derive the source code version of the Software, except if and to
+ the extent expressly permitted under any applicable law.
+
+ d. Third Party Software. You agree that Android may contain third
+ party software. You agree that you may not distribute such third
+ party software for any purpose without appropriate licenses from
+ the applicable third party or parties.
+
+ e. No Transfer or Assignment. You shall not assign any of its rights
+ or obligations under this Agreement. Any attempted assignment in
+ contravention of this Section shall be void.
+
+ f. Licensor shall retain all title, ownership and Intellectual
+ Property Rights in and to the Software and any derivative thereof.
+ "Intellectual Property Rights" shall mean all patent, copyright,
+ trade secret, trademark and other proprietary and intellectual
+ property rights, including moral rights.
+
+ g. Neither this Agreement, nor any act by Licensor or its Affiliates
+ persuant to this Agreement or relating to the Software (including,
+ without limitation, the provision by Licensor or its Affiliates of
+ the Software) shall provide to You any license or any other rights
+ whatsoever under any patents, trademarks, trade secrets, copyrights
+ or any other intellectual property rights of Licensor or its
+ Affiliates, except for the copyrights expressly set forth in this
+ Agreement. You understand and agree that:
+
+ h. Neither this Agreement, nor delivery of the Software alone or in
+ combination with any Licensor ASIC grants you any right to
+ practice, or any other right at all with respect to, any patent of
+ Licensor or its Affiliates, and
+
+ i. A separating license agreement from Motorola Incorporated is needed
+ to use or practice any patent of Licensor or its Affiliates.
+
+ j. You agree not to contend in any context that, as a result of the
+ provision or use of this software, either Licensor or Affiliate has
+ any obligation to extend, or Licensor or any other party has
+ obtained any right to, any license, whether express or implied,
+ with respect to any patent of Licensor or its Affiliates for any
+ purpose. For the purposes of this agreement, "Affiliate" means
+ (i) any corporation or any other legal entity that owns, directly
+ or indirectly, more than fifty percent (50%) of the shares, equity
+ interest or other securities of any entity entitled to vote for
+ election of directors (or other managing authority), or (ii) any
+ corporation or any other legal entity fifty percent (50%) or more
+ of whose shares, equity interest, or other securities entitled to
+ vote for election of directors (or other managing authority) is
+ owned or controlled by an entity, either directly or indirectly.
+
+ 4. Indemnity
+
+ a. You agree to indemnify and hold harmless Licensor, Google, and
+ their officers, directors, customers, employees and successors and
+ assigns (each an "Indemnified Party") against any and all claims,
+ demands, causes of action, losses, liabilities, damages, costs and
+ expenses, incurred by the Indemnified Party (including but not
+ limited to costs of defense, investigation and reasonable
+ attorney's fees) arising out of, resulting from or related to
+ (i) any software, products, documentation, content, materials or
+ derivative works created or developed by You using the Software
+ which causes an infringement of any patent, copyright, trademark,
+ trade secret, or other property, publicity or privacy rights of any
+ third parties arising in any jurisdiction anywhere in the world,
+ (ii) the download, distribution, installation, storage, execution,
+ use or transfer of such software, products, documentation, content,
+ materials or derivative works by any person or entity, and/or
+ (iii) any breach of this Agreement by You. If requested by an
+ Indemnified Party, You agree to defend such Indemnified Party in
+ connection with any third party claims, demands, or causes of
+ action resulting from, arising out of or in connection with any of
+ the foregoing.
+
+ 5. Limitation of Liability
+
+ a. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, UNDER NO
+ CIRCUMSTANCES, INCLUDING WITHOUT LIMITATION NEGLIGENCE, SHALL
+ LICENSOR, GOOGLE, THEIR AFFILIATES AND/OR ITS DIRECTORS, OFFICERS,
+ EMPLOYEES OR AGENTS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
+ SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT
+ LIMITED TO DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
+ INTERRUPTION, LOSS OF BUSINESS INFORMATION AND THE LIKE) ARISING
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ANY DOWNLOAD,
+ INSTALLATION OR USE OF, OR INABILITY TO USE, THE SOFTWARE, EVEN IF
+ LICENSOR OR GOOGLE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OR
+ EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES SO
+ THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY OR MAY BE LIMITED.
+ IN NO EVENT SHALL LICENSOR'S OR GOOGLE'S TOTAL AGGREGATE LIABILITY
+ TO YOU FOR ANY AND ALL DAMAGES, LOSSES, CLAIMS AND CAUSES OF
+ ACTIONS (WHETHER IN CONTRACT, TORT, INCLUDING NEGLIGENCE,
+ INDEMNIFICATION OR OTHERWISE) EXCEED ONE HUNDRED U.S. DOLLARS
+ (US$100). THE LIMITATIONS SET FORTH IN THIS PARAGRAPH SHALL BE
+ DEEMED TO APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
+ THE PARTIES HAVE FULLY CONSIDERED THE FOREGOING ALLOCATION OF RISK
+ AND FIND IT REASONABLE, AND THAT THE FOREGOING LIMITATIONS IN THIS
+ PARAGRAPH ARE AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN THE
+ PARTIES.
+
+ 6. No Warranty
+
+ a. LICENSOR AND GOOGLE MAKE NO WARRANTIES, EXPRESS OR IMPLIED, WITH
+ RESPECT TO THE SOFTWARE AND DOCUMENTATION PROVIDED UNDER THIS
+ AGREEMENT, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR AGAINST
+ INFRINGEMENT, OR ANY EXPRESS OR IMPLIED WARRANTY ARISING OUT OF
+ TRADE USAGE OR OUT OF A COURSE OF DEALING OR COURSE OF PERFORMANCE.
+ NOTHING CONTAINED IN THIS AGREEMENT SHALL BE CONSTRUED AS A
+ WARRANTY OR REPRESENTATION BY LICENSOR (I) AS TO THE VALIDITY OR
+ SCOPE OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT
+ AND (II) THAT ANY MANUFACTURE OR USE WILL BE FREE FROM INFRINGEMENT
+ OF PATENTS, COPYRIGHTS OR OTHER INTELLECTUAL PROPERTY RIGHTS OF
+ OTHERS, AND IT SHALL BE THE SOLE RESPONSIBILITY OF YOU TO MAKE SUCH
+ DETERMINATION AS IS NECESSARY WITH RESPECT TO THE ACQUISITION OF
+ LICENSES UNDER PATENTS AND OTHER INTELLECTUAL PROPERTY OF THIRD
+ PARTIES. LICENSOR AND GOOGLE SHALL NOT HAVE ANY OBLIGATION TO
+ PROVIDE ANY TECHNICAL SUPPORT OF THE SOFTWARE UNDER THIS AGREEMENT.
+
+ 7. Term and Termination
+
+ a. This Agreement shall be effective on the date You accept this
+ Agreement and shall remain in effect until terminated as provided
+ herein. You may terminate the Agreement at any time by deleting and
+ destroying all copies of the Software and all related information
+ in Your possession or control. This Agreement terminates
+ immediately and automatically, with or without notice, if You fail
+ to comply with any provision hereof. Additionally, Licensor may at
+ any time terminate this Agreement, without cause, upon notice to
+ You. Upon termination You must delete or destroy all copies of the
+ Software in Your possession, and the license granted to You in this
+ Agreement shall terminate. Sections 3, 4, 5, 6 and 8 shall survive
+ the termination of this Agreement.
+
+ 8. Miscellaneous
+
+ a. Governing Law. This Agreement is governed and interpreted in
+ accordance with the laws of the State of California without giving
+ effect to its conflict of laws provisions. The United Nations
+ Convention on Contracts for the International Sale of Goods is
+ expressly disclaimed and shall not apply. Any claim arising out of
+ or related to this Agreement must be brought exclusively in a
+ federal or state court located in Santa Clara County, California
+ and You consent to the jurisdiction and venue of such courts.
+
+ b. Waiver and Severability. The failure of either party to require
+ performance by the other party of any provision of this Agreement
+ shall not affect the full right to require such performance at any
+ time thereafter; nor shall the waiver by either party of a breach
+ of any provision of this Agreement be taken or held to be a waiver
+ of the provision itself. Severability. If any provision of this
+ Agreement is unenforceable or invalid under any applicable law or
+ is so held by applicable court decision, such unenforceability or
+ invalidity shall not render this Agreement unenforceable or invalid
+ as a whole, and such provision shall be changed and interpreted so
+ as to best accomplish the objectives of such unenforceable or
+ invalid provision within the limits of applicable law or
+ applicable court decisions.
+
+ c. Amendment and Modification. This Agreement and any of its terms and
+ provisions may only be amended, modified, supplemented or waived in
+ a writing signed by both parties hereto.
+
+ d. Compliance with Laws. You shall comply with all applicable laws,
+ rules, and regulations in connection with its activities under this
+ Agreement.
+
+ e. Entire Agreement. This Agreement completely and exclusively states
+ the agreement between You and Licensor regarding this subject
+ matter.
diff --git a/self-extractors/google_devices/staging/Android.mk b/self-extractors/google_devices/staging/Android.mk
new file mode 100644
index 0000000..fc42116
--- /dev/null
+++ b/self-extractors/google_devices/staging/Android.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2020 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+ifneq ($(filter redfin,$(TARGET_DEVICE)),)
+ $(call add-radio-file,bootloader.img)
+ $(call add-radio-file,radio.img)
+endif
diff --git a/self-extractors/google_devices/staging/BoardConfigPartial.mk b/self-extractors/google_devices/staging/BoardConfigPartial.mk
new file mode 100644
index 0000000..a7261ff
--- /dev/null
+++ b/self-extractors/google_devices/staging/BoardConfigPartial.mk
@@ -0,0 +1,23 @@
+# Copyright 2020 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.
+
+BOARD_PREBUILT_VENDORIMAGE := vendor/google_devices/redfin/proprietary/vendor.img
+
+AB_OTA_PARTITIONS += \
+ vendor
+
+-include vendor/google/tools/android-info.mk
+ifdef USE_ANDROID_INFO
+ TARGET_BOARD_INFO_FILE := vendor/google_devices/redfin/android-info.txt
+endif
diff --git a/self-extractors/google_devices/staging/device-partial.mk b/self-extractors/google_devices/staging/device-partial.mk
new file mode 100644
index 0000000..2945de8
--- /dev/null
+++ b/self-extractors/google_devices/staging/device-partial.mk
@@ -0,0 +1,13 @@
+# Copyright 2020 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.
diff --git a/self-extractors/qcom/COPYRIGHT b/self-extractors/qcom/COPYRIGHT
new file mode 100644
index 0000000..0adeb31
--- /dev/null
+++ b/self-extractors/qcom/COPYRIGHT
@@ -0,0 +1 @@
+# (C) Qualcomm Technologies, Inc.
diff --git a/self-extractors/qcom/LICENSE b/self-extractors/qcom/LICENSE
new file mode 100644
index 0000000..cef517c
--- /dev/null
+++ b/self-extractors/qcom/LICENSE
@@ -0,0 +1,264 @@
+THIS DEVELOPER SOFTWARE LICENSE AGREEMENT (THE "AGREEMENT") IS A LEGALLY
+BINDING AGREEMENT BETWEEN Qualcomm Technologies, Inc. ("LICENSOR") AND
+YOU OR THE LEGAL ENTITY YOU REPRESENT ("You" or its possessive, "Your"). BY
+TYPING "I ACCEPT" WHERE INDICATED YOU ACKNOWLEDGE THAT YOU HAVE READ THIS
+AGREEMENT, UNDERSTAND IT AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS.
+IF YOU DO NOT AGREE TO THESE TERMS YOU MUST DISCONTINUE THE INSTALLATION
+PROCESS AND YOU SHALL NOT USE THE SOFTWARE OR RETAIN ANY COPIES OF THE
+SOFTWARE OR DOCUMENTATION. ANY USE OR POSSESSION OF THE SOFTWARE BY YOU IS
+SUBJECT TO THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT. IF THE
+SOFTWARE IS INSTALLED ON A COMPUTER OWNED BY A CORPORATION OR OTHER LEGAL
+ENTITY, THEN YOU REPRESENT AND WARRANT THAT YOU HAVE THE AUTHORITY TO BIND
+SUCH ENTITY TO THE TERMS AND CONDITIONS OF THIS AGREEMENT.
+
+ 1. Special Definitions
+
+ a. The term "Android" means the open source mobile platform, software
+ stack, operating system, middleware, application programming
+ interfaces and mobile applications under the trade-name "Android"
+ distributed at Android.com.
+
+ b. The term "Android Applications" means a software application or
+ open-source contribution developed by You, designed to operate with
+ Android that does not contain or incorporate any of the Software.
+
+ c. The term "Authorized Android Enabled Device" means only the device
+ identified on the site from which You downloaded the Software.
+ The term "Software" means the Licensor's proprietary software and
+ libraries in object code form, designed for use on the Authorized
+ Android Enabled Device.
+
+ d. The term "Authorized Android Enabled Device Software" means a
+ packaged build for Authorized Android Enabled Devices, consisting
+ of files suitable for installation on an Authorized Android Enabled
+ Device using a mechanism such as fastboot mode or recovery mode.
+
+ 2. License Grant
+
+ a. Subject to the terms of this Agreement, Licensor hereby grants to
+ You, free of charge, a non-exclusive, non-sublicensable,
+ non-transferable, limited copyright license, during the term of
+ this Agreement, to download, install and use the Software
+ internally in machine-readable (i.e., object code) form and the
+ Documentation for non-commercial use on an Authorized Android
+ Enabled Device and non-commercial redistribution for academic
+ purposes only of a reasonable number of copies of the Authorized
+ Android Enabled Device Software (the "Limited Purpose"). You may
+ grant your end users the right to use the Software for
+ non-commercial purposes on an Authorized Android Enabled Device.
+ The license to the Software granted to You hereunder is solely for
+ the Limited Purpose set forth in this section, and the Software
+ shall not be used for any other purpose.
+
+ 3. Restrictions
+
+ a. Retention of Rights. The entire right, title and interest in the
+ Software shall remain with Licensor and, unless specified in
+ writing hereunder, no rights are granted to any of the Software.
+ Except for the right to use the Software for the Limited Purpose,
+ the delivery of the Software to You does not convey to You any
+ intellectual property rights in the Software, including, but not
+ limited to any rights under any patent, trademark, copyright, or
+ trade secret. Neither the delivery of the Software to You nor any
+ terms set forth herein shall be construed to grant to You, either
+ expressly, by implication or by way of estoppel, any license under
+ any patents or other intellectual property rights covering or
+ relating to any other product or invention or any combination of
+ the Software with any other product. Any rights not expressly
+ granted to You herein are reserved by Licensor.
+
+ b. No Commercialization or Distribution of the Software and
+ Documentation. Except as expressly provided in Section 2 of this
+ Agreement, You shall have no right to (i) copy, disclose,
+ distribute, publically perform, publically display, transfer,
+ alter, modify, translate, disassemble, decompile, reverse engineer,
+ or adapt the Software and Documentation, or any portion thereof, or
+ create any derivative works based thereon; (ii) rent, lease,
+ assign, sublicense, resell, disclose or otherwise transfer the
+ Software and Documentation in whole or in part to any third party
+ (iii) use the Software and Documentation except for the Limited
+ Purpose, (iv) remove or alter any of the copyright or proprietary
+ notices contained in any of the Software and Documentation. For the
+ purposes of clarity, nothing in this Agreement prohibits You from
+ making and distributing Android Applications under commercial or
+ non-commercial terms, provided that You shall not contain,
+ incorporate, and/or compile the Software or any of its derivative
+ works, in whole or in part, into Your Android Applications and/or
+ any software/devices created by You or by third parties acting on
+ Your behalf. You and any such third party shall comply with all of
+ the terms and conditions of this Agreement.
+
+ c. No Reverse Engineering. Except for any portions of the Software
+ provided to You in source code format and except for any third
+ party code distributed with the Software that is licensed under
+ contrary terms, You will not reverse engineer, disassemble,
+ decompile, or translate the Software, or otherwise attempt to
+ derive the source code version of the Software, except if and to
+ the extent expressly permitted under any applicable law.
+
+ d. Third Party Software. You agree that Android may contain third
+ party software. You agree that you may not distribute such third
+ party software for any purpose without appropriate licenses from
+ the applicable third party or parties.
+
+ e. No Transfer or Assignment. You shall not assign any of its rights
+ or obligations under this Agreement. Any attempted assignment in
+ contravention of this Section shall be void.
+
+ f. Licensor shall retain all title, ownership and Intellectual
+ Property Rights in and to the Software and any derivative thereof.
+ "Intellectual Property Rights" shall mean all patent, copyright,
+ trade secret, trademark and other proprietary and intellectual
+ property rights, including moral rights.
+
+ g. Neither this Agreement, nor any act by Licensor or its Affiliates
+ persuant to this Agreement or relating to the Software (including,
+ without limitation, the provision by Licensor or its Affiliates of
+ the Software) shall provide to You any license or any other rights
+ whatsoever under any patents, trademarks, trade secrets, copyrights
+ or any other intellectual property rights of Licensor or its
+ Affiliates, except for the copyrights expressly set forth in this
+ Agreement. You understand and agree that:
+
+ h. Neither this Agreement, nor delivery of the Software alone or in
+ combination with any Licensor ASIC grants you any right to
+ practice, or any other right at all with respect to, any patent of
+ Licensor or its Affiliates, and
+
+ i. A separating license agreement from Qualcomm Incorporated is needed
+ to use or practice any patent of Licensor or its Affiliates.
+
+ j. You agree not to contend in any context that, as a result of the
+ provision or use of this software, either Licensor or Affiliate has
+ any obligation to extend, or Licensor or any other party has
+ obtained any right to, any license, whether express or implied,
+ with respect to any patent of Licensor or its Affiliates for any
+ purpose. For the purposes of this agreement, "Affiliate" means
+ (i) any corporation or any other legal entity that owns, directly
+ or indirectly, more than fifty percent (50%) of the shares, equity
+ interest or other securities of any entity entitled to vote for
+ election of directors (or other managing authority), or (ii) any
+ corporation or any other legal entity fifty percent (50%) or more
+ of whose shares, equity interest, or other securities entitled to
+ vote for election of directors (or other managing authority) is
+ owned or controlled by an entity, either directly or indirectly.
+
+ 4. Indemnity
+
+ a. You agree to indemnify and hold harmless Licensor, Google, and
+ their officers, directors, customers, employees and successors and
+ assigns (each an "Indemnified Party") against any and all claims,
+ demands, causes of action, losses, liabilities, damages, costs and
+ expenses, incurred by the Indemnified Party (including but not
+ limited to costs of defense, investigation and reasonable
+ attorney's fees) arising out of, resulting from or related to
+ (i) any software, products, documentation, content, materials or
+ derivative works created or developed by You using the Software
+ which causes an infringement of any patent, copyright, trademark,
+ trade secret, or other property, publicity or privacy rights of any
+ third parties arising in any jurisdiction anywhere in the world,
+ (ii) the download, distribution, installation, storage, execution,
+ use or transfer of such software, products, documentation, content,
+ materials or derivative works by any person or entity, and/or
+ (iii) any breach of this Agreement by You. If requested by an
+ Indemnified Party, You agree to defend such Indemnified Party in
+ connection with any third party claims, demands, or causes of
+ action resulting from, arising out of or in connection with any of
+ the foregoing.
+
+ 5. Limitation of Liability
+
+ a. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, UNDER NO
+ CIRCUMSTANCES, INCLUDING WITHOUT LIMITATION NEGLIGENCE, SHALL
+ LICENSOR, GOOGLE, THEIR AFFILIATES AND/OR ITS DIRECTORS, OFFICERS,
+ EMPLOYEES OR AGENTS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
+ SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT
+ LIMITED TO DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
+ INTERRUPTION, LOSS OF BUSINESS INFORMATION AND THE LIKE) ARISING
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ANY DOWNLOAD,
+ INSTALLATION OR USE OF, OR INABILITY TO USE, THE SOFTWARE, EVEN IF
+ LICENSOR OR GOOGLE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OR
+ EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES SO
+ THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY OR MAY BE LIMITED.
+ IN NO EVENT SHALL LICENSOR'S OR GOOGLE'S TOTAL AGGREGATE LIABILITY
+ TO YOU FOR ANY AND ALL DAMAGES, LOSSES, CLAIMS AND CAUSES OF
+ ACTIONS (WHETHER IN CONTRACT, TORT, INCLUDING NEGLIGENCE,
+ INDEMNIFICATION OR OTHERWISE) EXCEED ONE HUNDRED U.S. DOLLARS
+ (US$100). THE LIMITATIONS SET FORTH IN THIS PARAGRAPH SHALL BE
+ DEEMED TO APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
+ THE PARTIES HAVE FULLY CONSIDERED THE FOREGOING ALLOCATION OF RISK
+ AND FIND IT REASONABLE, AND THAT THE FOREGOING LIMITATIONS IN THIS
+ PARAGRAPH ARE AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN THE
+ PARTIES.
+
+ 6. No Warranty
+
+ a. LICENSOR AND GOOGLE MAKE NO WARRANTIES, EXPRESS OR IMPLIED, WITH
+ RESPECT TO THE SOFTWARE AND DOCUMENTATION PROVIDED UNDER THIS
+ AGREEMENT, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR AGAINST
+ INFRINGEMENT, OR ANY EXPRESS OR IMPLIED WARRANTY ARISING OUT OF
+ TRADE USAGE OR OUT OF A COURSE OF DEALING OR COURSE OF PERFORMANCE.
+ NOTHING CONTAINED IN THIS AGREEMENT SHALL BE CONSTRUED AS A
+ WARRANTY OR REPRESENTATION BY LICENSOR (I) AS TO THE VALIDITY OR
+ SCOPE OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT
+ AND (II) THAT ANY MANUFACTURE OR USE WILL BE FREE FROM INFRINGEMENT
+ OF PATENTS, COPYRIGHTS OR OTHER INTELLECTUAL PROPERTY RIGHTS OF
+ OTHERS, AND IT SHALL BE THE SOLE RESPONSIBILITY OF YOU TO MAKE SUCH
+ DETERMINATION AS IS NECESSARY WITH RESPECT TO THE ACQUISITION OF
+ LICENSES UNDER PATENTS AND OTHER INTELLECTUAL PROPERTY OF THIRD
+ PARTIES. LICENSOR AND GOOGLE SHALL NOT HAVE ANY OBLIGATION TO
+ PROVIDE ANY TECHNICAL SUPPORT OF THE SOFTWARE UNDER THIS AGREEMENT.
+
+ 7. Term and Termination
+
+ a. This Agreement shall be effective on the date You accept this
+ Agreement and shall remain in effect until terminated as provided
+ herein. You may terminate the Agreement at any time by deleting and
+ destroying all copies of the Software and all related information
+ in Your possession or control. This Agreement terminates
+ immediately and automatically, with or without notice, if You fail
+ to comply with any provision hereof. Additionally, Licensor may at
+ any time terminate this Agreement, without cause, upon notice to
+ You. Upon termination You must delete or destroy all copies of the
+ Software in Your possession, and the license granted to You in this
+ Agreement shall terminate. Sections 3, 4, 5, 6 and 8 shall survive
+ the termination of this Agreement.
+
+ 8. Miscellaneous
+
+ a. Governing Law. This Agreement is governed and interpreted in
+ accordance with the laws of the State of California without giving
+ effect to its conflict of laws provisions. The United Nations
+ Convention on Contracts for the International Sale of Goods is
+ expressly disclaimed and shall not apply. Any claim arising out of
+ or related to this Agreement must be brought exclusively in a
+ federal or state court located in Santa Clara County, California
+ and You consent to the jurisdiction and venue of such courts.
+
+ b. Waiver and Severability. The failure of either party to require
+ performance by the other party of any provision of this Agreement
+ shall not affect the full right to require such performance at any
+ time thereafter; nor shall the waiver by either party of a breach
+ of any provision of this Agreement be taken or held to be a waiver
+ of the provision itself. Severability. If any provision of this
+ Agreement is unenforceable or invalid under any applicable law or
+ is so held by applicable court decision, such unenforceability or
+ invalidity shall not render this Agreement unenforceable or invalid
+ as a whole, and such provision shall be changed and interpreted so
+ as to best accomplish the objectives of such unenforceable or
+ invalid provision within the limits of applicable law or
+ applicable court decisions.
+
+ c. Amendment and Modification. This Agreement and any of its terms and
+ provisions may only be amended, modified, supplemented or waived in
+ a writing signed by both parties hereto.
+
+ d. Compliance with Laws. You shall comply with all applicable laws,
+ rules, and regulations in connection with its activities under this
+ Agreement.
+
+ e. Entire Agreement. This Agreement completely and exclusively states
+ the agreement between You and Licensor regarding this subject
+ matter.
diff --git a/self-extractors/qcom/staging/Android.bp.txt b/self-extractors/qcom/staging/Android.bp.txt
new file mode 100644
index 0000000..bce9641
--- /dev/null
+++ b/self-extractors/qcom/staging/Android.bp.txt
@@ -0,0 +1,322 @@
+// Copyright (C) 2020 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.
+
+soong_namespace {
+}
+
+cc_prebuilt_library_shared {
+ name: "libhoaeffects_csim",
+ arch: {
+ arm: {
+ srcs: ["libhoaeffects_csim.so"],
+ shared_libs: [
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/libhoaeffects_csim.so"],
+ shared_libs: [
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "libimscamera_jni",
+ arch: {
+ arm: {
+ srcs: ["libimscamera_jni.so"],
+ shared_libs: [
+ "libnativehelper",
+ "libcutils",
+ "libutils",
+ "liblog",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/libimscamera_jni.so"],
+ shared_libs: [
+ "libnativehelper",
+ "libcutils",
+ "libutils",
+ "liblog",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "libimsmedia_jni",
+ arch: {
+ arm: {
+ srcs: ["libimsmedia_jni.so"],
+ shared_libs: [
+ "libnativehelper",
+ "libcutils",
+ "libutils",
+ "libgui",
+ "libbinder",
+ "liblog",
+ "libandroid",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/libimsmedia_jni.so"],
+ shared_libs: [
+ "libnativehelper",
+ "libcutils",
+ "libutils",
+ "libgui",
+ "libbinder",
+ "liblog",
+ "libandroid",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "lib-imsvideocodec",
+ arch: {
+ arm: {
+ srcs: ["lib-imsvideocodec.so"],
+ shared_libs: [
+ // "lib-imsvtutils",
+ // "lib-imsvtextutils",
+ "libcutils",
+ "libutils",
+ "liblog",
+ // "libdiag_system",
+ "libgui",
+ "libandroid",
+ "libnativewindow",
+ "libmediandk",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/lib-imsvideocodec.so"],
+ shared_libs: [
+ // "lib-imsvtutils",
+ // "lib-imsvtextutils",
+ "libcutils",
+ "libutils",
+ "liblog",
+ // "libdiag_system",
+ "libgui",
+ "libandroid",
+ "libnativewindow",
+ "libmediandk",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+ check_elf_files: false,
+}
+
+cc_prebuilt_library_shared {
+ name: "liblistensoundmodel2.qti",
+ arch: {
+ arm: {
+ srcs: ["liblistensoundmodel2.qti.so"],
+ shared_libs: [
+ "libcutils",
+ "liblog",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/liblistensoundmodel2.qti.so"],
+ shared_libs: [
+ "libcutils",
+ "liblog",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "libmmosal",
+ arch: {
+ arm: {
+ srcs: ["libmmosal.so"],
+ shared_libs: [
+ "libutils",
+ "libcutils",
+ "liblog",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/libmmosal.so"],
+ shared_libs: [
+ "libutils",
+ "libcutils",
+ "liblog",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "libqct_resampler",
+ arch: {
+ arm: {
+ srcs: ["libqct_resampler.so"],
+ shared_libs: [
+ "libcutils",
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "32",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "libvr_amb_engine",
+ arch: {
+ arm: {
+ srcs: ["libvr_amb_engine.so"],
+ shared_libs: [
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/libvr_amb_engine.so"],
+ shared_libs: [
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "libvr_object_engine",
+ arch: {
+ arm: {
+ srcs: ["libvr_object_engine.so"],
+ shared_libs: [
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ arm64: {
+ srcs: ["lib64/libvr_object_engine.so"],
+ shared_libs: [
+ "libc++",
+ "libc",
+ "libm",
+ "libdl",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ system_ext_specific: true,
+ strip: {
+ none: true,
+ },
+}
diff --git a/self-extractors/qcom/staging/Android.mk b/self-extractors/qcom/staging/Android.mk
new file mode 100644
index 0000000..4cb9aec
--- /dev/null
+++ b/self-extractors/qcom/staging/Android.mk
@@ -0,0 +1,41 @@
+LOCAL_PATH := $(call my-dir)
+
+ifneq ($(filter redfin, $(TARGET_DEVICE)),)
+include $(CLEAR_VARS)
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_MODULE := ims
+LOCAL_MODULE_TAGS := optional
+LOCAL_BUILT_MODULE_STEM := package.apk
+LOCAL_SYSTEM_EXT_MODULE := true
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_MODULE_OWNER := qcom
+LOCAL_MODULE_CLASS := APPS
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
+LOCAL_CERTIFICATE := platform
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_MODULE := qcrilmsgtunnel
+LOCAL_MODULE_TAGS := optional
+LOCAL_BUILT_MODULE_STEM := package.apk
+LOCAL_SYSTEM_EXT_MODULE := true
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_MODULE_OWNER := qcom
+LOCAL_MODULE_CLASS := APPS
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
+LOCAL_CERTIFICATE := platform
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_MODULE := QtiTelephonyService
+LOCAL_MODULE_TAGS := optional
+LOCAL_BUILT_MODULE_STEM := package.apk
+LOCAL_SYSTEM_EXT_MODULE := true
+LOCAL_MODULE_OWNER := qcom
+LOCAL_MODULE_CLASS := APPS
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
+LOCAL_CERTIFICATE := platform
+include $(BUILD_PREBUILT)
+endif
diff --git a/self-extractors/qcom/staging/BoardConfigPartial.mk b/self-extractors/qcom/staging/BoardConfigPartial.mk
new file mode 100644
index 0000000..e880ec9
--- /dev/null
+++ b/self-extractors/qcom/staging/BoardConfigPartial.mk
@@ -0,0 +1,15 @@
+# Copyright 2020 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.
+
+VENDOR_BLOBS_LICENSE := vendor/qcom/redfin/LICENSE
diff --git a/self-extractors/qcom/staging/device-partial.mk b/self-extractors/qcom/staging/device-partial.mk
new file mode 100644
index 0000000..7c0806d
--- /dev/null
+++ b/self-extractors/qcom/staging/device-partial.mk
@@ -0,0 +1,60 @@
+# Copyright 2020 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.
+
+PRODUCT_SOONG_NAMESPACES += \
+ vendor/qcom/redfin/proprietary \
+
+# AOSP packages required by the blobs
+PRODUCT_PACKAGES := \
+ ims \
+ qcrilmsgtunnel \
+ QtiTelephonyService
+
+PRODUCT_PACKAGES += \
+ libhoaeffects_csim \
+ libimscamera_jni \
+ libimsmedia_jni \
+ lib-imsvideocodec \
+ liblistensoundmodel2.qti \
+ libmmosal \
+ libqct_resampler \
+ libvr_amb_engine \
+ libvr_object_engine \
+
+# blob(s) necessary for redfin hardware
+PRODUCT_COPY_FILES := \
+ vendor/qcom/redfin/proprietary/com.qualcomm.qcrilmsgtunnel.xml:system_ext/etc/permissions/com.qualcomm.qcrilmsgtunnel.xml \
+ vendor/qcom/redfin/proprietary/org_codeaurora_ims.xml:system_ext/etc/permissions/org_codeaurora_ims.xml \
+ vendor/qcom/redfin/proprietary/qcrilhook.xml:system_ext/etc/permissions/qcrilhook.xml \
+ vendor/qcom/redfin/proprietary/telephonyservice.xml:system_ext/etc/permissions/telephonyservice.xml \
+ vendor/qcom/redfin/proprietary/com.qualcomm.qti.imscmservice-V2.0-java.jar:system_ext/framework/com.qualcomm.qti.imscmservice-V2.0-java.jar \
+ vendor/qcom/redfin/proprietary/com.qualcomm.qti.imscmservice-V2.1-java.jar:system_ext/framework/com.qualcomm.qti.imscmservice-V2.1-java.jar \
+ vendor/qcom/redfin/proprietary/com.qualcomm.qti.imscmservice-V2.2-java.jar:system_ext/framework/com.qualcomm.qti.imscmservice-V2.2-java.jar \
+ vendor/qcom/redfin/proprietary/com.qualcomm.qti.uceservice-V2.0-java.jar:system_ext/framework/com.qualcomm.qti.uceservice-V2.0-java.jar \
+ vendor/qcom/redfin/proprietary/com.qualcomm.qti.uceservice-V2.1-java.jar:system_ext/framework/com.qualcomm.qti.uceservice-V2.1-java.jar \
+ vendor/qcom/redfin/proprietary/ConnectivityExt.jar:system_ext/framework/ConnectivityExt.jar \
+ vendor/qcom/redfin/proprietary/qcrilhook.jar:system_ext/framework/qcrilhook.jar \
+ vendor/qcom/redfin/proprietary/qti-telephony-hidl-wrapper.jar:system_ext/framework/qti-telephony-hidl-wrapper.jar \
+ vendor/qcom/redfin/proprietary/qti-telephony-utils.jar:system_ext/framework/qti-telephony-utils.jar \
+ vendor/qcom/redfin/proprietary/remotesimlockmanagerlibrary.jar:system_ext/framework/remotesimlockmanagerlibrary.jar \
+ vendor/qcom/redfin/proprietary/uimremotesimlocklibrary.jar:system_ext/framework/uimremotesimlocklibrary.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.hardware.data.connection-V1.0-java.jar:system_ext/framework/vendor.qti.hardware.data.connection-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.hardware.data.dynamicdds-V1.0-java.jar:system_ext/framework/vendor.qti.hardware.data.dynamicdds-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.hardware.data.iwlan-V1.0-java.jar:system_ext/framework/vendor.qti.hardware.data.iwlan-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.hardware.data.latency-V1.0-java.jar:system_ext/framework/vendor.qti.hardware.data.latency-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.hardware.fingerprint-V1.0-java.jar:system_ext/framework/vendor.qti.hardware.fingerprint-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.ims.callinfo-V1.0-java.jar:system_ext/framework/vendor.qti.ims.callinfo-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.ims.rcsconfig-V1.0-java.jar:system_ext/framework/vendor.qti.ims.rcsconfig-V1.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.latency-V2.0-java.jar:system_ext/framework/vendor.qti.latency-V2.0-java.jar \
+ vendor/qcom/redfin/proprietary/vendor.qti.voiceprint-V1.0-java.jar:system_ext/framework/vendor.qti.voiceprint-V1.0-java.jar \
diff --git a/self-extractors/root/android-info.txt b/self-extractors/root/android-info.txt
new file mode 100644
index 0000000..a9887f3
--- /dev/null
+++ b/self-extractors/root/android-info.txt
@@ -0,0 +1,6 @@
+require board=redfin
+
+require version-bootloader=r3-0.3-6353611
+
+
+require version-baseband=g7250-00035-200330-B-6346209
diff --git a/self-extractors/root/proprietary/BoardConfigVendor.mk b/self-extractors/root/proprietary/BoardConfigVendor.mk
new file mode 100644
index 0000000..3db23cb
--- /dev/null
+++ b/self-extractors/root/proprietary/BoardConfigVendor.mk
@@ -0,0 +1,18 @@
+# Copyright 2020 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.
+
+LOCAL_STEM := redfin/BoardConfigPartial.mk
+
+-include vendor/google_devices/$(LOCAL_STEM)
+-include vendor/qcom/$(LOCAL_STEM)
diff --git a/self-extractors/root/proprietary/device-vendor.mk b/self-extractors/root/proprietary/device-vendor.mk
new file mode 100644
index 0000000..4fc6a83
--- /dev/null
+++ b/self-extractors/root/proprietary/device-vendor.mk
@@ -0,0 +1,18 @@
+# Copyright 2020 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.
+
+LOCAL_STEM := redfin/device-partial.mk
+
+$(call inherit-product-if-exists, vendor/google_devices/$(LOCAL_STEM))
+$(call inherit-product-if-exists, vendor/qcom/$(LOCAL_STEM))
diff --git a/thermal_info_config_redfin.json b/thermal_info_config_redfin.json
index b1ce5bd..d828587 100644
--- a/thermal_info_config_redfin.json
+++ b/thermal_info_config_redfin.json
@@ -204,8 +204,8 @@
41.0,
43.0,
45.0,
- 49.0,
- 53.0
+ 51.0,
+ 55.0
],
"HotHysteresis":[
0.0,
@@ -218,10 +218,36 @@
],
"VrThreshold":"NAN",
"Multiplier":0.001,
+ "Monitor":true,
+ "SendPowerHint":true
+ },
+ {
+ "Name":"cellular-emergency",
+ "Type":"POWER_AMPLIFIER",
+ "HotThreshold":[
+ "NAN",
+ "NAN",
+ "NAN",
+ "NAN",
+ "NAN",
+ "53.0",
+ "NAN"
+ ],
+ "HotHysteresis":[
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.9,
+ 0.0
+ ],
+ "VrThreshold":"NAN",
+ "Multiplier":0.001,
"Monitor":true
},
{
- "Name":"usbc-therm-monitor",
+ "Name":"usbc-virt-monitor",
"Type":"USB_PORT",
"HotThreshold":[
"NAN",
@@ -229,7 +255,7 @@
"NAN",
"NAN",
"NAN",
- "70.0",
+ "15.0",
"NAN"
],
"HotHysteresis":[
diff --git a/usb/Usb.cpp b/usb/Usb.cpp
index cd0005d..a727c89 100644
--- a/usb/Usb.cpp
+++ b/usb/Usb.cpp
@@ -17,6 +17,7 @@
#define LOG_TAG "android.hardware.usb@1.2-service.redfin"
#include <android-base/logging.h>
+#include <android-base/properties.h>
#include <assert.h>
#include <dirent.h>
#include <pthread.h>
@@ -35,6 +36,8 @@
#include "Usb.h"
+using android::base::GetProperty;
+
namespace android {
namespace hardware {
namespace usb {
@@ -46,6 +49,8 @@
constexpr char kEnabledPath[] = "/sys/class/power_supply/usb/moisture_detection_enabled";
constexpr char kDetectedPath[] = "/sys/class/power_supply/usb/moisture_detected";
+constexpr char kConsole[] = "init.svc.console";
+constexpr char kDisableContatminantDetection[] = "vendor.usb.contaminantdisable";
void queryVersionHelper(android::hardware::usb::V1_2::implementation::Usb *usb,
hidl_vec<PortStatus> *currentPortStatus_1_2);
@@ -129,7 +134,13 @@
Return<void> Usb::enableContaminantPresenceDetection(const hidl_string & /*portName*/,
bool enable) {
- writeFile(kEnabledPath, enable ? "1" : "0");
+
+ std::string status = GetProperty(kConsole, "");
+ std::string disable = GetProperty(kDisableContatminantDetection, "");
+
+ if (status != "running" && disable != "true")
+ writeFile(kEnabledPath, enable ? "1" : "0");
+
hidl_vec<PortStatus> currentPortStatus_1_2;
queryVersionHelper(this, ¤tPortStatus_1_2);
diff --git a/usb/android.hardware.usb@1.2-service.redfin.rc b/usb/android.hardware.usb@1.2-service.redfin.rc
index d9c4946..5e5077f 100644
--- a/usb/android.hardware.usb@1.2-service.redfin.rc
+++ b/usb/android.hardware.usb@1.2-service.redfin.rc
@@ -1,7 +1,13 @@
service vendor.usb-hal-1-2 /vendor/bin/hw/android.hardware.usb@1.2-service.redfin
class hal
+ user system
+ group system shell mtp
+
+service init-gadgethal-sh /vendor/bin/init.gadgethal.sh
+ class hal
user root
- group root system shell mtp
+ disabled
+ oneshot
on boot
chown root system /sys/class/typec/port0/power_role
diff --git a/vibrator/common/Android.bp b/vibrator/common/Android.bp
deleted file mode 100644
index 477aa05..0000000
--- a/vibrator/common/Android.bp
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// 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.
-
-cc_library {
- name: "PixelVibratorCommonRedfin",
- 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
deleted file mode 100644
index f868b6a..0000000
--- a/vibrator/common/HardwareBase.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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 <cutils/properties.h>
-#include <log/log.h>
-
-#include <fstream>
-#include <sstream>
-
-#include "utils.h"
-
-namespace android {
-namespace hardware {
-namespace vibrator {
-namespace common {
-namespace implementation {
-
-HwApiBase::HwApiBase() {
- mPathPrefix = std::getenv("HWAPI_PATH_PREFIX") ?: "";
- if (mPathPrefix.empty()) {
- ALOGE("Failed get HWAPI path prefix!");
- }
-}
-
-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<struct context *>(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 implementation
-} // namespace common
-} // namespace vibrator
-} // namespace hardware
-} // namespace android
diff --git a/vibrator/common/HardwareBase.h b/vibrator/common/HardwareBase.h
deleted file mode 100644
index 8bd1577..0000000
--- a/vibrator/common/HardwareBase.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * 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.
- */
-#ifndef ANDROID_HARDWARE_VIBRATOR_HARDWARE_BASE_H
-#define ANDROID_HARDWARE_VIBRATOR_HARDWARE_BASE_H
-
-#include <android-base/unique_fd.h>
-#include <log/log.h>
-#include <sys/epoll.h>
-#include <utils/Trace.h>
-
-#include <list>
-#include <map>
-#include <sstream>
-#include <string>
-
-#include "utils.h"
-
-namespace android {
-namespace hardware {
-namespace vibrator {
-namespace common {
-namespace implementation {
-
-using base::unique_fd;
-
-class HwApiBase {
- private:
- using NamesMap = std::map<const std::ios *, std::string>;
-
- class RecordInterface {
- public:
- virtual std::string toString(const NamesMap &names) = 0;
- virtual ~RecordInterface() {}
- };
- template <typename T>
- class Record : public RecordInterface {
- public:
- Record(const char *func, const T &value, const std::ios *stream)
- : mFunc(func), mValue(value), mStream(stream) {}
- std::string toString(const NamesMap &names) override;
-
- private:
- const char *mFunc;
- const T mValue;
- const std::ios *mStream;
- };
- using Records = std::list<std::unique_ptr<RecordInterface>>;
-
- static constexpr uint32_t RECORDS_SIZE = 32;
-
- public:
- HwApiBase();
- void debug(int fd);
-
- protected:
- template <typename T>
- void open(const std::string &name, T *stream);
- template <typename T>
- void openFull(const std::string &name, T *stream);
- bool has(const std::ios &stream);
- template <typename T>
- bool get(T *value, std::istream *stream);
- template <typename T>
- bool set(const T &value, std::ostream *stream);
- template <typename T>
- bool poll(const T &value, std::istream *stream);
- template <typename T>
- void record(const char *func, const T &value, const std::ios *stream);
-
- private:
- std::string mPathPrefix;
- NamesMap mNames;
- Records mRecords{RECORDS_SIZE};
- std::mutex mRecordsMutex;
-};
-
-#define HWAPI_RECORD(args...) HwApiBase::record(__FUNCTION__, ##args)
-
-template <typename T>
-void HwApiBase::open(const std::string &name, T *stream) {
- mNames[stream] = name;
- utils::openNoCreate(mPathPrefix + name, stream);
-}
-
-template <typename T>
-void HwApiBase::openFull(const std::string &name, T *stream) {
- mNames[stream] = name;
- utils::openNoCreate(name, stream);
-}
-
-template <typename T>
-bool HwApiBase::get(T *value, std::istream *stream) {
- ATRACE_NAME("HwApi::get");
- bool ret;
- stream->seekg(0);
- *stream >> *value;
- if (!(ret = !!*stream)) {
- ALOGE("Failed to read %s (%d): %s", mNames[stream].c_str(), errno, strerror(errno));
- }
- stream->clear();
- HWAPI_RECORD(*value, stream);
- return ret;
-}
-
-template <typename T>
-bool HwApiBase::set(const T &value, std::ostream *stream) {
- ATRACE_NAME("HwApi::set");
- using utils::operator<<;
- bool ret;
- *stream << value << std::endl;
- if (!(ret = !!*stream)) {
- ALOGE("Failed to write %s (%d): %s", mNames[stream].c_str(), errno, strerror(errno));
- stream->clear();
- }
- HWAPI_RECORD(value, stream);
- return ret;
-}
-
-template <typename T>
-bool HwApiBase::poll(const T &value, std::istream *stream) {
- ATRACE_NAME("HwApi::poll");
- auto path = mPathPrefix + mNames[stream];
- unique_fd fileFd{::open(path.c_str(), O_RDONLY)};
- unique_fd epollFd{epoll_create(1)};
- epoll_event event = {
- .events = EPOLLPRI | EPOLLET,
- };
- T actual;
- bool ret;
-
- if (epoll_ctl(epollFd, EPOLL_CTL_ADD, fileFd, &event)) {
- ALOGE("Failed to poll %s (%d): %s", mNames[stream].c_str(), errno, strerror(errno));
- return false;
- }
-
- while ((ret = get(&actual, stream)) && (actual != value)) {
- epoll_wait(epollFd, &event, 1, -1);
- }
-
- HWAPI_RECORD(value, stream);
- return ret;
-}
-
-template <typename T>
-void HwApiBase::record(const char *func, const T &value, const std::ios *stream) {
- std::lock_guard<std::mutex> lock(mRecordsMutex);
- mRecords.emplace_back(std::make_unique<Record<T>>(func, value, stream));
- mRecords.pop_front();
-}
-
-template <typename T>
-std::string HwApiBase::Record<T>::toString(const NamesMap &names) {
- using utils::operator<<;
- std::stringstream ret;
-
- ret << mFunc << " '" << names.at(mStream) << "' = '" << mValue << "'";
-
- return ret.str();
-}
-
-class HwCalBase {
- public:
- HwCalBase();
- void debug(int fd);
-
- protected:
- template <typename T>
- bool getProperty(const char *key, T *value, const T defval);
- template <typename T>
- bool getPersist(const char *key, T *value);
-
- private:
- std::string mPropertyPrefix;
- std::map<std::string, std::string> mCalData;
-};
-
-template <typename T>
-bool HwCalBase::getProperty(const char *key, T *outval, const T defval) {
- ATRACE_NAME("HwCal::getProperty");
- *outval = utils::getProperty(mPropertyPrefix + key, defval);
- return true;
-}
-
-template <typename T>
-bool HwCalBase::getPersist(const char *key, T *value) {
- ATRACE_NAME("HwCal::getPersist");
- auto it = mCalData.find(key);
- if (it == mCalData.end()) {
- ALOGE("Missing %s config!", key);
- return false;
- }
- std::stringstream stream{it->second};
- utils::unpack(stream, value);
- if (!stream || !stream.eof()) {
- ALOGE("Invalid %s config!", key);
- return false;
- }
- return true;
-}
-
-} // namespace implementation
-} // namespace common
-} // namespace vibrator
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_VIBRATOR_HARDWARE_BASE_H
diff --git a/vibrator/common/TEST_MAPPING b/vibrator/common/TEST_MAPPING
deleted file mode 100644
index c0e8e98..0000000
--- a/vibrator/common/TEST_MAPPING
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "postsubmit": [
- {
- "name": "VibratorHalIntegrationBenchmark"
- },
- {
- "name": "VibratorHalIntegrationBenchmark",
- "keywords": [
- "primary-device"
- ]
- }
- ]
-}
diff --git a/vibrator/common/bench/Android.bp b/vibrator/common/bench/Android.bp
deleted file mode 100644
index 8df1d8d..0000000
--- a/vibrator/common/bench/Android.bp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// 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.
-
-cc_benchmark {
- name: "VibratorHalIntegrationBenchmarkRedfin",
- defaults: ["hidl_defaults"],
- srcs: [
- "benchmark.cpp",
- ],
- shared_libs: [
- "android.hardware.vibrator@1.0",
- "android.hardware.vibrator@1.1",
- "android.hardware.vibrator@1.2",
- "android.hardware.vibrator@1.3",
- "libhardware",
- "libhidlbase",
- "libutils",
- ],
- test_suites: ["device-tests"],
-}
diff --git a/vibrator/common/bench/benchmark.cpp b/vibrator/common/bench/benchmark.cpp
deleted file mode 100644
index 06013f9..0000000
--- a/vibrator/common/bench/benchmark.cpp
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * 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 "benchmark/benchmark.h"
-
-#include <android/hardware/vibrator/1.3/IVibrator.h>
-
-using ::android::sp;
-using ::android::hardware::hidl_enum_range;
-using ::android::hardware::Return;
-using ::android::hardware::details::hidl_enum_values;
-using ::benchmark::Counter;
-using ::benchmark::Fixture;
-using ::benchmark::kMicrosecond;
-using ::benchmark::State;
-using ::benchmark::internal::Benchmark;
-using ::std::chrono::duration;
-using ::std::chrono::duration_cast;
-using ::std::chrono::high_resolution_clock;
-
-namespace V1_0 = ::android::hardware::vibrator::V1_0;
-namespace V1_1 = ::android::hardware::vibrator::V1_1;
-namespace V1_2 = ::android::hardware::vibrator::V1_2;
-namespace V1_3 = ::android::hardware::vibrator::V1_3;
-
-template <typename I>
-class VibratorBench : public Fixture {
- public:
- void SetUp(State & /*state*/) override { mVibrator = I::getService(); }
-
- void TearDown(State & /*state*/) override {
- if (!mVibrator) {
- return;
- }
- mVibrator->off();
- }
-
- static void DefaultConfig(Benchmark *b) { b->Unit(kMicrosecond); }
-
- static void DefaultArgs(Benchmark * /*b*/) {
- // none
- }
-
- protected:
- auto getOtherArg(const State &state, std::size_t index) const {
- return state.range(index + 0);
- }
-
- protected:
- sp<I> mVibrator;
-};
-
-enum class EmptyEnum : uint32_t;
-template <>
-inline constexpr std::array<EmptyEnum, 0> hidl_enum_values<EmptyEnum> = {};
-
-template <typename T, typename U>
-std::set<T> difference(const hidl_enum_range<T> &t, const hidl_enum_range<U> &u) {
- class Compare {
- public:
- bool operator()(const T &a, const U &b) { return a < static_cast<T>(b); }
- bool operator()(const U &a, const T &b) { return static_cast<T>(a) < b; }
- };
- std::set<T> ret;
-
- std::set_difference(t.begin(), t.end(), u.begin(), u.end(),
- std::insert_iterator<decltype(ret)>(ret, ret.begin()), Compare());
-
- return ret;
-}
-
-template <typename I, typename E1, typename E2 = EmptyEnum>
-class VibratorEffectsBench : public VibratorBench<I> {
- public:
- using Effect = E1;
- using EffectStrength = V1_0::EffectStrength;
- using Status = V1_0::Status;
-
- public:
- static void DefaultArgs(Benchmark *b) {
- b->ArgNames({"Effect", "Strength"});
- for (const auto &effect : difference(hidl_enum_range<E1>(), hidl_enum_range<E2>())) {
- for (const auto &strength : hidl_enum_range<EffectStrength>()) {
- b->Args({static_cast<long>(effect), static_cast<long>(strength)});
- }
- }
- }
-
- void performBench(State *state, Return<void> (I::*performApi)(Effect, EffectStrength,
- typename I::perform_cb)) {
- auto effect = getEffect(*state);
- auto strength = getStrength(*state);
- bool supported = true;
-
- (*this->mVibrator.*performApi)(effect, strength, [&](Status status, uint32_t /*lengthMs*/) {
- if (status == Status::UNSUPPORTED_OPERATION) {
- supported = false;
- }
- });
-
- if (!supported) {
- return;
- }
-
- for (auto _ : *state) {
- state->ResumeTiming();
- (*this->mVibrator.*performApi)(effect, strength,
- [](Status /*status*/, uint32_t /*lengthMs*/) {});
- state->PauseTiming();
- this->mVibrator->off();
- }
- }
-
- protected:
- auto getEffect(const State &state) const {
- return static_cast<Effect>(this->getOtherArg(state, 0));
- }
-
- auto getStrength(const State &state) const {
- return static_cast<EffectStrength>(this->getOtherArg(state, 1));
- }
-};
-
-#define BENCHMARK_WRAPPER(fixt, test, code) \
- BENCHMARK_DEFINE_F(fixt, test) \
- /* NOLINTNEXTLINE */ \
- (State & state) { \
- if (!mVibrator) { \
- return; \
- } \
- \
- code \
- } \
- BENCHMARK_REGISTER_F(fixt, test)->Apply(fixt::DefaultConfig)->Apply(fixt::DefaultArgs)
-
-using VibratorBench_V1_0 = VibratorBench<V1_0::IVibrator>;
-
-BENCHMARK_WRAPPER(VibratorBench_V1_0, on, {
- uint32_t ms = UINT32_MAX;
-
- for (auto _ : state) {
- state.ResumeTiming();
- mVibrator->on(ms);
- state.PauseTiming();
- mVibrator->off();
- }
-});
-
-BENCHMARK_WRAPPER(VibratorBench_V1_0, off, {
- uint32_t ms = UINT32_MAX;
-
- for (auto _ : state) {
- state.PauseTiming();
- mVibrator->on(ms);
- state.ResumeTiming();
- mVibrator->off();
- }
-});
-
-BENCHMARK_WRAPPER(VibratorBench_V1_0, supportsAmplitudeControl, {
- for (auto _ : state) {
- mVibrator->supportsAmplitudeControl();
- }
-});
-
-BENCHMARK_WRAPPER(VibratorBench_V1_0, setAmplitude, {
- uint8_t amplitude = UINT8_MAX;
-
- if (!mVibrator->supportsAmplitudeControl()) {
- return;
- }
-
- mVibrator->on(UINT32_MAX);
-
- for (auto _ : state) {
- mVibrator->setAmplitude(amplitude);
- }
-
- mVibrator->off();
-});
-
-using VibratorEffectsBench_V1_0 = VibratorEffectsBench<V1_0::IVibrator, V1_0::Effect>;
-
-BENCHMARK_WRAPPER(VibratorEffectsBench_V1_0, perform,
- { performBench(&state, &V1_0::IVibrator::perform); });
-
-using VibratorEffectsBench_V1_1 =
- VibratorEffectsBench<V1_1::IVibrator, V1_1::Effect_1_1, V1_0::Effect>;
-
-BENCHMARK_WRAPPER(VibratorEffectsBench_V1_1, perform_1_1,
- { performBench(&state, &V1_1::IVibrator::perform_1_1); });
-
-using VibratorEffectsBench_V1_2 =
- VibratorEffectsBench<V1_2::IVibrator, V1_2::Effect, V1_1::Effect_1_1>;
-
-BENCHMARK_WRAPPER(VibratorEffectsBench_V1_2, perform_1_2,
- { performBench(&state, &V1_2::IVibrator::perform_1_2); });
-
-using VibratorBench_V1_3 = VibratorBench<V1_3::IVibrator>;
-
-BENCHMARK_WRAPPER(VibratorBench_V1_3, supportsExternalControl, {
- for (auto _ : state) {
- mVibrator->supportsExternalControl();
- }
-});
-
-BENCHMARK_WRAPPER(VibratorBench_V1_3, setExternalControl, {
- bool enable = true;
-
- if (!mVibrator->supportsExternalControl()) {
- return;
- }
-
- for (auto _ : state) {
- state.ResumeTiming();
- mVibrator->setExternalControl(enable);
- state.PauseTiming();
- mVibrator->setExternalControl(false);
- }
-});
-
-BENCHMARK_WRAPPER(VibratorBench_V1_3, supportsExternalAmplitudeControl, {
- if (!mVibrator->supportsExternalControl()) {
- return;
- }
-
- mVibrator->setExternalControl(true);
-
- for (auto _ : state) {
- mVibrator->supportsAmplitudeControl();
- }
-
- mVibrator->setExternalControl(false);
-});
-
-BENCHMARK_WRAPPER(VibratorBench_V1_3, setExternalAmplitude, {
- uint8_t amplitude = UINT8_MAX;
-
- if (!mVibrator->supportsExternalControl()) {
- return;
- }
-
- mVibrator->setExternalControl(true);
-
- if (!mVibrator->supportsAmplitudeControl()) {
- return;
- }
-
- for (auto _ : state) {
- mVibrator->setAmplitude(amplitude);
- }
-
- mVibrator->setExternalControl(false);
-});
-
-using VibratorEffectsBench_V1_3 = VibratorEffectsBench<V1_3::IVibrator, V1_3::Effect, V1_2::Effect>;
-
-BENCHMARK_WRAPPER(VibratorEffectsBench_V1_3, perform_1_3,
- { performBench(&state, &V1_3::IVibrator::perform_1_3); });
-
-BENCHMARK_MAIN();
diff --git a/vibrator/common/utils.h b/vibrator/common/utils.h
deleted file mode 100644
index 2079256..0000000
--- a/vibrator/common/utils.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * 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.
- */
-#ifndef ANDROID_HARDWARE_VIBRATOR_UTILS_H
-#define ANDROID_HARDWARE_VIBRATOR_UTILS_H
-
-#include <android-base/macros.h>
-#include <android-base/properties.h>
-#include <log/log.h>
-
-#include <fstream>
-
-namespace android {
-namespace hardware {
-namespace vibrator {
-namespace utils {
-
-template <typename T>
-class Is_Iterable {
- private:
- template <typename U>
- static std::true_type test(typename U::iterator *u);
-
- template <typename U>
- static std::false_type test(U *u);
-
- public:
- static const bool value = decltype(test<T>(0))::value;
-};
-
-template <typename T, bool B>
-using Enable_If_Iterable = std::enable_if_t<Is_Iterable<T>::value == B>;
-
-template <typename T, typename U = void>
-using Enable_If_Signed = std::enable_if_t<std::is_signed_v<T>, U>;
-
-template <typename T, typename U = void>
-using Enable_If_Unsigned = std::enable_if_t<std::is_unsigned_v<T>, U>;
-
-// override for default behavior of printing as a character
-inline std::ostream &operator<<(std::ostream &stream, const int8_t value) {
- return stream << +value;
-}
-// override for default behavior of printing as a character
-inline std::ostream &operator<<(std::ostream &stream, const uint8_t value) {
- return stream << +value;
-}
-
-template <typename T>
-inline auto toUnderlying(const T value) {
- return static_cast<std::underlying_type_t<T>>(value);
-}
-
-template <typename T>
-inline Enable_If_Iterable<T, true> unpack(std::istream &stream, T *value) {
- for (auto &entry : *value) {
- stream >> entry;
- }
-}
-
-template <typename T>
-inline Enable_If_Iterable<T, false> unpack(std::istream &stream, T *value) {
- stream >> *value;
-}
-
-template <>
-inline void unpack<std::string>(std::istream &stream, std::string *value) {
- *value = std::string(std::istreambuf_iterator(stream), {});
- stream.setstate(std::istream::eofbit);
-}
-
-template <typename T>
-inline Enable_If_Signed<T, T> getProperty(const std::string &key, const T def) {
- return base::GetIntProperty(key, def);
-}
-
-template <typename T>
-inline Enable_If_Unsigned<T, T> getProperty(const std::string &key, const T def) {
- return base::GetUintProperty(key, def);
-}
-
-template <>
-inline bool getProperty<bool>(const std::string &key, const bool def) {
- return base::GetBoolProperty(key, def);
-}
-
-template <typename T>
-static void openNoCreate(const std::string &file, T *outStream) {
- auto mode = std::is_base_of_v<std::ostream, T> ? std::ios_base::out : std::ios_base::in;
-
- // Force 'in' mode to prevent file creation
- outStream->open(file, mode | std::ios_base::in);
- if (!*outStream) {
- ALOGE("Failed to open %s (%d): %s", file.c_str(), errno, strerror(errno));
- }
-}
-
-template <typename T>
-static void fileFromEnv(const char *env, T *outStream, std::string *outName = nullptr) {
- auto file = std::getenv(env);
-
- if (file == nullptr) {
- ALOGE("Failed get env %s", env);
- return;
- }
-
- if (outName != nullptr) {
- *outName = std::string(file);
- }
-
- openNoCreate(file, outStream);
-}
-
-static ATTRIBUTE_UNUSED auto pathsFromEnv(const char *env, const std::string &prefix = "") {
- std::map<std::string, std::ifstream> ret;
- auto value = std::getenv(env);
-
- if (value == nullptr) {
- return ret;
- }
-
- std::istringstream paths{value};
- std::string path;
-
- while (paths >> path) {
- ret[path].open(prefix + path);
- }
-
- return ret;
-}
-
-static ATTRIBUTE_UNUSED std::string trim(const std::string &str,
- const std::string &whitespace = " \t") {
- const auto str_begin = str.find_first_not_of(whitespace);
- if (str_begin == std::string::npos) {
- return "";
- }
-
- const auto str_end = str.find_last_not_of(whitespace);
- const auto str_range = str_end - str_begin + 1;
-
- return str.substr(str_begin, str_range);
-}
-
-} // namespace utils
-} // namespace vibrator
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_VIBRATOR_UTILS_H
diff --git a/vibrator/drv2624/Android.bp b/vibrator/drv2624/Android.bp
index 420c228..c3184c2 100644
--- a/vibrator/drv2624/Android.bp
+++ b/vibrator/drv2624/Android.bp
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2019 The Android Open Source Project
+// Copyright (C) 2020 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.
@@ -14,42 +14,46 @@
// limitations under the License.
cc_defaults {
- name: "android.hardware.vibrator@1.3-defaults.redfin",
- defaults: ["PixelVibratorDefaultsRedfin"],
- shared_libs: [
- "android.hardware.vibrator@1.0",
- "android.hardware.vibrator@1.1",
- "android.hardware.vibrator@1.2",
- "android.hardware.vibrator@1.3",
- ],
+ name: "android.hardware.vibrator-defaults.redfin",
cflags: [
"-DATRACE_TAG=(ATRACE_TAG_VIBRATOR | ATRACE_TAG_HAL)",
- "-DLOG_TAG=\"android.hardware.vibrator@1.3-redfin\"",
+ "-DLOG_TAG=\"android.hardware.vibrator-redfin\"",
],
}
cc_defaults {
- name: "VibratorHalDrv2624TestDefaultsRedfin",
- defaults: ["android.hardware.vibrator@1.3-defaults.redfin"],
- static_libs: ["android.hardware.vibrator@1.3-impl.redfin"],
- test_suites: ["device-tests"],
- require_root: true,
+ name: "VibratorHalDrv2624BinaryDefaultsRedfin",
+ defaults: [
+ "PixelVibratorBinaryDefaults",
+ "android.hardware.vibrator-defaults.redfin",
+ ],
+ target: {
+ android: {
+ // TODO: Add sensor stub for tests.
+ },
+ vendor: {
+ shared_libs: [
+ "libsensorndkbridge",
+ ],
+ }
+ },
}
cc_library {
- name: "android.hardware.vibrator@1.3-impl.redfin",
- defaults: ["android.hardware.vibrator@1.3-defaults.redfin"],
+ name: "android.hardware.vibrator-impl.redfin",
+ defaults: ["VibratorHalDrv2624BinaryDefaultsRedfin"],
srcs: ["Vibrator.cpp"],
export_include_dirs: ["."],
- vendor_available: true,
+ proprietary: true,
+ visibility: [":__subpackages__"],
}
cc_binary {
- name: "android.hardware.vibrator@1.3-service.redfin",
- defaults: ["android.hardware.vibrator@1.3-defaults.redfin"],
- init_rc: ["android.hardware.vibrator@1.3-service.redfin.rc"],
- vintf_fragments: ["android.hardware.vibrator@1.3-service.redfin.xml"],
+ name: "android.hardware.vibrator-service.redfin",
+ defaults: ["VibratorHalDrv2624BinaryDefaultsRedfin"],
+ init_rc: ["android.hardware.vibrator-service.redfin.rc"],
+ vintf_fragments: ["android.hardware.vibrator-service.redfin.xml"],
srcs: ["service.cpp"],
- static_libs: ["android.hardware.vibrator@1.3-impl.redfin"],
+ static_libs: ["android.hardware.vibrator-impl.redfin"],
proprietary: true,
}
diff --git a/vibrator/drv2624/Hardware.h b/vibrator/drv2624/Hardware.h
index 96fd62f..38a290a 100644
--- a/vibrator/drv2624/Hardware.h
+++ b/vibrator/drv2624/Hardware.h
@@ -13,20 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_VIBRATOR_HARDWARE_H
-#define ANDROID_HARDWARE_VIBRATOR_HARDWARE_H
+#pragma once
#include "../common/HardwareBase.h"
#include "Vibrator.h"
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
-
-using common::implementation::HwApiBase;
-using common::implementation::HwCalBase;
class HwApi : public Vibrator::HwApi, private HwApiBase {
public:
@@ -73,7 +68,14 @@
open("device/lra_wave_shape", &mLraWaveShape);
open("device/od_clamp", &mOdClamp);
// TODO: for future new architecture: b/149610125
- openFull("/sys/devices/virtual/thermal/tz-by-name/pa-therm1/temp", &mPATemp);
+ openFull("/sys/devices/virtual/thermal/tz-by-name/pa-therm1/temp",
+ &mPATemp);
+ }
+
+ template <typename T>
+ void openFull(const std::string &name, T *stream) {
+ saveName(name, stream);
+ utils::openNoCreate(name, stream);
}
private:
@@ -98,12 +100,14 @@
static constexpr char AUTOCAL_CONFIG[] = "autocal";
static constexpr char LRA_PERIOD_CONFIG[] = "lra_period";
static constexpr char EFFECT_COEFF_CONFIG[] = "haptic_coefficient";
+ static constexpr char EFFECT_TARGET_G[] = "haptic_target_G";
static constexpr char STEADY_AMP_MAX_CONFIG[] = "vibration_amp_max";
static constexpr char STEADY_COEFF_CONFIG[] = "vibration_coefficient";
+ static constexpr char STEADY_TARGET_G[] = "vibration_target_G";
static constexpr uint32_t WAVEFORM_CLICK_EFFECT_MS = 6;
static constexpr uint32_t WAVEFORM_TICK_EFFECT_MS = 2;
- static constexpr uint32_t WAVEFORM_DOUBLE_CLICK_EFFECT_MS = 144;
+ static constexpr uint32_t WAVEFORM_DOUBLE_CLICK_EFFECT_MS = 159;
static constexpr uint32_t WAVEFORM_HEAVY_CLICK_EFFECT_MS = 8;
static constexpr uint32_t DEFAULT_LRA_PERIOD = 262;
@@ -128,6 +132,12 @@
}
return false;
}
+ bool getEffectTargetG(std::array<float, 5> *value) override {
+ if (getPersist(EFFECT_TARGET_G, value)) {
+ return true;
+ }
+ return false;
+ }
bool getSteadyAmpMax(float *value) override {
if (getPersist(STEADY_AMP_MAX_CONFIG, value)) {
return true;
@@ -140,6 +150,12 @@
}
return false;
}
+ bool getSteadyTargetG(std::array<float, 3> *value) override {
+ if (getPersist(STEADY_TARGET_G, value)) {
+ return true;
+ }
+ return false;
+ }
bool getCloseLoopThreshold(uint32_t *value) override {
return getProperty("closeloop.threshold", value, UINT32_MAX);
return true;
@@ -178,13 +194,14 @@
bool getTriggerEffectSupport(uint32_t *value) override {
return getProperty("lptrigger", value, DEFAULT_LP_TRIGGER_SUPPORT);
}
+ bool getDevHwVer(std::string *value) override {
+ *value = ::android::base::GetProperty("ro.revision", "DVT");
+ return true;
+ }
void debug(int fd) override { HwCalBase::debug(fd); }
};
-} // namespace implementation
-} // namespace V1_3
} // namespace vibrator
} // namespace hardware
} // namespace android
-
-#endif // ANDROID_HARDWARE_VIBRATOR_HARDWARE_H
+} // namespace aidl
diff --git a/vibrator/drv2624/TEST_MAPPING b/vibrator/drv2624/TEST_MAPPING
index ec34f66..3c18a65 100644
--- a/vibrator/drv2624/TEST_MAPPING
+++ b/vibrator/drv2624/TEST_MAPPING
@@ -1,12 +1,12 @@
{
"presubmit": [
{
- "name": "VibratorHalDrv2624TestSuite"
+ "name": "VibratorHalDrv2624TestSuiteRedfin"
}
],
"postsubmit": [
{
- "name": "VibratorHalDrv2624Benchmark",
+ "name": "VibratorHalDrv2624BenchmarkRedfin",
"keywords": [
"primary-device"
]
diff --git a/vibrator/drv2624/Vibrator.cpp b/vibrator/drv2624/Vibrator.cpp
index 793b2b1..744f16e 100644
--- a/vibrator/drv2624/Vibrator.cpp
+++ b/vibrator/drv2624/Vibrator.cpp
@@ -15,25 +15,30 @@
*/
#include "Vibrator.h"
+#include "utils.h"
+#include <android/looper.h>
+#include <android/sensor.h>
#include <cutils/properties.h>
#include <hardware/hardware.h>
#include <hardware/vibrator.h>
#include <log/log.h>
+#include <utils/Errors.h>
#include <utils/Trace.h>
#include <cinttypes>
#include <cmath>
#include <fstream>
#include <iostream>
+#include <numeric>
-#include "utils.h"
-
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
+
+using ::android::NO_ERROR;
+using ::android::UNEXPECTED_NULL;
static constexpr int8_t MAX_RTP_INPUT = 127;
static constexpr int8_t MIN_RTP_INPUT = 0;
@@ -54,10 +59,81 @@
static constexpr char WAVEFORM_HEAVY_CLICK_EFFECT_SEQ[] = "4 0";
// UT team design those target G values
-static constexpr std::array<float, 5> EFFECT_TARGET_G = {0.175, 0.325, 0.37, 0.475, 0.6};
-static constexpr std::array<float, 3> STEADY_TARGET_G = {1.38, 1.145, 0.905};
+static std::array<float, 5> EFFECT_TARGET_G = {0.275, 0.55, 0.6, 0.9, 1.12};
+static std::array<float, 3> STEADY_TARGET_G = {2.15, 1.145, 1.3};
+struct SensorContext {
+ ASensorEventQueue *queue;
+};
+static std::vector<float> sXAxleData;
+static std::vector<float> sYAxleData;
+static uint64_t sEndTime = 0;
+static struct timespec sGetTime;
+
+#define MAX_VOLTAGE 3.2
#define FLOAT_EPS 1e-7
+#define SENSOR_DATA_NUM 20
+// Set sensing period to 2s
+#define SENSING_PERIOD 2000000000
+#define VIBRATION_MOTION_TIME_THRESHOLD 100
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+int GSensorCallback(__attribute__((unused)) int fd, __attribute__((unused)) int events,
+ void *data) {
+ ASensorEvent event;
+ int event_count = 0;
+ SensorContext *context = reinterpret_cast<SensorContext *>(data);
+ event_count = ASensorEventQueue_getEvents(context->queue, &event, 1);
+ sXAxleData.push_back(event.data[0]);
+ sYAxleData.push_back(event.data[1]);
+ return 1;
+}
+// TODO: b/152305970
+int32_t PollGSensor() {
+ int err = NO_ERROR, counter = 0;
+ ASensorManager *sensorManager = nullptr;
+ ASensorRef GSensor;
+ ALooper *looper;
+ struct SensorContext context = {nullptr};
+
+ // Get proximity sensor events from the NDK
+ sensorManager = ASensorManager_getInstanceForPackage("");
+ if (!sensorManager) {
+ ALOGI("Chase %s: Sensor manager is NULL.\n", __FUNCTION__);
+ err = UNEXPECTED_NULL;
+ return 0;
+ }
+ GSensor = ASensorManager_getDefaultSensor(sensorManager, ASENSOR_TYPE_GRAVITY);
+ if (GSensor == nullptr) {
+ ALOGE("%s:Chase Unable to get g sensor\n", __func__);
+ } else {
+ looper = ALooper_forThread();
+ if (looper == nullptr) {
+ looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
+ }
+ context.queue =
+ ASensorManager_createEventQueue(sensorManager, looper, 0, GSensorCallback, &context);
+
+ err = ASensorEventQueue_registerSensor(context.queue, GSensor, 0, 0);
+ if (err != NO_ERROR) {
+ ALOGE("Chase %s: Error %d registering G sensor with event queue.\n", __FUNCTION__, err);
+ return 0;
+ }
+ if (err < 0) {
+ ALOGE("%s:Chase Unable to register for G sensor events\n", __func__);
+ } else {
+ for (counter = 0; counter < SENSOR_DATA_NUM; counter++) {
+ ALooper_pollOnce(5, nullptr, nullptr, nullptr);
+ }
+ }
+ }
+ if (sensorManager != nullptr && context.queue != nullptr) {
+ ASensorEventQueue_disableSensor(context.queue, GSensor);
+ ASensorManager_destroyEventQueue(sensorManager, context.queue);
+ }
+
+ return 0;
+}
// Temperature protection upper bound 10°C and lower bound 5°C
static constexpr int32_t TEMP_UPPER_BOUND = 10000;
@@ -84,10 +160,10 @@
// 0 to 3.2 is our valid output
float outPutVal = 0.0f;
outPutVal = (targetG - inputCoeffs[1]) / inputCoeffs[0];
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
} else {
- return 0.0f;
+ return 0.0f;
}
}
@@ -111,8 +187,8 @@
if ((fabs(AA) <= FLOAT_EPS) && (fabs(BB) <= FLOAT_EPS)) {
// Case 1: A = B = 0
outPutVal = -inputCoeffs[1] / (3 * inputCoeffs[0]);
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
}
return 0.0f;
} else if (Delta > FLOAT_EPS) {
@@ -143,28 +219,28 @@
sqrtA = sqrt(AA);
outPutVal = (-inputCoeffs[1] - 2 * sqrtA * cosSita) / (3 * inputCoeffs[0]);
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
}
outPutVal = (-inputCoeffs[1] + sqrtA * (cosSita + sinSitaSqrt3)) / (3 * inputCoeffs[0]);
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
}
outPutVal = (-inputCoeffs[1] + sqrtA * (cosSita - sinSitaSqrt3)) / (3 * inputCoeffs[0]);
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
}
return 0.0f;
} else if (Delta <= FLOAT_EPS) {
// Case 4: Delta = 0
K = BB / AA;
outPutVal = (-inputCoeffs[1] / inputCoeffs[0] + K);
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
}
outPutVal = (-K / 2);
- if ((outPutVal > FLOAT_EPS) && (outPutVal <= 3.2)) {
- return outPutVal;
+ if ((outPutVal > FLOAT_EPS) && (outPutVal <= MAX_VOLTAGE)) {
+ return outPutVal;
}
return 0.0f;
} else {
@@ -173,18 +249,47 @@
}
}
-using utils::toUnderlying;
+static float vLevelsToTargetGUnderCubicEquation(
+ std::array<float, 4> inputCoeffs, float vLevel) {
+ float inputVoltage = 0.0f;
+ inputVoltage = vLevel * MAX_VOLTAGE;
+ return inputCoeffs[0] * pow(inputVoltage, 3) +
+ inputCoeffs[1] * pow(inputVoltage, 2) + inputCoeffs[2] * inputVoltage +
+ inputCoeffs[3];
+}
-using Status = ::android::hardware::vibrator::V1_0::Status;
-using EffectStrength = ::android::hardware::vibrator::V1_0::EffectStrength;
+static bool motionAwareness() {
+ float avgX = 0.0, avgY = 0.0;
+ uint64_t current_time = 0;
+ clock_gettime(CLOCK_MONOTONIC, &sGetTime);
+ current_time = ((uint64_t)sGetTime.tv_sec * 1000 * 1000 * 1000) + sGetTime.tv_nsec;
+
+ if ((current_time - sEndTime) > SENSING_PERIOD) {
+ sXAxleData.clear();
+ sYAxleData.clear();
+ PollGSensor();
+ clock_gettime(CLOCK_MONOTONIC, &sGetTime);
+ sEndTime = ((uint64_t)sGetTime.tv_sec * 1000 * 1000 * 1000) + sGetTime.tv_nsec;
+ }
+
+ avgX = std::accumulate(sXAxleData.begin(), sXAxleData.end(), 0.0) / sXAxleData.size();
+ avgY = std::accumulate(sYAxleData.begin(), sYAxleData.end(), 0.0) / sYAxleData.size();
+
+ if ((avgX > -1.3) && (avgX < 1.3) && (avgY > -0.8) && (avgY < 0.8)) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+using utils::toUnderlying;
Vibrator::Vibrator(std::unique_ptr<HwApi> hwapi, std::unique_ptr<HwCal> hwcal)
: mHwApi(std::move(hwapi)), mHwCal(std::move(hwcal)) {
std::string autocal;
uint32_t lraPeriod = 0, lpTrigSupport = 0;
- bool hasEffectCoeffs = false, hasSteadyCoeffs = false;
- std::array<float, 4> effectCoeffs = {0};
- std::array<float, 4> steadyCoeffs = {0};
+ std::array<float, 4> effectCoeffs = {0.0f};
+ std::array<float, 4> steadyCoeffs = {0.0f};
if (!mHwApi->setState(true)) {
ALOGE("Failed to set state (%d): %s", errno, strerror(errno));
@@ -200,30 +305,52 @@
if (mDynamicConfig) {
uint8_t i = 0;
- float tempVolLevel = 0.0f;
- float tempAmpMax = 0.0f;
- uint32_t longFreqencyShift = 0;
- uint32_t shortVoltageMax = 0, longVoltageMax = 0;
- uint32_t shape = 0;
+ bool hasEffectCoeffs = false, hasSteadyCoeffs = false,
+ hasExternalEffectG = false, hasExternalSteadyG = false;
+ std::array<float, 5> externalEffectTargetG = {0.0f};
+ std::array<float, 3> externalSteadyTargetG = {0.0f};
+ float tempVolLevel = 0.0f, tempAmpMax = 0.0f;
+ uint32_t longFreqencyShift = 0, shortVoltageMax = 0, longVoltageMax = 0,
+ shape = 0;
+ std::string devHwVersion;
mHwCal->getLongFrequencyShift(&longFreqencyShift);
mHwCal->getShortVoltageMax(&shortVoltageMax);
mHwCal->getLongVoltageMax(&longVoltageMax);
+ // TODO: This is a workaround for b/157610908
+ mHwCal->getDevHwVer(&devHwVersion);
+ if ((devHwVersion.find("EVT") != std::string::npos) ||
+ (devHwVersion.find("PROTO") != std::string::npos)) {
+ EFFECT_TARGET_G = {0.15, 0.27, 0.35, 0.54, 0.65};
+ STEADY_TARGET_G = {1.2, 1.145, 0.4};
+ ALOGW("Device HW version: %s, this is an EVT device",
+ devHwVersion.c_str());
+ } else {
+ ALOGW("Device HW version: %s, no need to change the target G values",
+ devHwVersion.c_str());
+ }
+
hasEffectCoeffs = mHwCal->getEffectCoeffs(&effectCoeffs);
+ hasExternalEffectG = mHwCal->getEffectTargetG(&externalEffectTargetG);
for (i = 0; i < 5; i++) {
if (hasEffectCoeffs) {
- // Use linear approach to get the target voltage levels
- if ((effectCoeffs[2] == 0) && (effectCoeffs[3] == 0)) {
- tempVolLevel =
- targetGToVlevelsUnderLinearEquation(effectCoeffs, EFFECT_TARGET_G[i]);
- mEffectTargetOdClamp[i] = convertLevelsToOdClamp(tempVolLevel, lraPeriod);
- } else {
- // Use cubic approach to get the target voltage levels
- tempVolLevel =
- targetGToVlevelsUnderCubicEquation(effectCoeffs, EFFECT_TARGET_G[i]);
- mEffectTargetOdClamp[i] = convertLevelsToOdClamp(tempVolLevel, lraPeriod);
- }
+ if (hasExternalEffectG) {
+ EFFECT_TARGET_G[i] = externalEffectTargetG[i];
+ }
+ // Use linear approach to get the target voltage levels
+ if ((effectCoeffs[2] == 0) && (effectCoeffs[3] == 0)) {
+ tempVolLevel = targetGToVlevelsUnderLinearEquation(
+ effectCoeffs, EFFECT_TARGET_G[i]);
+ mEffectTargetOdClamp[i] =
+ convertLevelsToOdClamp(tempVolLevel, lraPeriod);
+ } else {
+ // Use cubic approach to get the target voltage levels
+ tempVolLevel = targetGToVlevelsUnderCubicEquation(
+ effectCoeffs, EFFECT_TARGET_G[i]);
+ mEffectTargetOdClamp[i] =
+ convertLevelsToOdClamp(tempVolLevel, lraPeriod);
+ }
} else {
mEffectTargetOdClamp[i] = shortVoltageMax;
}
@@ -242,19 +369,49 @@
}));
hasSteadyCoeffs = mHwCal->getSteadyCoeffs(&steadyCoeffs);
+ hasExternalSteadyG = mHwCal->getSteadyTargetG(&externalSteadyTargetG);
if (hasSteadyCoeffs) {
for (i = 0; i < 3; i++) {
- // Use cubic approach to get the target voltage levels
- tempVolLevel = targetGToVlevelsUnderCubicEquation(steadyCoeffs, STEADY_TARGET_G[i]);
- mSteadyTargetOdClamp[i] = convertLevelsToOdClamp(tempVolLevel, lraPeriod);
- if ((mSteadyTargetOdClamp[i] <= 0) || (mSteadyTargetOdClamp[i] > longVoltageMax)) {
- mSteadyTargetOdClamp[i] = longVoltageMax;
- }
+ if (hasExternalSteadyG) {
+ STEADY_TARGET_G[i] = externalSteadyTargetG[i];
+ }
+ // Use cubic approach to get the steady target voltage levels
+ // For steady level 3 voltage which is used for non-motion
+ // voltage, we use interpolation method to calculate the voltage
+ // via 20% of MAX voltage, 60% of MAX voltage and steady level 3
+ // target G
+ if (i == 2) {
+ tempVolLevel =
+ ((STEADY_TARGET_G[2] -
+ vLevelsToTargetGUnderCubicEquation(steadyCoeffs, 0.2)) *
+ 0.4 * MAX_VOLTAGE) /
+ (vLevelsToTargetGUnderCubicEquation(steadyCoeffs, 0.6) -
+ vLevelsToTargetGUnderCubicEquation(steadyCoeffs,
+ 0.2)) +
+ 0.2 * MAX_VOLTAGE;
+ } else {
+ tempVolLevel = targetGToVlevelsUnderCubicEquation(
+ steadyCoeffs, STEADY_TARGET_G[i]);
+ }
+ mSteadyTargetOdClamp[i] =
+ convertLevelsToOdClamp(tempVolLevel, lraPeriod);
+ if ((mSteadyTargetOdClamp[i] <= 0) ||
+ (mSteadyTargetOdClamp[i] > longVoltageMax)) {
+ mSteadyTargetOdClamp[i] = longVoltageMax;
+ }
}
} else {
- mSteadyTargetOdClamp[0] =
+ if (hasExternalSteadyG) {
+ STEADY_TARGET_G[0] = externalSteadyTargetG[0];
+ STEADY_TARGET_G[2] = externalSteadyTargetG[2];
+ }
+ mSteadyTargetOdClamp[0] =
+ mHwCal->getSteadyAmpMax(&tempAmpMax)
+ ? round((STEADY_TARGET_G[0] / tempAmpMax) * longVoltageMax)
+ : longVoltageMax;
+ mSteadyTargetOdClamp[2] =
mHwCal->getSteadyAmpMax(&tempAmpMax)
- ? round((STEADY_TARGET_G[0] / tempAmpMax) * longVoltageMax)
+ ? round((STEADY_TARGET_G[2] / tempAmpMax) * longVoltageMax)
: longVoltageMax;
}
mHwCal->getSteadyShape(&shape);
@@ -288,9 +445,19 @@
}
}
-Return<Status> Vibrator::on(uint32_t timeoutMs, const char mode[],
- const std::unique_ptr<VibrationConfig> &config,
- const int8_t volOffset) {
+ndk::ScopedAStatus Vibrator::getCapabilities(int32_t *_aidl_return) {
+ ATRACE_NAME("Vibrator::getCapabilities");
+ int32_t ret = 0;
+ if (mHwApi->hasRtpInput()) {
+ ret |= IVibrator::CAP_AMPLITUDE_CONTROL;
+ }
+ *_aidl_return = ret;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Vibrator::on(uint32_t timeoutMs, const char mode[],
+ const std::unique_ptr<VibrationConfig> &config,
+ const int8_t volOffset) {
LoopControl loopMode = LoopControl::OPEN;
// Open-loop mode is used for short click for over-drive
@@ -302,7 +469,7 @@
mHwApi->setCtrlLoop(toUnderlying(loopMode));
if (!mHwApi->setDuration(timeoutMs)) {
ALOGE("Failed to set duration (%d): %s", errno, strerror(errno));
- return Status::UNKNOWN_ERROR;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
mHwApi->setMode(mode);
@@ -314,21 +481,31 @@
if (!mHwApi->setActivate(1)) {
ALOGE("Failed to activate (%d): %s", errno, strerror(errno));
- return Status::UNKNOWN_ERROR;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
- return Status::OK;
+ return ndk::ScopedAStatus::ok();
}
-// Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
-Return<Status> Vibrator::on(uint32_t timeoutMs) {
+ndk::ScopedAStatus Vibrator::on(int32_t timeoutMs,
+ const std::shared_ptr<IVibratorCallback> &callback) {
ATRACE_NAME("Vibrator::on");
+
+ if (callback) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+
if (mDynamicConfig) {
int temperature = 0;
mHwApi->getPATemp(&temperature);
if (temperature > TEMP_UPPER_BOUND) {
mSteadyConfig->odClamp = &mSteadyTargetOdClamp[0];
mSteadyConfig->olLraPeriod = mSteadyOlLraPeriod;
+ // TODO: b/162346934 This a compromise way to bypass the motion
+ // awareness delay
+ if ((timeoutMs > VIBRATION_MOTION_TIME_THRESHOLD) && (!motionAwareness())) {
+ return on(timeoutMs, RTP_MODE, mSteadyConfig, 2);
+ }
} else if (temperature < TEMP_LOWER_BOUND) {
mSteadyConfig->odClamp = &STEADY_VOLTAGE_LOWER_BOUND;
mSteadyConfig->olLraPeriod = mSteadyOlLraPeriodShift;
@@ -338,68 +515,55 @@
return on(timeoutMs, RTP_MODE, mSteadyConfig, 0);
}
-Return<Status> Vibrator::off() {
+ndk::ScopedAStatus Vibrator::off() {
ATRACE_NAME("Vibrator::off");
if (!mHwApi->setActivate(0)) {
ALOGE("Failed to turn vibrator off (%d): %s", errno, strerror(errno));
- return Status::UNKNOWN_ERROR;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
- return Status::OK;
+ return ndk::ScopedAStatus::ok();
}
-Return<bool> Vibrator::supportsAmplitudeControl() {
- ATRACE_NAME("Vibrator::supportsAmplitudeControl");
- return (mHwApi->hasRtpInput() ? true : false);
-}
-
-Return<Status> Vibrator::setAmplitude(uint8_t amplitude) {
+ndk::ScopedAStatus Vibrator::setAmplitude(float amplitude) {
ATRACE_NAME("Vibrator::setAmplitude");
- if (amplitude == 0) {
- return Status::BAD_VALUE;
+ if (amplitude <= 0.0f || amplitude > 1.0f) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
- int32_t rtp_input =
- std::round((amplitude - 1) / 254.0 * (MAX_RTP_INPUT - MIN_RTP_INPUT) + MIN_RTP_INPUT);
+ int32_t rtp_input = std::round(amplitude * (MAX_RTP_INPUT - MIN_RTP_INPUT) + MIN_RTP_INPUT);
if (!mHwApi->setRtpInput(rtp_input)) {
ALOGE("Failed to set amplitude (%d): %s", errno, strerror(errno));
- return Status::UNKNOWN_ERROR;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
- return Status::OK;
+ return ndk::ScopedAStatus::ok();
}
-// Methods from ::android::hardware::vibrator::V1_3::IVibrator follow.
-
-Return<bool> Vibrator::supportsExternalControl() {
- ATRACE_NAME("Vibrator::supportsExternalControl");
- return false;
-}
-
-Return<Status> Vibrator::setExternalControl(bool enabled) {
+ndk::ScopedAStatus Vibrator::setExternalControl(bool enabled) {
ATRACE_NAME("Vibrator::setExternalControl");
ALOGE("Not support in DRV2624 solution, %d", enabled);
- return Status::UNSUPPORTED_OPERATION;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
-// Methods from ::android.hidl.base::V1_0::IBase follow.
-
-Return<void> Vibrator::debug(const hidl_handle &handle,
- const hidl_vec<hidl_string> & /* options */) {
- if (handle == nullptr || handle->numFds < 1 || handle->data[0] < 0) {
+binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) {
+ if (fd < 0) {
ALOGE("Called debug() with invalid fd.");
- return Void();
+ return STATUS_OK;
}
- int fd = handle->data[0];
+ (void)args;
+ (void)numArgs;
- dprintf(fd, "HIDL:\n");
+ dprintf(fd, "AIDL:\n");
dprintf(fd, " Close Loop Thresh: %" PRIu32 "\n", mCloseLoopThreshold);
if (mSteadyConfig) {
dprintf(fd, " Steady Shape: %" PRIu32 "\n", mSteadyConfig->shape);
dprintf(fd, " Steady OD Clamp: %" PRIu32 " %" PRIu32 " %" PRIu32 "\n",
mSteadyConfig->odClamp[0], mSteadyConfig->odClamp[1], mSteadyConfig->odClamp[2]);
+ dprintf(fd, " Steady target G: %f %f %f\n", STEADY_TARGET_G[0],
+ STEADY_TARGET_G[1], STEADY_TARGET_G[2]);
dprintf(fd, " Steady OL LRA Period: %" PRIu32 "\n", mSteadyConfig->olLraPeriod);
}
if (mEffectConfig) {
@@ -408,6 +572,9 @@
" Effect OD Clamp: %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "\n",
mEffectConfig->odClamp[0], mEffectConfig->odClamp[1], mEffectConfig->odClamp[2],
mEffectConfig->odClamp[3], mEffectConfig->odClamp[4]);
+ dprintf(fd, " Effect target G: %f %f %f %f %f\n", EFFECT_TARGET_G[0],
+ EFFECT_TARGET_G[1], EFFECT_TARGET_G[2], EFFECT_TARGET_G[3],
+ EFFECT_TARGET_G[4]);
dprintf(fd, " Effect OL LRA Period: %" PRIu32 "\n", mEffectConfig->olLraPeriod);
}
dprintf(fd, " Click Duration: %" PRIu32 "\n", mClickDuration);
@@ -424,45 +591,33 @@
mHwCal->debug(fd);
fsync(fd);
- return Void();
+ return STATUS_OK;
}
-Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
- return performWrapper(effect, strength, _hidl_cb);
+ndk::ScopedAStatus Vibrator::getSupportedEffects(std::vector<Effect> *_aidl_return) {
+ *_aidl_return = {Effect::TEXTURE_TICK, Effect::TICK, Effect::CLICK, Effect::HEAVY_CLICK,
+ Effect::DOUBLE_CLICK};
+ return ndk::ScopedAStatus::ok();
}
-Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength,
- perform_cb _hidl_cb) {
- return performWrapper(effect, strength, _hidl_cb);
-}
+ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength strength,
+ const std::shared_ptr<IVibratorCallback> &callback,
+ int32_t *_aidl_return) {
+ ATRACE_NAME("Vibrator::perform");
+ ndk::ScopedAStatus status;
-Return<void> Vibrator::perform_1_2(V1_2::Effect effect, EffectStrength strength,
- perform_cb _hidl_cb) {
- return performWrapper(effect, strength, _hidl_cb);
-}
-
-Return<void> Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
- return performWrapper(effect, strength, _hidl_cb);
-}
-
-template <typename T>
-Return<void> Vibrator::performWrapper(T effect, EffectStrength strength, perform_cb _hidl_cb) {
- ATRACE_NAME("Vibrator::performWrapper");
- auto validEffectRange = hidl_enum_range<T>();
- if (effect < *validEffectRange.begin() || effect > *std::prev(validEffectRange.end())) {
- _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
- return Void();
+ if (callback) {
+ status = ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ } else {
+ status = performEffect(effect, strength, _aidl_return);
}
- auto validStrengthRange = hidl_enum_range<EffectStrength>();
- if (strength < *validStrengthRange.begin() || strength > *std::prev(validStrengthRange.end())) {
- _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
- return Void();
- }
- return performEffect(static_cast<Effect>(effect), strength, _hidl_cb);
+
+ return status;
}
-Return<void> Vibrator::performEffect(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
- Status status = Status::OK;
+ndk::ScopedAStatus Vibrator::performEffect(Effect effect, EffectStrength strength,
+ int32_t *outTimeMs) {
+ ndk::ScopedAStatus status;
uint32_t timeMS;
int8_t volOffset;
@@ -477,7 +632,7 @@
volOffset = 1;
break;
default:
- status = Status::UNSUPPORTED_OPERATION;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
break;
}
@@ -508,16 +663,53 @@
volOffset += HEAVY_CLICK;
break;
default:
- _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
- return Void();
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
- on(timeMS, WAVEFORM_MODE, mEffectConfig, volOffset);
- _hidl_cb(status, timeMS);
- return Void();
+ status = on(timeMS, WAVEFORM_MODE, mEffectConfig, volOffset);
+ if (!status.isOk()) {
+ return status;
+ }
+
+ *outTimeMs = timeMS;
+
+ return ndk::ScopedAStatus::ok();
}
-} // namespace implementation
-} // namespace V1_3
+ndk::ScopedAStatus Vibrator::getSupportedAlwaysOnEffects(std::vector<Effect> * /*_aidl_return*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::alwaysOnEnable(int32_t /*id*/, Effect /*effect*/,
+ EffectStrength /*strength*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+ndk::ScopedAStatus Vibrator::alwaysOnDisable(int32_t /*id*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getCompositionDelayMax(int32_t * /*maxDelayMs*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getCompositionSizeMax(int32_t * /*maxSize*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getSupportedPrimitives(std::vector<CompositePrimitive> * /*supported*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getPrimitiveDuration(CompositePrimitive /*primitive*/,
+ int32_t * /*durationMs*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect> & /*composite*/,
+ const std::shared_ptr<IVibratorCallback> & /*callback*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
} // namespace vibrator
} // namespace hardware
} // namespace android
+} // namespace aidl
diff --git a/vibrator/drv2624/Vibrator.h b/vibrator/drv2624/Vibrator.h
index 234b35d..7a93872 100644
--- a/vibrator/drv2624/Vibrator.h
+++ b/vibrator/drv2624/Vibrator.h
@@ -13,21 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
-#define ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
+#pragma once
-#include <android/hardware/vibrator/1.3/IVibrator.h>
-#include <hidl/Status.h>
+#include <aidl/android/hardware/vibrator/BnVibrator.h>
#include <fstream>
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
-class Vibrator : public IVibrator {
+class Vibrator : public BnVibrator {
public:
// APIs for interfacing with the kernel driver.
class HwApi {
@@ -97,10 +94,14 @@
virtual bool getLraPeriod(uint32_t *value) = 0;
// Obtains the effect coeffs to calculate the target voltage
virtual bool getEffectCoeffs(std::array<float, 4> *value) = 0;
+ // Obtains the external effect target G
+ virtual bool getEffectTargetG(std::array<float, 5> *value) = 0;
// Obtain the max steady G value
virtual bool getSteadyAmpMax(float *value) = 0;
// Obtains the steady coeffs to calculate the target voltage
virtual bool getSteadyCoeffs(std::array<float, 4> *value) = 0;
+ // Obtains the external steady target G
+ virtual bool getSteadyTargetG(std::array<float, 3> *value) = 0;
// Obtains threshold in ms, above which close-loop should be used.
virtual bool getCloseLoopThreshold(uint32_t *value) = 0;
// Obtains dynamic/static configuration choice.
@@ -125,6 +126,8 @@
virtual bool getSteadyShape(uint32_t *value) = 0;
// Obtains the trigger effect support
virtual bool getTriggerEffectSupport(uint32_t *value) = 0;
+ // Obtains device hardware version
+ virtual bool getDevHwVer(std::string *value) = 0;
// Emit diagnostic information to the given file.
virtual void debug(int fd) = 0;
};
@@ -156,35 +159,34 @@
public:
Vibrator(std::unique_ptr<HwApi> hwapi, std::unique_ptr<HwCal> hwcal);
- // Methods from ::android::hardware::vibrator::V1_0::IVibrator follow.
- using Status = ::android::hardware::vibrator::V1_0::Status;
- Return<Status> on(uint32_t timeoutMs) override;
- Return<Status> off() override;
- Return<bool> supportsAmplitudeControl() override;
- Return<Status> setAmplitude(uint8_t amplitude) override;
+ ndk::ScopedAStatus getCapabilities(int32_t *_aidl_return) override;
+ ndk::ScopedAStatus off() override;
+ ndk::ScopedAStatus on(int32_t timeoutMs,
+ const std::shared_ptr<IVibratorCallback> &callback) override;
+ ndk::ScopedAStatus perform(Effect effect, EffectStrength strength,
+ const std::shared_ptr<IVibratorCallback> &callback,
+ int32_t *_aidl_return) override;
+ ndk::ScopedAStatus getSupportedEffects(std::vector<Effect> *_aidl_return) override;
+ ndk::ScopedAStatus setAmplitude(float amplitude) override;
+ ndk::ScopedAStatus setExternalControl(bool enabled) override;
+ ndk::ScopedAStatus getCompositionDelayMax(int32_t *maxDelayMs);
+ ndk::ScopedAStatus getCompositionSizeMax(int32_t *maxSize);
+ ndk::ScopedAStatus getSupportedPrimitives(std::vector<CompositePrimitive> *supported) override;
+ ndk::ScopedAStatus getPrimitiveDuration(CompositePrimitive primitive,
+ int32_t *durationMs) override;
+ ndk::ScopedAStatus compose(const std::vector<CompositeEffect> &composite,
+ const std::shared_ptr<IVibratorCallback> &callback) override;
+ ndk::ScopedAStatus getSupportedAlwaysOnEffects(std::vector<Effect> *_aidl_return) override;
+ ndk::ScopedAStatus alwaysOnEnable(int32_t id, Effect effect, EffectStrength strength) override;
+ ndk::ScopedAStatus alwaysOnDisable(int32_t id) override;
- // Methods from ::android::hardware::vibrator::V1_3::IVibrator follow.
- Return<bool> supportsExternalControl() override;
- Return<Status> setExternalControl(bool enabled) override;
-
- using EffectStrength = ::android::hardware::vibrator::V1_0::EffectStrength;
- Return<void> perform(V1_0::Effect effect, EffectStrength strength,
- perform_cb _hidl_cb) override;
- Return<void> perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength,
- perform_cb _hidl_cb) override;
- Return<void> perform_1_2(V1_2::Effect effect, EffectStrength strength,
- perform_cb _hidl_cb) override;
- Return<void> perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
-
- // Methods from ::android.hidl.base::V1_0::IBase follow.
- Return<void> debug(const hidl_handle &handle, const hidl_vec<hidl_string> &options) override;
+ binder_status_t dump(int fd, const char **args, uint32_t numArgs) override;
private:
- Return<Status> on(uint32_t timeoutMs, const char mode[],
- const std::unique_ptr<VibrationConfig> &config, const int8_t volOffset);
- template <typename T>
- Return<void> performWrapper(T effect, EffectStrength strength, perform_cb _hidl_cb);
- Return<void> performEffect(Effect effect, EffectStrength strength, perform_cb _hidl_cb);
+ ndk::ScopedAStatus on(uint32_t timeoutMs, const char mode[],
+ const std::unique_ptr<VibrationConfig> &config, const int8_t volOffset);
+ ndk::ScopedAStatus performEffect(Effect effect, EffectStrength strength, int32_t *outTimeMs);
+
std::unique_ptr<HwApi> mHwApi;
std::unique_ptr<HwCal> mHwCal;
uint32_t mCloseLoopThreshold;
@@ -201,10 +203,7 @@
bool mDynamicConfig;
};
-} // namespace implementation
-} // namespace V1_3
} // namespace vibrator
} // namespace hardware
} // namespace android
-
-#endif // ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
+} // namespace aidl
diff --git a/vibrator/drv2624/android.hardware.vibrator@1.3-service.redfin.rc b/vibrator/drv2624/android.hardware.vibrator-service.redfin.rc
similarity index 69%
rename from vibrator/drv2624/android.hardware.vibrator@1.3-service.redfin.rc
rename to vibrator/drv2624/android.hardware.vibrator-service.redfin.rc
index 02d6ea4..452b775 100644
--- a/vibrator/drv2624/android.hardware.vibrator@1.3-service.redfin.rc
+++ b/vibrator/drv2624/android.hardware.vibrator-service.redfin.rc
@@ -1,9 +1,9 @@
-service vendor.vibrator-1-3 /vendor/bin/hw/android.hardware.vibrator@1.3-service.redfin
+service vendor.vibrator.redfin /vendor/bin/hw/android.hardware.vibrator-service.redfin
class hal
user system
group system
- setenv PROPERTY_PREFIX ro.vibrator.hal.
+ setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
setenv CALIBRATION_FILEPATH /mnt/vendor/persist/haptics/drv2624.cal
setenv HWAPI_PATH_PREFIX /sys/class/leds/vibrator/
diff --git a/vibrator/drv2624/android.hardware.vibrator-service.redfin.xml b/vibrator/drv2624/android.hardware.vibrator-service.redfin.xml
new file mode 100644
index 0000000..49b11ec
--- /dev/null
+++ b/vibrator/drv2624/android.hardware.vibrator-service.redfin.xml
@@ -0,0 +1,6 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.vibrator</name>
+ <fqname>IVibrator/default</fqname>
+ </hal>
+</manifest>
diff --git a/vibrator/drv2624/android.hardware.vibrator@1.3-service.redfin.xml b/vibrator/drv2624/android.hardware.vibrator@1.3-service.redfin.xml
deleted file mode 100644
index 172aa21..0000000
--- a/vibrator/drv2624/android.hardware.vibrator@1.3-service.redfin.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<manifest version="1.0" type="device">
- <hal format="hidl">
- <name>android.hardware.vibrator</name>
- <transport>hwbinder</transport>
- <version>1.3</version>
- <interface>
- <name>IVibrator</name>
- <instance>default</instance>
- </interface>
- </hal>
-</manifest>
diff --git a/vibrator/drv2624/bench/Android.bp b/vibrator/drv2624/bench/Android.bp
index d7b63ef..0db978c 100644
--- a/vibrator/drv2624/bench/Android.bp
+++ b/vibrator/drv2624/bench/Android.bp
@@ -13,20 +13,3 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-cc_benchmark {
- name: "VibratorHalDrv2624BenchmarkRedfin",
- defaults: ["VibratorHalDrv2624TestDefaultsRedfin"],
- srcs: [
- "benchmark.cpp",
- ],
- static_libs: [
- "libc++fs",
- ],
- shared_libs: [
- "libbase",
- ],
- // TODO(b/135767253): Remove when fixed.
- test_suites: ["device-tests"],
- // TODO(b/142024316): Remove when fixed.
- require_root: true,
-}
diff --git a/vibrator/drv2624/bench/benchmark.cpp b/vibrator/drv2624/bench/benchmark.cpp
index e63da43..61f7f47 100644
--- a/vibrator/drv2624/bench/benchmark.cpp
+++ b/vibrator/drv2624/bench/benchmark.cpp
@@ -21,18 +21,12 @@
#include "Hardware.h"
#include "Vibrator.h"
-using ::android::sp;
-using ::android::hardware::hidl_enum_range;
-
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
using ::android::base::SetProperty;
-using ::android::hardware::vibrator::V1_0::EffectStrength;
-using ::android::hardware::vibrator::V1_0::Status;
class VibratorBench : public benchmark::Fixture {
private:
@@ -71,7 +65,7 @@
SetProperty(std::string() + PROPERTY_PREFIX + "config.dynamic", getDynamicConfig(state));
- mVibrator = new Vibrator(HwApi::Create(), std::make_unique<HwCal>());
+ mVibrator = ndk::SharedRefBase::make<Vibrator>(HwApi::Create(), std::make_unique<HwCal>());
}
static void DefaultConfig(benchmark::internal::Benchmark *b) {
@@ -95,7 +89,7 @@
protected:
TemporaryDir mFilesDir;
- sp<IVibrator> mVibrator;
+ std::shared_ptr<IVibrator> mVibrator;
};
#define BENCHMARK_WRAPPER(fixt, test, code) \
@@ -109,7 +103,7 @@
uint32_t duration = std::rand() ?: 1;
for (auto _ : state) {
- mVibrator->on(duration);
+ mVibrator->on(duration, nullptr);
}
});
@@ -119,12 +113,6 @@
}
});
-BENCHMARK_WRAPPER(VibratorBench, supportsAmplitudeControl, {
- for (auto _ : state) {
- mVibrator->supportsAmplitudeControl();
- }
-});
-
BENCHMARK_WRAPPER(VibratorBench, setAmplitude, {
uint8_t amplitude = std::rand() ?: 1;
@@ -133,12 +121,6 @@
}
});
-BENCHMARK_WRAPPER(VibratorBench, supportsExternalControl, {
- for (auto _ : state) {
- mVibrator->supportsExternalControl();
- }
-});
-
BENCHMARK_WRAPPER(VibratorBench, setExternalControl_enable, {
for (auto _ : state) {
mVibrator->setExternalControl(true);
@@ -151,13 +133,21 @@
}
});
+BENCHMARK_WRAPPER(VibratorBench, getCapabilities, {
+ int32_t capabilities;
+
+ for (auto _ : state) {
+ mVibrator->getCapabilities(&capabilities);
+ }
+});
+
class VibratorEffectsBench : public VibratorBench {
public:
static void DefaultArgs(benchmark::internal::Benchmark *b) {
b->ArgNames({"DynamicConfig", "Effect", "Strength"});
for (const auto &dynamic : {false, true}) {
- for (const auto &effect : hidl_enum_range<Effect>()) {
- for (const auto &strength : hidl_enum_range<EffectStrength>()) {
+ for (const auto &effect : ndk::enum_range<Effect>()) {
+ for (const auto &strength : ndk::enum_range<EffectStrength>()) {
b->Args({dynamic, static_cast<long>(effect), static_cast<long>(strength)});
}
}
@@ -174,30 +164,25 @@
}
};
-BENCHMARK_WRAPPER(VibratorEffectsBench, perform_1_3, {
+BENCHMARK_WRAPPER(VibratorEffectsBench, perform, {
Effect effect = getEffect(state);
EffectStrength strength = getStrength(state);
- bool supported = true;
+ int32_t lengthMs;
- mVibrator->perform_1_3(effect, strength, [&](Status status, uint32_t /*lengthMs*/) {
- if (status == Status::UNSUPPORTED_OPERATION) {
- supported = false;
- }
- });
+ ndk::ScopedAStatus status = mVibrator->perform(effect, strength, nullptr, &lengthMs);
- if (!supported) {
+ if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
return;
}
for (auto _ : state) {
- mVibrator->perform_1_3(effect, strength, [](Status /*status*/, uint32_t /*lengthMs*/) {});
+ mVibrator->perform(effect, strength, nullptr, &lengthMs);
}
});
-} // namespace implementation
-} // namespace V1_3
} // namespace vibrator
} // namespace hardware
} // namespace android
+} // namespace aidl
BENCHMARK_MAIN();
diff --git a/vibrator/drv2624/drv2624.bin b/vibrator/drv2624/drv2624.bin
index 7736404..128665a 100644
--- a/vibrator/drv2624/drv2624.bin
+++ b/vibrator/drv2624/drv2624.bin
Binary files differ
diff --git a/vibrator/drv2624/service.cpp b/vibrator/drv2624/service.cpp
index c0447a7..acc3b8f 100644
--- a/vibrator/drv2624/service.cpp
+++ b/vibrator/drv2624/service.cpp
@@ -13,45 +13,34 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#include <android/hardware/vibrator/1.3/IVibrator.h>
-#include <hidl/HidlSupport.h>
-#include <hidl/HidlTransportSupport.h>
-#include <utils/Errors.h>
-#include <utils/StrongPointer.h>
-
#include "Hardware.h"
#include "Vibrator.h"
-using android::OK;
-using android::sp;
-using android::status_t;
-using android::UNKNOWN_ERROR;
-using android::hardware::configureRpcThreadpool;
-using android::hardware::joinRpcThreadpool;
-using android::hardware::vibrator::V1_3::implementation::HwApi;
-using android::hardware::vibrator::V1_3::implementation::HwCal;
-using android::hardware::vibrator::V1_3::implementation::Vibrator;
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <log/log.h>
-status_t registerVibratorService() {
+using aidl::android::hardware::vibrator::HwApi;
+using aidl::android::hardware::vibrator::HwCal;
+using aidl::android::hardware::vibrator::Vibrator;
+
+int main() {
auto hwapi = HwApi::Create();
if (!hwapi) {
- return UNKNOWN_ERROR;
+ return EXIT_FAILURE;
}
- sp<Vibrator> vibrator = new Vibrator(std::move(hwapi), std::make_unique<HwCal>());
+ // One thread for vibrator APIs and one for sensor callback
+ // WARN: there could be an issue if two vibrator APIs are called simultaneously
+ ABinderProcess_setThreadPoolMaxThreadCount(1);
+ std::shared_ptr<Vibrator> vib =
+ ndk::SharedRefBase::make<Vibrator>(std::move(hwapi), std::make_unique<HwCal>());
- return vibrator->registerAsService();
-}
+ const std::string instance = std::string() + Vibrator::descriptor + "/default";
+ binder_status_t status = AServiceManager_addService(vib->asBinder().get(), instance.c_str());
+ LOG_ALWAYS_FATAL_IF(status != STATUS_OK);
-int main() {
- configureRpcThreadpool(1, true);
- status_t status = registerVibratorService();
-
- if (status != OK) {
- return status;
- }
-
- joinRpcThreadpool();
+ ABinderProcess_joinThreadPool();
+ return EXIT_FAILURE; // should not reach
}
diff --git a/vibrator/drv2624/tests/Android.bp b/vibrator/drv2624/tests/Android.bp
index 2adfc84..0db978c 100644
--- a/vibrator/drv2624/tests/Android.bp
+++ b/vibrator/drv2624/tests/Android.bp
@@ -13,19 +13,3 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-cc_test {
- name: "VibratorHalDrv2624TestSuiteRedfin",
- defaults: ["VibratorHalDrv2624TestDefaultsRedfin"],
- srcs: [
- "test-hwapi.cpp",
- "test-hwcal.cpp",
- "test-vibrator.cpp",
- ],
- static_libs: [
- "libc++fs",
- "libgmock",
- ],
- shared_libs: [
- "libbase",
- ],
-}
diff --git a/vibrator/drv2624/tests/mocks.h b/vibrator/drv2624/tests/mocks.h
index 07b54e2..945be70 100644
--- a/vibrator/drv2624/tests/mocks.h
+++ b/vibrator/drv2624/tests/mocks.h
@@ -18,7 +18,7 @@
#include "Vibrator.h"
-class MockApi : public ::android::hardware::vibrator::V1_3::implementation::Vibrator::HwApi {
+class MockApi : public ::aidl::android::hardware::vibrator::Vibrator::HwApi {
public:
MOCK_METHOD0(destructor, void());
MOCK_METHOD1(setAutocal, bool(std::string value));
@@ -41,7 +41,7 @@
~MockApi() override { destructor(); };
};
-class MockCal : public ::android::hardware::vibrator::V1_3::implementation::Vibrator::HwCal {
+class MockCal : public ::aidl::android::hardware::vibrator::Vibrator::HwCal {
public:
MOCK_METHOD0(destructor, void());
MOCK_METHOD1(getAutocal, bool(std::string &value)); // NOLINT
@@ -61,6 +61,7 @@
MOCK_METHOD1(getEffectShape, bool(uint32_t *value));
MOCK_METHOD1(getSteadyShape, bool(uint32_t *value));
MOCK_METHOD1(getTriggerEffectSupport, bool(uint32_t *value));
+ MOCK_METHOD1(getDevHwVer, bool(std::string &value));
MOCK_METHOD1(debug, void(int fd));
~MockCal() override { destructor(); };
diff --git a/vibrator/drv2624/tests/test-hwapi.cpp b/vibrator/drv2624/tests/test-hwapi.cpp
index fc57f85..6065676 100644
--- a/vibrator/drv2624/tests/test-hwapi.cpp
+++ b/vibrator/drv2624/tests/test-hwapi.cpp
@@ -23,11 +23,10 @@
#include "Hardware.h"
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
using ::testing::Test;
using ::testing::TestParamInfo;
@@ -394,8 +393,7 @@
}),
SetStringTest::PrintParam);
-} // namespace implementation
-} // namespace V1_3
} // namespace vibrator
} // namespace hardware
} // namespace android
+} // namespace aidl
diff --git a/vibrator/drv2624/tests/test-hwcal.cpp b/vibrator/drv2624/tests/test-hwcal.cpp
index b95f943..50fe373 100644
--- a/vibrator/drv2624/tests/test-hwcal.cpp
+++ b/vibrator/drv2624/tests/test-hwcal.cpp
@@ -22,11 +22,10 @@
#include "Hardware.h"
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
using ::android::base::SetProperty;
using ::android::base::WaitForProperty;
@@ -389,8 +388,7 @@
EXPECT_EQ(lraPeriodExpect, lraPeriodActual);
}
-} // namespace implementation
-} // namespace V1_3
} // namespace vibrator
} // namespace hardware
} // namespace android
+} // namespace aidl
diff --git a/vibrator/drv2624/tests/test-vibrator.cpp b/vibrator/drv2624/tests/test-vibrator.cpp
index 47bdfad..d41ed52 100644
--- a/vibrator/drv2624/tests/test-vibrator.cpp
+++ b/vibrator/drv2624/tests/test-vibrator.cpp
@@ -23,14 +23,10 @@
#include "types.h"
#include "utils.h"
+namespace aidl {
namespace android {
namespace hardware {
namespace vibrator {
-namespace V1_3 {
-namespace implementation {
-
-using ::android::hardware::vibrator::V1_0::EffectStrength;
-using ::android::hardware::vibrator::V1_0::Status;
using ::testing::_;
using ::testing::AnyNumber;
@@ -181,7 +177,7 @@
if (relaxed) {
relaxMock(true);
}
- mVibrator = new Vibrator(std::move(mockapi), std::move(mockcal));
+ mVibrator = ndk::SharedRefBase::make<Vibrator>(std::move(mockapi), std::move(mockcal));
if (relaxed) {
relaxMock(false);
}
@@ -191,7 +187,7 @@
if (relaxed) {
relaxMock(true);
}
- mVibrator.clear();
+ mVibrator.reset();
}
void relaxMock(bool relax) {
@@ -235,7 +231,7 @@
protected:
MockApi *mMockApi;
MockCal *mMockCal;
- sp<IVibrator> mVibrator;
+ std::shared_ptr<IVibrator> mVibrator;
EffectDuration mCloseLoopThreshold;
uint32_t mLongFrequencyShift;
@@ -310,7 +306,7 @@
EXPECT_CALL(*mMockApi, setActivate(true)).After(e).WillOnce(DoDefault());
- EXPECT_EQ(Status::OK, mVibrator->on(duration));
+ EXPECT_EQ(EX_NONE, mVibrator->on(duration, nullptr).getExceptionCode());
}
TEST_P(BasicTest, on_openLoop) {
@@ -320,7 +316,7 @@
EXPECT_CALL(*mMockApi, setCtrlLoop(true)).WillOnce(DoDefault());
- EXPECT_EQ(Status::OK, mVibrator->on(duration));
+ EXPECT_EQ(EX_NONE, mVibrator->on(duration, nullptr).getExceptionCode());
}
TEST_P(BasicTest, on_closeLoop) {
@@ -330,45 +326,53 @@
EXPECT_CALL(*mMockApi, setCtrlLoop(false)).WillOnce(DoDefault());
- EXPECT_EQ(Status::OK, mVibrator->on(duration));
+ EXPECT_EQ(EX_NONE, mVibrator->on(duration, nullptr).getExceptionCode());
}
TEST_P(BasicTest, off) {
EXPECT_CALL(*mMockApi, setActivate(false)).WillOnce(DoDefault());
- EXPECT_EQ(Status::OK, mVibrator->off());
+ EXPECT_EQ(EX_NONE, mVibrator->off().getExceptionCode());
}
TEST_P(BasicTest, supportsAmplitudeControl_supported) {
EXPECT_CALL(*mMockApi, hasRtpInput()).WillOnce(Return(true));
- EXPECT_EQ(true, mVibrator->supportsAmplitudeControl());
+ int32_t capabilities;
+ EXPECT_TRUE(mVibrator->getCapabilities(&capabilities).isOk());
+ EXPECT_GT(capabilities & IVibrator::CAP_AMPLITUDE_CONTROL, 0);
}
TEST_P(BasicTest, supportsAmplitudeControl_unsupported) {
EXPECT_CALL(*mMockApi, hasRtpInput()).WillOnce(Return(false));
- EXPECT_EQ(false, mVibrator->supportsAmplitudeControl());
+ int32_t capabilities;
+ EXPECT_TRUE(mVibrator->getCapabilities(&capabilities).isOk());
+ EXPECT_EQ(capabilities & IVibrator::CAP_AMPLITUDE_CONTROL, 0);
}
TEST_P(BasicTest, setAmplitude) {
- EffectAmplitude amplitude = std::rand();
+ EffectAmplitude amplitude = static_cast<float>(std::rand()) / RAND_MAX ?: 1.0f;
EXPECT_CALL(*mMockApi, setRtpInput(amplitudeToRtpInput(amplitude))).WillOnce(Return(true));
- EXPECT_EQ(Status::OK, mVibrator->setAmplitude(amplitude));
+ EXPECT_EQ(EX_NONE, mVibrator->setAmplitude(amplitude).getExceptionCode());
}
TEST_P(BasicTest, supportsExternalControl_unsupported) {
- EXPECT_EQ(false, mVibrator->supportsExternalControl());
+ EXPECT_CALL(*mMockApi, hasRtpInput()).WillOnce(Return(false));
+
+ int32_t capabilities;
+ EXPECT_TRUE(mVibrator->getCapabilities(&capabilities).isOk());
+ EXPECT_EQ(capabilities & IVibrator::CAP_EXTERNAL_CONTROL, 0);
}
TEST_P(BasicTest, setExternalControl_enable) {
- EXPECT_EQ(Status::UNSUPPORTED_OPERATION, mVibrator->setExternalControl(true));
+ EXPECT_EQ(EX_UNSUPPORTED_OPERATION, mVibrator->setExternalControl(true).getExceptionCode());
}
TEST_P(BasicTest, setExternalControl_disable) {
- EXPECT_EQ(Status::UNSUPPORTED_OPERATION, mVibrator->setExternalControl(false));
+ EXPECT_EQ(EX_UNSUPPORTED_OPERATION, mVibrator->setExternalControl(false).getExceptionCode());
}
INSTANTIATE_TEST_CASE_P(VibratorTests, BasicTest,
@@ -423,27 +427,25 @@
duration = 0;
}
- mVibrator->perform_1_3(effect, strength, [&](Status status, uint32_t lengthMs) {
- if (duration) {
- EXPECT_EQ(Status::OK, status);
- EXPECT_LE(duration, lengthMs);
- } else {
- EXPECT_EQ(Status::UNSUPPORTED_OPERATION, status);
- EXPECT_EQ(0, lengthMs);
- }
- });
+ int32_t lengthMs;
+ ndk::ScopedAStatus status = mVibrator->perform(effect, strength, nullptr, &lengthMs);
+ if (duration) {
+ EXPECT_EQ(EX_NONE, status.getExceptionCode());
+ EXPECT_LE(duration, lengthMs);
+ } else {
+ EXPECT_EQ(EX_UNSUPPORTED_OPERATION, status.getExceptionCode());
+ }
}
INSTANTIATE_TEST_CASE_P(VibratorTests, EffectsTest,
Combine(ValuesIn({false, true}),
- Combine(ValuesIn(hidl_enum_range<Effect>().begin(),
- hidl_enum_range<Effect>().end()),
- ValuesIn(hidl_enum_range<EffectStrength>().begin(),
- hidl_enum_range<EffectStrength>().end()))),
+ Combine(ValuesIn(ndk::enum_range<Effect>().begin(),
+ ndk::enum_range<Effect>().end()),
+ ValuesIn(ndk::enum_range<EffectStrength>().begin(),
+ ndk::enum_range<EffectStrength>().end()))),
EffectsTest::PrintParam);
-} // namespace implementation
-} // namespace V1_3
} // namespace vibrator
} // namespace hardware
} // namespace android
+} // namespace aidl
diff --git a/vibrator/drv2624/tests/types.h b/vibrator/drv2624/tests/types.h
index 60be69c..6ff21a6 100644
--- a/vibrator/drv2624/tests/types.h
+++ b/vibrator/drv2624/tests/types.h
@@ -16,12 +16,12 @@
#ifndef ANDROID_HARDWARE_VIBRATOR_TEST_TYPES_H
#define ANDROID_HARDWARE_VIBRATOR_TEST_TYPES_H
-#include <android/hardware/vibrator/1.3/IVibrator.h>
+#include <aidl/android/hardware/vibrator/IVibrator.h>
-using EffectAmplitude = uint8_t;
+using EffectAmplitude = float;
using EffectDuration = uint32_t;
using EffectSequence = std::tuple<std::string, uint8_t>;
-using EffectTuple = std::tuple<::android::hardware::vibrator::V1_3::Effect,
- ::android::hardware::vibrator::V1_0::EffectStrength>;
+using EffectTuple = std::tuple<::aidl::android::hardware::vibrator::Effect,
+ ::aidl::android::hardware::vibrator::EffectStrength>;
#endif // ANDROID_HARDWARE_VIBRATOR_TEST_TYPES_H
diff --git a/vibrator/drv2624/tests/utils.h b/vibrator/drv2624/tests/utils.h
index 5fe4b62..766ac5c 100644
--- a/vibrator/drv2624/tests/utils.h
+++ b/vibrator/drv2624/tests/utils.h
@@ -21,7 +21,7 @@
#include "types.h"
static inline int32_t amplitudeToRtpInput(EffectAmplitude amplitude) {
- return std::round((amplitude - 1) / 254.0 * 127);
+ return std::round(amplitude * 127);
}
#endif // ANDROID_HARDWARE_VIBRATOR_TEST_UTILS_H