[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master. am: 06bbcebaba -s ours
am: 17e0b73129 -s ours
am skip reason: subject contains skip directive

Change-Id: I7c1aa469c1ab38a0e78dfe131cd16f404412d83e
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index d8467dd..8183936 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -14,22 +14,25 @@
 # limitations under the License.
 #
 
+include build/make/target/board/BoardConfigMainlineCommon.mk
+
 TARGET_BOARD_PLATFORM := sdm710
 TARGET_BOARD_INFO_FILE := device/google/bonito/board-info.txt
 USES_DEVICE_GOOGLE_B4S4 := true
-TARGET_NO_BOOTLOADER := true
 
 TARGET_ARCH := arm64
-TARGET_ARCH_VARIANT := armv8-2a
+TARGET_ARCH_VARIANT := armv8-a
 TARGET_CPU_ABI := arm64-v8a
 TARGET_CPU_ABI2 :=
-TARGET_CPU_VARIANT := cortex-a75
+TARGET_CPU_VARIANT := generic
+TARGET_CPU_VARIANT_RUNTIME := cortex-a75
 
 TARGET_2ND_ARCH := arm
-TARGET_2ND_ARCH_VARIANT := armv8-2a
+TARGET_2ND_ARCH_VARIANT := armv8-a
 TARGET_2ND_CPU_ABI := armeabi-v7a
 TARGET_2ND_CPU_ABI2 := armeabi
-TARGET_2ND_CPU_VARIANT := cortex-a75
+TARGET_2ND_CPU_VARIANT := generic
+TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a75
 
 TARGET_BOARD_COMMON_PATH := device/google/bonito/sdm710
 
@@ -44,6 +47,7 @@
 # STOPSHIP Bringup hack- no low power
 BOARD_KERNEL_CMDLINE += lpm_levels.sleep_disabled=1
 BOARD_KERNEL_CMDLINE += loop.max_part=7
+BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/7c4000.sdhci
 
 BOARD_KERNEL_BASE        := 0x00000000
 BOARD_KERNEL_PAGESIZE    := 4096
@@ -57,20 +61,29 @@
 BOARD_RAMDISK_OFFSET     := 0x02000000
 endif
 
-BOARD_BOOT_HEADER_VERSION := 1
+BOARD_INCLUDE_DTB_IN_BOOTIMG := true
+BOARD_BOOT_HEADER_VERSION := 2
 BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
 
 # DTBO partition definitions
 BOARD_PREBUILT_DTBOIMAGE := device/google/bonito-kernel/dtbo.img
 BOARD_DTBOIMG_PARTITION_SIZE := 8388608
 
-TARGET_NO_BOOTLOADER ?= true
 TARGET_NO_KERNEL := false
-TARGET_NO_RECOVERY := true
 BOARD_USES_RECOVERY_AS_BOOT := true
-BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
 BOARD_USES_METADATA_PARTITION := true
 
+AB_OTA_UPDATER := true
+
+AB_OTA_PARTITIONS += \
+    boot \
+    system \
+    vbmeta \
+    dtbo \
+    product
+
+BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
+
 # Partitions (listed in the file) to be wiped under recovery.
 TARGET_RECOVERY_WIPE := device/google/bonito/recovery.wipe
 TARGET_RECOVERY_FSTAB := device/google/bonito/fstab.hardware
@@ -80,24 +93,8 @@
   libnos_citadel_for_recovery \
   libnos_for_recovery
 
-BOARD_AVB_ENABLE := true
-BOARD_AVB_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
-
-# Enable chain partition for system.
-BOARD_AVB_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
-BOARD_AVB_SYSTEM_ALGORITHM := SHA256_RSA2048
-BOARD_AVB_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
-BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
-
-BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
-
 # system.img
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3267362816
 BOARD_SYSTEMIMAGE_JOURNAL_SIZE := 0
-BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 4096
-
-# userdata.img
-TARGET_USERIMAGES_USE_EXT4 := true
 
 # persist.img
 BOARD_PERSISTIMAGE_PARTITION_SIZE := 41943040
@@ -106,13 +103,24 @@
 # boot.img
 BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
 
-TARGET_COPY_OUT_VENDOR := vendor
+BOARD_EXT4_SHARE_DUP_BLOCKS := true
+BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
+BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
+    system \
+    vendor \
+    product
+
+BOARD_SUPER_PARTITION_SIZE := 4072669184
+BOARD_SUPER_PARTITION_METADATA_DEVICE := system
+BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor
+BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 3267362816
+BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 805306368
+# Assume 4MB metadata size.
+# TODO(b/117997386): Use correct metadata size.
+BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 4068474880
 
 BOARD_FLASH_BLOCK_SIZE := 131072
 
-# Install odex files into the other system image
-BOARD_USES_SYSTEM_OTHER_ODEX := true
-
 BOARD_ROOT_EXTRA_SYMLINKS := /mnt/vendor/persist:/persist
 BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt:/firmware
 BOARD_ROOT_EXTRA_SYMLINKS += /vendor/dsp:/dsp
@@ -123,19 +131,7 @@
 
 QCOM_BOARD_PLATFORMS += sdm710
 BOARD_HAVE_BLUETOOTH_QCOM := true
-BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/google/bonito/bluetooth
-
-# Enable dex pre-opt to speed up initial boot
-ifeq ($(HOST_OS),linux)
-  ifeq ($(WITH_DEXPREOPT),)
-    WITH_DEXPREOPT := true
-    WITH_DEXPREOPT_PIC := true
-    ifneq ($(TARGET_BUILD_VARIANT),user)
-      # Retain classes.dex in APK's for non-user builds
-      DEX_PREOPT_DEFAULT := nostripping
-    endif
-  endif
-endif
+BOARD_USES_COMMON_BLUETOOTH_HAL := true
 
 # Camera
 TARGET_USES_AOSP := true
@@ -170,7 +166,6 @@
 
 # Audio
 BOARD_USES_ALSA_AUDIO := true
-USE_XML_AUDIO_POLICY_CONF := 1
 AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
 AUDIO_FEATURE_ENABLED_SND_MONITOR := true
 AUDIO_FEATURE_ENABLED_USB_TUNNEL := true
@@ -185,46 +180,54 @@
 # Graphics
 TARGET_USES_GRALLOC1 := true
 TARGET_USES_HWC2 := true
+TARGET_USES_NV21_CAMERA_PREVIEW := true
 
 VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
 SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
 
 # Display
 TARGET_HAS_WIDE_COLOR_DISPLAY := true
-TARGET_HAS_HDR_DISPLAY := true
 TARGET_USES_DISPLAY_RENDER_INTENTS := true
 TARGET_USES_COLOR_METADATA := true
 TARGET_USES_DRM_PP := true
 
-# Charger Mode
-BOARD_CHARGER_ENABLE_SUSPEND := true
-
 # Vendor Interface Manifest
 DEVICE_MANIFEST_FILE := device/google/bonito/manifest.xml
 DEVICE_MATRIX_FILE := device/google/bonito/compatibility_matrix.xml
 DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := device/google/bonito/device_framework_matrix.xml
-DEVICE_FRAMEWORK_MANIFEST_FILE := device/google/bonito/framework_manifest.xml
 
 # Userdebug only Vendor Interface Manifest
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
-DEVICE_MANIFEST_FILE += device/google/bonito/manifest_userdebug.xml
+DEVICE_FRAMEWORK_MANIFEST_FILE += device/google/bonito/framework_manifest_userdebug.xml
+DEVICE_MATRIX_FILE += device/google/bonito/compatibility_matrix_userdebug.xml
 endif
 
-BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
+ODM_MANIFEST_SKUS := \
+    G020A \
+    G020B \
+    G020C \
+    G020D \
+    G020E \
+    G020F \
+    G020G \
+    G020H \
+
+ODM_MANIFEST_G020A_FILES := device/google/bonito/nfc/manifest_se_SIM1.xml
+ODM_MANIFEST_G020B_FILES := device/google/bonito/nfc/manifest_se_SIM1.xml
+ODM_MANIFEST_G020C_FILES := device/google/bonito/nfc/manifest_se_SIM1.xml
+ODM_MANIFEST_G020D_FILES := device/google/bonito/nfc/manifest_se_eSE1.xml
+ODM_MANIFEST_G020E_FILES := device/google/bonito/nfc/manifest_se_SIM1.xml
+ODM_MANIFEST_G020F_FILES := device/google/bonito/nfc/manifest_se_SIM1.xml
+ODM_MANIFEST_G020G_FILES := device/google/bonito/nfc/manifest_se_SIM1.xml
+ODM_MANIFEST_G020H_FILES := device/google/bonito/nfc/manifest_se_eSE1.xml
 
 # Use mke2fs to create ext4 images
 TARGET_USES_MKE2FS := true
 
 # Kernel modules
-ifeq (,$(filter-out sargo_gcc bonito_gcc, $(TARGET_PRODUCT)))
-BOARD_VENDOR_KERNEL_MODULES += \
-    $(wildcard device/google/bonito-kernel/gcc/*.ko)
-else ifeq (,$(filter-out sargo_kasan bonito_kasan, $(TARGET_PRODUCT)))
+ifeq (,$(filter-out sargo_kasan bonito_kasan, $(TARGET_PRODUCT)))
 BOARD_VENDOR_KERNEL_MODULES += \
     $(wildcard device/google/bonito-kernel/kasan/*.ko)
-else ifeq (,$(filter-out sargo_kcfi bonito_kcfi, $(TARGET_PRODUCT)))
-BOARD_VENDOR_KERNEL_MODULES += \
-    $(wildcard device/google/bonito-kernel/kcfi/*.ko)
 else ifeq (,$(filter-out sargo_kernel_debug_memory bonito_kernel_debug_memory, $(TARGET_PRODUCT)))
 BOARD_VENDOR_KERNEL_MODULES += \
     $(wildcard device/google/bonito-kernel/debug_memory/*.ko)
@@ -242,10 +245,22 @@
     $(wildcard device/google/bonito-kernel/*.ko)
 endif
 
+# DTB
+ifeq (,$(filter-out sargo_kasan bonito_kasan, $(TARGET_PRODUCT)))
+BOARD_PREBUILT_DTBIMAGE_DIR := device/google/bonito-kernel/kasan
+else ifeq (,$(filter-out sargo_kernel_debug_memory bonito_kernel_debug_memory, $(TARGET_PRODUCT)))
+BOARD_PREBUILT_DTBIMAGE_DIR := device/google/bonito-kernel/debug_memory
+else ifeq (,$(filter-out sargo_kernel_debug_locking bonito_kernel_debug_locking, $(TARGET_PRODUCT)))
+BOARD_PREBUILT_DTBIMAGE_DIR := device/google/bonito-kernel/debug_locking
+else ifeq (,$(filter-out sargo_kernel_debug_hang bonito_kernel_debug_hang, $(TARGET_PRODUCT)))
+BOARD_PREBUILT_DTBIMAGE_DIR := device/google/bonito-kernel/debug_hang
+else ifeq (,$(filter-out sargo_kernel_debug_api bonito_kernel_debug_api, $(TARGET_PRODUCT)))
+BOARD_PREBUILT_DTBIMAGE_DIR := device/google/bonito-kernel/debug_api
+else
+BOARD_PREBUILT_DTBIMAGE_DIR := device/google/bonito-kernel
+endif
+
 # Testing related defines
 BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/b4s4-setup.sh
 
-# Single vendor RIL with SDM845
-BOARD_USES_SDM845_QCRIL := true
-
 -include vendor/google_devices/bonito/proprietary/BoardConfigVendor.mk
diff --git a/CleanSpec.mk b/CleanSpec.mk
index a13483a..1c5f544 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -136,5 +136,37 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/product)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product)
 
+# Remove init.environ.rc to force product to be recreated on other devices
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/init.environ.rc)
+
+# Verified boot xml moved to /product
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.software.verified_boot.xml)
+
 # Move libnfc-nci.conf to /vendor
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/libnfc-nci.conf)
+
+# ThermalHAL 1.1
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.thermal@1.1-service.bonito.rc)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.thermal@1.1-service.bonito)
+
+# Move fingerprint input files to /vendor
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/usr/keylayout/uinput-fpc.kl)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/usr/idc/uinput-fpc.idc)
+
+# Recovery init files moved to recovery
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/init.recovery.*.rc)
+
+# Add product partition
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/product)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/framework)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/usr)
+
+# Rename power HAL
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.power@1.3-service.bonito-libperfmgr.rc)
diff --git a/aosp_bonito.mk b/aosp_bonito.mk
index 8bc25b3..df6bd1b 100644
--- a/aosp_bonito.mk
+++ b/aosp_bonito.mk
@@ -16,15 +16,19 @@
 
 # Inherit from the common Open Source product configuration
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline.mk)
 
 $(call inherit-product, device/google/bonito/device-bonito.mk)
 $(call inherit-product-if-exists, vendor/google_devices/bonito/proprietary/device-vendor.mk)
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.config.ringtone=Ring_Synth_04.ogg \
+    ro.com.android.dataroaming=true \
+
 PRODUCT_PACKAGES += \
-    Dialer \
-    Launcher3 \
-    WallpaperPicker
+    PhotoTable \
+    WallpaperPicker \
+    WAPPushManager \
 
 # STOPSHIP deal with Qualcomm stuff later
 # PRODUCT_RESTRICT_VENDOR_FILES := all
@@ -35,7 +39,6 @@
 PRODUCT_DEVICE := bonito
 PRODUCT_MODEL := AOSP on bonito
 
-# Audio XMLs
 PRODUCT_COPY_FILES += \
+    device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml \
     $(LOCAL_PATH)/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml
-
diff --git a/aosp_sargo.mk b/aosp_sargo.mk
index bafac67..2b00316 100644
--- a/aosp_sargo.mk
+++ b/aosp_sargo.mk
@@ -16,15 +16,19 @@
 
 # Inherit from the common Open Source product configuration
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline.mk)
 
 $(call inherit-product, device/google/bonito/device-sargo.mk)
 $(call inherit-product-if-exists, vendor/google_devices/bonito/proprietary/device-vendor.mk)
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.config.ringtone=Ring_Synth_04.ogg \
+    ro.com.android.dataroaming=true \
+
 PRODUCT_PACKAGES += \
-    Dialer \
-    Launcher3 \
-    WallpaperPicker
+    PhotoTable \
+    WallpaperPicker \
+    WAPPushManager \
 
 # STOPSHIP deal with Qualcomm stuff later
 # PRODUCT_RESTRICT_VENDOR_FILES := all
@@ -35,7 +39,6 @@
 PRODUCT_DEVICE := sargo
 PRODUCT_MODEL := AOSP on sargo
 
-# Audio XMLs
 PRODUCT_COPY_FILES += \
+    device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml \
     $(LOCAL_PATH)/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml
-
diff --git a/audio/rt5514_dsp_fw1.bin b/audio/rt5514_dsp_fw1.bin
index 1b7ea9f..ea6b5bb 100644
--- a/audio/rt5514_dsp_fw1.bin
+++ b/audio/rt5514_dsp_fw1.bin
Binary files differ
diff --git a/audio/rt5514_dsp_fw2.bin b/audio/rt5514_dsp_fw2.bin
index bb8b13b..138878e 100644
--- a/audio/rt5514_dsp_fw2.bin
+++ b/audio/rt5514_dsp_fw2.bin
Binary files differ
diff --git a/audio/rt5514_dsp_fw3.bin b/audio/rt5514_dsp_fw3.bin
index 0d90a93..77877cd 100644
--- a/audio/rt5514_dsp_fw3.bin
+++ b/audio/rt5514_dsp_fw3.bin
Binary files differ
diff --git a/audio/rt5514_dsp_fw4.bin b/audio/rt5514_dsp_fw4.bin
index 9e334a1..c2b3129 100644
--- a/audio/rt5514_dsp_fw4.bin
+++ b/audio/rt5514_dsp_fw4.bin
Binary files differ
diff --git a/audio_platform_info_intcodec_b4.xml b/audio_platform_info_intcodec_b4.xml
index b18b5b3..d3d5c38 100644
--- a/audio_platform_info_intcodec_b4.xml
+++ b/audio_platform_info_intcodec_b4.xml
@@ -66,6 +66,8 @@
         <device name="SND_DEVICE_IN_CAMCORDER_SELFIE_LANDSCAPE" acdb_id="61"/>
         <device name="SND_DEVICE_IN_CAMCORDER_SELFIE_INVERT_LANDSCAPE" acdb_id="61"/>
         <device name="SND_DEVICE_IN_CAMCORDER_SELFIE_PORTRAIT" acdb_id="61"/>
+        <device name="SND_DEVICE_OUT_VOICE_HEARING_AID" acdb_id="10"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="19"/>
 
         <!-- TTY -->
         <device name="SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET" acdb_id="14"/>
@@ -124,6 +126,11 @@
         <param key="operator_info" value="tmus;310210"/>
         <param key="operator_info" value="tmus;310200"/>
         <param key="operator_info" value="tmus;310160"/>
+        <param key="operator_info" value="tmus;20404"/>
+        <param key="operator_info" value="tmus;311220"/>
+        <param key="operator_info" value="tmus;310066"/>
+        <param key="operator_info" value="tmus;310730"/>
+        <param key="operator_info" value="tmus;00101"/>
     </config_params>
 
     <operator_specific>
@@ -200,6 +207,7 @@
         <device name="SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_VOICE_REC_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" backend="speaker-mic" interface="PRI_TDM_TX_0"/>
 
     </backend_names>
     <app_types>
diff --git a/audio_platform_info_intcodec_b4dev.xml b/audio_platform_info_intcodec_b4dev.xml
index 6140bc0..6a10e3f 100644
--- a/audio_platform_info_intcodec_b4dev.xml
+++ b/audio_platform_info_intcodec_b4dev.xml
@@ -39,6 +39,8 @@
         <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" acdb_id="147"/>
         <device name="SND_DEVICE_IN_HANDSET_MIC" acdb_id="41"/>
         <device name="SND_DEVICE_IN_VOICE_SPEAKER_MIC" acdb_id="19"/>
+        <device name="SND_DEVICE_OUT_VOICE_HEARING_AID" acdb_id="10"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="19"/>
 
         <!-- TTY -->
         <device name="SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET" acdb_id="14"/>
@@ -144,6 +146,8 @@
         <device name="SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_VOICE_REC_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" backend="speaker-mic" interface="PRI_TDM_TX_0"/>
+
     </backend_names>
     <app_types>
         <app uc_type="PCM_PLAYBACK" mode="default" bit_width="16" id="69936" max_rate="96000" />
diff --git a/audio_platform_info_intcodec_s4.xml b/audio_platform_info_intcodec_s4.xml
index 0a31eef..87eb993 100644
--- a/audio_platform_info_intcodec_s4.xml
+++ b/audio_platform_info_intcodec_s4.xml
@@ -66,6 +66,8 @@
         <device name="SND_DEVICE_IN_CAMCORDER_SELFIE_LANDSCAPE" acdb_id="61"/>
         <device name="SND_DEVICE_IN_CAMCORDER_SELFIE_INVERT_LANDSCAPE" acdb_id="61"/>
         <device name="SND_DEVICE_IN_CAMCORDER_SELFIE_PORTRAIT" acdb_id="61"/>
+        <device name="SND_DEVICE_OUT_VOICE_HEARING_AID" acdb_id="10"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="19"/>
 
         <!-- TTY -->
         <device name="SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET" acdb_id="14"/>
@@ -124,6 +126,11 @@
         <param key="operator_info" value="tmus;310210"/>
         <param key="operator_info" value="tmus;310200"/>
         <param key="operator_info" value="tmus;310160"/>
+        <param key="operator_info" value="tmus;20404"/>
+        <param key="operator_info" value="tmus;311220"/>
+        <param key="operator_info" value="tmus;310066"/>
+        <param key="operator_info" value="tmus;310730"/>
+        <param key="operator_info" value="tmus;00101"/>
     </config_params>
 
     <operator_specific>
@@ -200,6 +207,7 @@
         <device name="SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_VOICE_REC_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" backend="speaker-mic" interface="PRI_TDM_TX_0"/>
 
     </backend_names>
     <app_types>
diff --git a/audio_platform_info_intcodec_s4dev.xml b/audio_platform_info_intcodec_s4dev.xml
index cadb288..bfcfae7 100644
--- a/audio_platform_info_intcodec_s4dev.xml
+++ b/audio_platform_info_intcodec_s4dev.xml
@@ -39,6 +39,8 @@
         <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" acdb_id="147"/>
         <device name="SND_DEVICE_IN_HANDSET_MIC" acdb_id="41"/>
         <device name="SND_DEVICE_IN_VOICE_SPEAKER_MIC" acdb_id="19"/>
+        <device name="SND_DEVICE_OUT_VOICE_HEARING_AID" acdb_id="10"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="19"/>
 
         <!-- TTY -->
         <device name="SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET" acdb_id="14"/>
@@ -144,6 +146,8 @@
         <device name="SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_VOICE_REC_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
         <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" backend="headset-mic" interface="INT3_MI2S_TX"/>
+        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" backend="speaker-mic" interface="PRI_TDM_TX_0"/>
+
     </backend_names>
     <app_types>
         <app uc_type="PCM_PLAYBACK" mode="default" bit_width="16" id="69936" max_rate="96000" />
diff --git a/audio_policy_configuration.xml b/audio_policy_configuration.xml
index 84bea78..7ad24ee 100644
--- a/audio_policy_configuration.xml
+++ b/audio_policy_configuration.xml
@@ -130,15 +130,18 @@
                 </devicePort>
                 <devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
                 </devicePort>
-                <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink">
+                <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink"
+                            encodedFormats="AUDIO_FORMAT_LDAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="44100,48000,88200,96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </devicePort>
-                <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink">
+                <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink"
+                            encodedFormats="AUDIO_FORMAT_LDAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="44100,48000,88200,96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </devicePort>
-                <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink">
+                <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink"
+                            encodedFormats="AUDIO_FORMAT_LDAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="44100,48000,88200,96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </devicePort>
diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h
deleted file mode 100644
index 63515b1..0000000
--- a/bluetooth/bdroid_buildcfg.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- *  Copyright (c) 2013, The Linux Foundation. All rights reserved.
- *  Not a Contribution, Apache license notifications and license are retained
- *  for attribution purposes only.
- *
- * Copyright (C) 2012 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 _BDROID_BUILDCFG_H
-#define _BDROID_BUILDCFG_H
-
-// Wide-band speech support
-#define BTM_WBS_INCLUDED TRUE
-#define BTIF_HF_WBS_PREFERRED TRUE
-
-// Google VSC spec support
-#define BLE_VND_INCLUDED TRUE
-
-// QCOM power management workaround
-#define BT_CLEAN_TURN_ON_DISABLED TRUE
-
-#endif
diff --git a/bonito/BoardConfig.mk b/bonito/BoardConfig.mk
index 8aa96bf..ae6a06c 100644
--- a/bonito/BoardConfig.mk
+++ b/bonito/BoardConfig.mk
@@ -15,6 +15,7 @@
 #
 
 TARGET_BOOTLOADER_BOARD_NAME := bonito
+TARGET_SCREEN_DENSITY := 400
 TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165
 
 include device/google/bonito/BoardConfig-common.mk
diff --git a/bonito/init.bonito.rc b/bonito/init.bonito.rc
index e9bc40f..a3a0312 100644
--- a/bonito/init.bonito.rc
+++ b/bonito/init.bonito.rc
@@ -16,9 +16,6 @@
 
 import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.rc
 
-on init
-    setprop ro.sf.lcd_density 400
-
 on property:sys.boot_completed=1
     # HardwareInfo needs to be able to read display info
     chmod 444 /sys/devices/platform/soc/soc:qcom,dsi-display@50/panel_info/panel0/serial_number
diff --git a/bonito/overlay/frameworks/base/core/res/res/values/config.xml b/bonito/overlay/frameworks/base/core/res/res/values/config.xml
index 2874261..0c28a5a 100755
--- a/bonito/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/bonito/overlay/frameworks/base/core/res/res/values/config.xml
@@ -42,7 +42,7 @@
 
     <!-- Enable doze mode
          ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
-    <string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
+    <string translatable="false" name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
 
     <!-- Type of the double tap sensor. Empty if double tap is not supported. -->
     <string name="config_dozeDoubleTapSensorType" translatable="false">com.google.sensor.double_touch</string>
@@ -685,6 +685,7 @@
         <item>G020D</item>
     </string-array>
 
-    <dimen name="rounded_corner_radius_top">42px</dimen>
-    <dimen name="rounded_corner_radius_bottom">43px</dimen>
+    <dimen name="rounded_corner_radius_top">38px</dimen>
+    <dimen name="rounded_corner_radius_bottom">39px</dimen>
+
 </resources>
diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml
index e0be262..8b06eef 100644
--- a/compatibility_matrix.xml
+++ b/compatibility_matrix.xml
@@ -55,12 +55,4 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="true">
-        <name>hardware.google.pixelstats</name>
-        <version>1.0</version>
-        <interface>
-          <name>IPixelStats</name>
-          <instance>default</instance>
-        </interface>
-    </hal>
 </compatibility-matrix>
diff --git a/manifest_userdebug.xml b/compatibility_matrix_userdebug.xml
similarity index 66%
copy from manifest_userdebug.xml
copy to compatibility_matrix_userdebug.xml
index cd72075..d678a59 100644
--- a/manifest_userdebug.xml
+++ b/compatibility_matrix_userdebug.xml
@@ -1,11 +1,10 @@
-<manifest version="1.0" type="device">
-    <hal format="hidl">
+<compatibility-matrix version="1.0" type="device">
+    <hal format="hidl" optional="true">
         <name>vendor.qti.hardware.radio.atcmdfwd</name>
-        <transport>hwbinder</transport>
         <version>1.0</version>
         <interface>
             <name>IAtCmdFwd</name>
             <instance>AtCmdFwdService</instance>
         </interface>
     </hal>
-</manifest>
+</compatibility-matrix>
diff --git a/config.fs b/config.fs
index a4a0d20..797c89e 100644
--- a/config.fs
+++ b/config.fs
@@ -17,9 +17,6 @@
 # images generated by build tools (mkbootfs and mkyaffs2image) and
 # by the device side of adb.
 
-[AID_VENDOR_PIXELSTATS_SYSTEM]
-value: 2900
-
 [AID_VENDOR_QDSS]
 value:2902
 
diff --git a/default-permissions.xml b/default-permissions.xml
index fb75eaf..ba23a54 100644
--- a/default-permissions.xml
+++ b/default-permissions.xml
@@ -109,6 +109,7 @@
         <permission name="android.permission.READ_CALENDAR" fixed="true"/>
         <!-- Location -->
         <permission name="android.permission.ACCESS_FINE_LOCATION" fixed="true"/>
+        <permission name="android.permission.ACCESS_BACKGROUND_LOCATION" fixed="true"/>
     </exception>
 
     <exception package="com.google.android.wfcactivation">
diff --git a/device-bonito.mk b/device-bonito.mk
index da2eb08..f98bd39 100644
--- a/device-bonito.mk
+++ b/device-bonito.mk
@@ -14,10 +14,6 @@
 # limitations under the License.
 #
 
-PRODUCT_AAPT_CONFIG := normal
-PRODUCT_AAPT_PREF_CONFIG := 400dpi
-PRODUCT_AAPT_PREBUILT_DPI := xxhdpi xhdpi hdpi
-
 PRODUCT_HARDWARE := bonito
 
 include device/google/bonito/device-common.mk
@@ -28,7 +24,7 @@
     device/google/bonito/nfc/libnfc-nxp.bonito.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nxp.conf
 
 # Vibrator HAL
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES +=\
+PRODUCT_PRODUCT_PROPERTIES +=\
     ro.vibrator.hal.click.duration=8 \
     ro.vibrator.hal.tick.duration=5 \
     ro.vibrator.hal.heavyclick.duration=12 \
diff --git a/device-common.mk b/device-common.mk
index efa32ce..34b8327 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -35,7 +35,7 @@
 PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank=512
 
 # Setting vendor SPL
-VENDOR_SECURITY_PATCH = "2018-09-05"
+VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
 
 # MIDI feature
 PRODUCT_COPY_FILES += \
@@ -67,7 +67,7 @@
 PRODUCT_PROPERTY_OVERRIDES += aaudio.hw_burst_min_usec=2000
 
 # Set lmkd options
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     ro.lmk.low=1001 \
     ro.lmk.medium=800 \
     ro.lmk.critical=0 \
@@ -100,3 +100,27 @@
 # Dumpstate HAL
 PRODUCT_PACKAGES += \
     android.hardware.dumpstate@1.0-service.bonito
+
+# Enable retrofit dynamic partitions for all bonito
+# and sargo targets
+PRODUCT_USE_DYNAMIC_PARTITIONS := true
+PRODUCT_RETROFIT_DYNAMIC_PARTITIONS := true
+PRODUCT_PACKAGES += \
+    android.hardware.boot@1.0-impl.recovery \
+    bootctrl.sdm710 \
+    bootctrl.sdm710.recovery \
+    check_dynamic_partitions \
+
+AB_OTA_POSTINSTALL_CONFIG += \
+    RUN_POSTINSTALL_product=true \
+    POSTINSTALL_PATH_product=bin/check_dynamic_partitions \
+    FILESYSTEM_TYPE_product=ext4 \
+    POSTINSTALL_OPTIONAL_product=false \
+
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_color_management=true
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.has_wide_color_display=true
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.protected_contents=true
+
+# Must align with HAL types Dataspace
+# The data space of wide color gamut composition preference is Dataspace::DISPLAY_P3
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.wcg_composition_dataspace=143261696
diff --git a/device-sargo.mk b/device-sargo.mk
index 2edf645..8362fd2 100644
--- a/device-sargo.mk
+++ b/device-sargo.mk
@@ -14,10 +14,6 @@
 # limitations under the License.
 #
 
-PRODUCT_AAPT_CONFIG := normal
-PRODUCT_AAPT_PREF_CONFIG := xxhdpi
-PRODUCT_AAPT_PREBUILT_DPI := xxhdpi xhdpi hdpi
-
 PRODUCT_HARDWARE := sargo
 
 include device/google/bonito/device-common.mk
@@ -27,10 +23,10 @@
 PRODUCT_COPY_FILES += \
     device/google/bonito/nfc/libnfc-nxp.sargo.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nxp.conf
 
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.com.google.ime.height_ratio=1.2
+PRODUCT_PRODUCT_PROPERTIES += ro.com.google.ime.height_ratio=1.2
 
 # Vibrator HAL
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES +=\
+PRODUCT_PRODUCT_PROPERTIES +=\
     ro.vibrator.hal.click.duration=8 \
     ro.vibrator.hal.tick.duration=5 \
     ro.vibrator.hal.heavyclick.duration=12 \
diff --git a/device.mk b/device.mk
index c08ad83..d2c7b98 100644
--- a/device.mk
+++ b/device.mk
@@ -21,34 +21,34 @@
     hardware/google/av \
     hardware/google/interfaces \
     hardware/google/pixel \
-    hardware/qcom/sdm710 \
-    vendor/qcom/sdm710
+    hardware/qcom/sdm845 \
+    vendor/google/camera \
+    vendor/qcom/sdm845 \
+    vendor/google/interfaces
 
 PRODUCT_PROPERTY_OVERRIDES += \
     keyguard.no_require_sim=true
 
 # enable cal by default on accel sensor
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     persist.debug.sensors.accel_cal=1
 
 # The default value of this variable is false and should only be set to true when
 # the device allows users to retain eSIM profiles after factory reset of user data.
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     masterclear.allow_retain_esim_profiles_after_fdr=true
 
 PRODUCT_COPY_FILES += \
     device/google/bonito/default-permissions.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default-permissions/default-permissions.xml \
     frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
-    frameworks/native/data/etc/android.software.verified_boot.xml:system/etc/permissions/android.software.verified_boot.xml
+    frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.software.verified_boot.xml
 
 # Enforce privapp-permissions whitelist
 PRODUCT_PROPERTY_OVERRIDES += \
     ro.control_privapp_permissions=enforce
-PRODUCT_COPY_FILES += \
-    device/google/bonito/permissions/privapp-permissions-aosp.xml:system/etc/permissions/privapp-permissions-aosp.xml
 
 # Enable on-access verification of priv apps. This requires fs-verity support in kernel.
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     ro.apk_verity.mode=1
 
 PRODUCT_PACKAGES += \
@@ -56,16 +56,19 @@
 
 LOCAL_PATH := device/google/bonito
 
-TARGET_SYSTEM_PROP := $(LOCAL_PATH)/system.prop
+TARGET_PRODUCT_PROP := $(LOCAL_PATH)/product.prop
 
 $(call inherit-product, $(LOCAL_PATH)/utils.mk)
 
+# Installs gsi keys into ramdisk, to boot a GSI with verified boot.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_keys.mk)
+
 ifeq ($(wildcard vendor/google_devices/bonito/proprietary/device-vendor-bonito.mk),)
     BUILD_WITHOUT_VENDOR := true
 endif
 
 ifeq ($(TARGET_PREBUILT_KERNEL),)
-    LOCAL_KERNEL := device/google/bonito-kernel/Image.lz4-dtb
+    LOCAL_KERNEL := device/google/bonito-kernel/Image.lz4
 else
     LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
 endif
@@ -77,14 +80,14 @@
 
 PRODUCT_COPY_FILES += \
     $(LOCAL_KERNEL):kernel \
-    $(LOCAL_PATH)/init.recovery.hardware.rc:root/init.recovery.$(PRODUCT_PLATFORM).rc \
+    $(LOCAL_PATH)/init.recovery.hardware.rc:recovery/root/init.recovery.$(PRODUCT_PLATFORM).rc \
     $(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).rc \
     $(LOCAL_PATH)/init.hardware.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).usb.rc \
     $(LOCAL_PATH)/ueventd.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
     $(LOCAL_PATH)/init.power.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).power.rc \
     $(LOCAL_PATH)/init.radio.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.radio.sh \
-    $(LOCAL_PATH)/uinput-fpc.kl:system/usr/keylayout/uinput-fpc.kl \
-    $(LOCAL_PATH)/uinput-fpc.idc:system/usr/idc/uinput-fpc.idc \
+    $(LOCAL_PATH)/uinput-fpc.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/uinput-fpc.kl \
+    $(LOCAL_PATH)/uinput-fpc.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/uinput-fpc.idc \
     $(LOCAL_PATH)/init.qcom.devstart.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.devstart.sh \
     $(LOCAL_PATH)/init.qcom.ipastart.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.ipastart.sh \
     $(LOCAL_PATH)/init.qcom.wlan.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.wlan.sh \
@@ -117,8 +120,8 @@
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/bonito/init.bonito.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.bonito.rc \
     $(LOCAL_PATH)/sargo/init.sargo.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.sargo.rc \
-    $(LOCAL_PATH)/init.recovery.hardware.device.rc:root/init.recovery.bonito.rc \
-    $(LOCAL_PATH)/init.recovery.hardware.device.rc:root/init.recovery.sargo.rc \
+    $(LOCAL_PATH)/init.recovery.hardware.device.rc:recovery/root/init.recovery.bonito.rc \
+    $(LOCAL_PATH)/init.recovery.hardware.device.rc:recovery/root/init.recovery.sargo.rc \
 
 MSM_VIDC_TARGET_LIST := sdm710 # Get the color format from kernel headers
 MASTER_SIDE_CP_TARGET_LIST := sdm710 # ION specific settings
@@ -131,7 +134,7 @@
     update_verifier
 
 # Use Sdcardfs
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     ro.sys.sdcardfs=1
 
 PRODUCT_PACKAGES += \
@@ -140,13 +143,9 @@
 PRODUCT_PROPERTY_OVERRIDES += \
     ro.cp_system_other_odex=1
 
-AB_OTA_UPDATER := true
-
-AB_OTA_PARTITIONS += \
-    boot \
-    system \
-    vbmeta \
-    dtbo
+# Userdata Checkpointing OTA GC
+PRODUCT_PACKAGES += \
+    checkpoint_gc
 
 AB_OTA_POSTINSTALL_CONFIG += \
     RUN_POSTINSTALL_system=true \
@@ -154,6 +153,12 @@
     FILESYSTEM_TYPE_system=ext4 \
     POSTINSTALL_OPTIONAL_system=true
 
+AB_OTA_POSTINSTALL_CONFIG += \
+    RUN_POSTINSTALL_vendor=true \
+    POSTINSTALL_PATH_vendor=bin/checkpoint_gc \
+    FILESYSTEM_TYPE_vendor=ext4 \
+    POSTINSTALL_OPTIONAL_vendor=true
+
 # Enable update engine sideloading by including the static version of the
 # boot_control HAL and its dependencies.
 PRODUCT_STATIC_BOOT_CONTROL_HAL := \
@@ -164,7 +169,8 @@
 
 PRODUCT_PACKAGES += \
     update_engine_sideload \
-    sg_write_buffer
+    sg_write_buffer \
+    f2fs_io
 
 # The following modules are included in debuggable builds only.
 PRODUCT_PACKAGES_DEBUG += \
@@ -191,6 +197,7 @@
     frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
     frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
     frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
+    frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml \
     frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
     frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
     frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
@@ -209,10 +216,15 @@
     frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
     frameworks/native/data/etc/android.hardware.telephony.carrierlock.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.carrierlock.xml \
     frameworks/native/data/etc/android.hardware.strongbox_keystore.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.strongbox_keystore.xml \
+    frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \
 
 # power HAL
 PRODUCT_PACKAGES += \
-    android.hardware.power@1.3-service.bonito-libperfmgr
+    android.hardware.power@1.3-service.pixel-libperfmgr
+
+# powerstats HAL
+PRODUCT_PACKAGES += \
+    android.hardware.power.stats@1.0-service.pixel
 
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
@@ -229,6 +241,8 @@
     persist.audio.fluence.voicecomm=true \
     persist.audio.fluence.voicerec=false \
     persist.audio.dualmic.config=endfire \
+    persist.audio.in_mmap_delay_micros=100 \
+    persist.audio.out_mmap_delay_micros=150 \
     ro.config.vc_call_vol_steps=7 \
     ro.config.media_vol_steps=25 \
 
@@ -285,17 +299,23 @@
     persist.radio.ROTATION_ENABLE=1 \
     persist.radio.VT_ENABLE=1 \
     persist.radio.VT_HYBRID_ENABLE=1 \
+    persist.radio.reboot_on_modem_change=true \
     persist.vendor.radio.apm_sim_not_pwdn=1 \
     persist.vendor.radio.custom_ecc=1 \
     persist.vendor.radio.data_ltd_sys_ind=1 \
     persist.radio.videopause.mode=1 \
+    persist.vendor.radio.multisim_switch_support=true \
     persist.vendor.radio.sib16_support=1 \
     persist.vendor.radio.data_con_rprt=true \
-    persist.vendor.radio.relay_oprt_change=1\
+    persist.vendor.radio.relay_oprt_change=1 \
+    persist.vendor.radio.sap_silent_pin=1 \
     persist.vendor.radio.no_wait_for_card=1 \
     persist.rcs.supported=1 \
-    vendor.rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so\
+    vendor.rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so \
     ro.hardware.keystore_desede=true \
+    ro.zram.mark_idle_delay_mins=60 \
+    ro.zram.first_wb_delay_mins=180 \
+    ro.zram.periodic_wb_delay_hours=24 \
 
 # Disable snapshot timer
 PRODUCT_PROPERTY_OVERRIDES += \
@@ -332,6 +352,10 @@
 PRODUCT_PACKAGES += \
     android.hardware.health@2.0-service.bonito
 
+# Storage health HAL
+PRODUCT_PACKAGES += \
+    android.hardware.health.storage@1.0-service
+
 # Light HAL
 PRODUCT_PACKAGES += \
     lights.$(TARGET_CHIPSET) \
@@ -357,6 +381,10 @@
 PRODUCT_PROPERTY_OVERRIDES += \
     ro.vendor.bt.bdaddr_path=/proc/device-tree/chosen/cdt/cdb2/bt_addr
 
+# Enable Perfetto traced
+PRODUCT_PROPERTY_OVERRIDES += \
+    persist.traced.enable=1
+
 # Bluetooth WiPower
 PRODUCT_PROPERTY_OVERRIDES += \
     ro.vendor.bluetooth.emb_wp_mode=false \
@@ -366,30 +394,30 @@
 PRODUCT_PACKAGES += \
     android.hardware.drm@1.0-impl \
     android.hardware.drm@1.0-service \
-    android.hardware.drm@1.1-service.clearkey \
-    android.hardware.drm@1.1-service.widevine
+    android.hardware.drm@1.2-service.clearkey \
+    android.hardware.drm@1.2-service.widevine
 
 # NFC and Secure Element packages
 PRODUCT_PACKAGES += \
     NfcNci \
     Tag \
     SecureElement \
-    android.hardware.nfc@1.1-service \
-    android.hardware.secure_element@1.0-service-disabled
+    android.hardware.nfc@1.2-service \
+    android.hardware.secure_element@1.1-service-disabled
 
 PRODUCT_COPY_FILES += \
     device/google/bonito/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_PRODUCT)/etc/libnfc-nci.conf \
     device/google/bonito/nfc/libese-nxp.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libese-nxp.conf
 
 PRODUCT_COPY_FILES += \
-    device/google/bonito/nfc/manifest_se_SIM1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020A.xml \
-    device/google/bonito/nfc/manifest_se_SIM1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020B.xml \
-    device/google/bonito/nfc/manifest_se_SIM1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020C.xml \
-    device/google/bonito/nfc/manifest_se_eSE1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020D.xml \
-    device/google/bonito/nfc/manifest_se_SIM1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020E.xml \
-    device/google/bonito/nfc/manifest_se_SIM1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020F.xml \
-    device/google/bonito/nfc/manifest_se_SIM1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020G.xml \
-    device/google/bonito/nfc/manifest_se_eSE1.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/vintf/manifest_G020H.xml
+    frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020A/android.hardware.nfc.uicc.xml \
+    frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020B/android.hardware.nfc.uicc.xml \
+    frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020C/android.hardware.nfc.uicc.xml \
+    frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020D/android.hardware.nfc.ese.xml \
+    frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020E/android.hardware.nfc.uicc.xml \
+    frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020F/android.hardware.nfc.uicc.xml \
+    frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020G/android.hardware.nfc.uicc.xml \
+    frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G020H/android.hardware.nfc.ese.xml \
 
 PRODUCT_PACKAGES += \
     android.hardware.usb@1.1-service.bonito
@@ -404,10 +432,11 @@
     libc2dcolorconvert
 
 # Enable Codec 2.0
+PRODUCT_PROPERTY_OVERRIDES += \
+    debug.media.codec2=2 \
+
 PRODUCT_PACKAGES += \
-    libmedia_codecserviceregistrant \
     libqcodec2 \
-    libstagefright_ccodec \
     vendor.qti.media.c2@1.0-service \
 
 PRODUCT_PACKAGES += \
@@ -415,6 +444,8 @@
     android.hardware.camera.provider@2.4-service_64 \
     camera.device@3.2-impl \
     camera.sdm710 \
+    libgooglecamerahal \
+    libgoogle_camera_hal_tests \
     libqomx_core \
     libmmjpeg_interface \
     libmmcamera_interface \
@@ -452,7 +483,10 @@
 
 # Thermal HAL
 PRODUCT_PACKAGES += \
-    android.hardware.thermal@1.1-service.bonito \
+    android.hardware.thermal@2.0-service.pixel
+
+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/thermal_info_config_$(PRODUCT_HARDWARE).json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json
 
 #GNSS HAL
 PRODUCT_PACKAGES += \
@@ -477,11 +511,14 @@
 WPA += wpa_supplicant
 PRODUCT_PACKAGES += $(WPA)
 
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+PRODUCT_PACKAGES += wpa_cli
+endif
+
 # Wifi
 PRODUCT_PACKAGES += \
     android.hardware.wifi@1.0-service \
     wificond \
-    wifilogd \
     libwpa_client
 
 LIB_NL := libnl_2
@@ -509,10 +546,10 @@
     audio.bluetooth.default
 
 PRODUCT_PACKAGES += \
-    android.hardware.audio@4.0-impl:32 \
-    android.hardware.audio.effect@4.0-impl:32 \
+    android.hardware.audio@5.0-impl:32 \
+    android.hardware.audio.effect@5.0-impl:32 \
     android.hardware.broadcastradio@1.0-impl \
-    android.hardware.soundtrigger@2.1-impl \
+    android.hardware.soundtrigger@2.2-impl \
     android.hardware.bluetooth.audio@2.0-impl \
     android.hardware.audio@2.0-service
 
@@ -559,14 +596,17 @@
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
     $(LOCAL_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
-    frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
     frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
     frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
     $(LOCAL_PATH)/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \
-    $(LOCAL_PATH)/media_codecs_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_c2.xml \
-    $(LOCAL_PATH)/media_codecs_performance_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_c2.xml \
-    frameworks/av/media/libstagefright/data/media_codecs_google_c2_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_audio.xml \
-    frameworks/av/media/libstagefright/data/media_codecs_google_c2_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_video.xml \
+    $(LOCAL_PATH)/media_codecs_omx.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_omx.xml
+
+# configures both aac and xaac decoders
+PRODUCT_COPY_FILES += \
+    device/google/bonito/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
+# and ensure that the xaac decoder is built
+PRODUCT_PACKAGES += \
+    libstagefright_soft_xaacdec.vendor
 
 PRODUCT_PROPERTY_OVERRIDES += \
     audio.snd_card.open.retries=50
@@ -598,6 +638,7 @@
 
 PRODUCT_COPY_FILES += \
     device/google/bonito/fstab.hardware:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(PRODUCT_PLATFORM) \
+    device/google/bonito/fstab.hardware:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.$(PRODUCT_PLATFORM) \
 
 # Use the default charger mode images
 PRODUCT_PACKAGES += \
@@ -634,7 +675,7 @@
 PRODUCT_PACKAGES += \
     vndk-sp
 
-PRODUCT_ENFORCE_RRO_TARGETS := framework-res
+PRODUCT_ENFORCE_RRO_TARGETS := *
 
 # Override heap growth limit due to high display density on device
 PRODUCT_PROPERTY_OVERRIDES += \
@@ -669,10 +710,11 @@
 # Fingerprint
 PRODUCT_PACKAGES += \
     android.hardware.biometrics.fingerprint@2.1-service.fpc
+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/init.fingerprint.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.fingerprint.sh \
 
 # Reliability reporting
 PRODUCT_PACKAGES += \
-    hardware.google.pixelstats@1.0-service \
     pixelstats-vendor
 
 PRODUCT_COPY_FILES += \
@@ -757,17 +799,22 @@
 else
 endif
 
+# Enable tcpdump_logger on userdebug and eng
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+    PRODUCT_PROPERTY_OVERRIDES += \
+        persist.vendor.tcpdump.log.alwayson=false \
+        persist.vendor.tcpdump.log.br_num=5
+endif
+
 # Preopt SystemUI
 PRODUCT_DEXPREOPT_SPEED_APPS += \
     SystemUIGoogle
 
 # Enable stats logging in LMKD
 TARGET_LMKD_STATS_LOG := true
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     ro.lmk.log_stats=true
 
-TARGET_ENABLE_MEDIADRM_64 := true
-
 # default usb oem functions
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
   PRODUCT_PROPERTY_OVERRIDES += \
@@ -794,6 +841,26 @@
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
     vendor.skip.init=0
 
+# default atrace HAL
+PRODUCT_PACKAGES += \
+    android.hardware.atrace@1.0-service
+
+# fastbootd
+PRODUCT_PACKAGES += \
+    android.hardware.fastboot@1.0-impl.pixel \
+    fastbootd
+
 # GTS ACSA(Agreement for Carrier Service Application) verification
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+PRODUCT_PRODUCT_PROPERTIES += \
     ro.com.google.acsa=true
+
+# Increment the SVN for any official public releases
+PRODUCT_PROPERTY_OVERRIDES += \
+	ro.vendor.build.svn=4
+
+# Use /product/etc/fstab.postinstall to mount system_other.
+PRODUCT_PRODUCT_PROPERTIES += \
+    ro.postinstall.fstab.prefix=/product
+
+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall
diff --git a/device_framework_matrix.xml b/device_framework_matrix.xml
index dbe75a8..d779d5f 100644
--- a/device_framework_matrix.xml
+++ b/device_framework_matrix.xml
@@ -1,5 +1,19 @@
 <compatibility-matrix version="1.0" type="framework">
     <hal format="hidl" optional="true">
+        <name>android.hardware.media.c2</name>
+        <version>1.0</version>
+        <interface>
+            <name>IComponentStore</name>
+            <instance>default</instance>
+            <instance>software</instance>
+        </interface>
+        <interface>
+            <name>IConfigurable</name>
+            <instance>default</instance>
+            <instance>software</instance>
+        </interface>
+    </hal>
+    <hal format="hidl" optional="true">
         <name>com.qualcomm.qti.uceservice</name>
         <version>2.0</version>
         <interface>
@@ -24,17 +38,11 @@
         </interface>
     </hal>
     <hal format="hidl" optional="true">
-        <name>hardware.google.media.c2</name>
-        <version>1.0</version>
+        <name>android.hardware.radio.config</name>
+        <version>1.1</version>
         <interface>
-            <name>IComponentStore</name>
+            <name>IRadioConfig</name>
             <instance>default</instance>
-            <instance>software</instance>
-        </interface>
-        <interface>
-            <name>IConfigurable</name>
-            <instance>default</instance>
-            <instance>software</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -47,7 +55,7 @@
     </hal>
     <hal format="hidl" optional="true">
         <name>vendor.google.radioext</name>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>IRadioExt</name>
             <instance>default</instance>
@@ -91,14 +99,7 @@
         <interface>
             <name>IQcRilAudio</name>
             <instance>slot1</instance>
-        </interface>
-    </hal>
-    <hal format="hidl" optional="true">
-        <name>vendor.qti.hardware.radio.atcmdfwd</name>
-        <version>1.0</version>
-        <interface>
-            <name>IAtCmdFwd</name>
-            <instance>AtCmdFwdService</instance>
+            <instance>slot2</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -107,6 +108,7 @@
         <interface>
             <name>IImsRadio</name>
             <instance>imsradio0</instance>
+            <instance>imsradio1</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -123,6 +125,7 @@
         <interface>
             <name>IQtiOemHook</name>
             <instance>oemhook0</instance>
+            <instance>oemhook1</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -131,6 +134,7 @@
         <interface>
             <name>IUim</name>
             <instance>Uim0</instance>
+            <instance>Uim1</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -174,4 +178,13 @@
             <instance>default</instance>
         </interface>
     </hal>
+    <hal format="hidl" optional="true">
+        <name>vendor.google.wifi_ext</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IWifiExt</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
 </compatibility-matrix>
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 0a91025..b4b3661 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -41,6 +41,11 @@
 
 #define EMMC_BOOTDEVICE "ro.boot.bootdevice"
 
+#define TCPDUMP_NUMBER_BUGREPORT "persist.vendor.tcpdump.log.br_num"
+#define TCPDUMP_PERSIST_PROPERTY "persist.vendor.tcpdump.log.alwayson"
+
+#define MODEM_EFS_DUMP_PROPERTY "vendor.sys.modem.diag.efsdump"
+
 using android::os::dumpstate::CommandOptions;
 using android::os::dumpstate::DumpFileToFd;
 using android::os::dumpstate::PropertiesHelper;
@@ -53,8 +58,11 @@
 namespace implementation {
 
 #define DIAG_LOG_PREFIX "diag_log_"
+#define TCPDUMP_LOG_PREFIX "tcpdump"
+#define EXTENDED_LOG_PREFIX "extended_log_"
 
-void DumpstateDevice::dumpDiagLogs(int fd, std::string srcDir, std::string destDir) {
+void DumpstateDevice::dumpLogs(int fd, std::string srcDir, std::string destDir,
+                               int maxFileNum, const char *logPrefix) {
     struct dirent **dirent_list = NULL;
     int num_entries = scandir(srcDir.c_str(),
                               &dirent_list,
@@ -66,13 +74,12 @@
         return;
     }
 
-    int maxFileNum = android::base::GetIntProperty(DIAG_MDLOG_NUMBER_BUGREPORT, 100);
     int copiedFiles = 0;
 
     for (int i = num_entries - 1; i >= 0; i--) {
         ALOGD("Found %s\n", dirent_list[i]->d_name);
 
-        if (0 != strncmp(dirent_list[i]->d_name, DIAG_LOG_PREFIX, strlen(DIAG_LOG_PREFIX))) {
+        if (0 != strncmp(dirent_list[i]->d_name, logPrefix, strlen(logPrefix))) {
             continue;
         }
 
@@ -124,23 +131,36 @@
         RunCommandToFd(fd, "MODEM RFS INFO", {"/vendor/bin/find /data/vendor/rfs/mpss/OEMFI/"}, CommandOptions::WithTimeout(2).Build());
         RunCommandToFd(fd, "MODEM DIAG SYSTEM PROPERTIES", {"/vendor/bin/getprop | grep vendor.sys.modem.diag"}, CommandOptions::WithTimeout(2).Build());
 
+        android::base::SetProperty(MODEM_EFS_DUMP_PROPERTY, "true");
+
         const std::string diagLogDir = "/data/vendor/radio/diag_logs/logs";
+        const std::string tcpdumpLogDir = "/data/vendor/tcpdump_logger/logs";
+        const std::string extendedLogDir = "/data/vendor/radio/extended_logs";
         const std::vector <std::string> rilAndNetmgrLogs
             {
-              "/data/vendor/radio/ril_log",
-              "/data/vendor/radio/ril_log_old",
+              "/data/vendor/radio/ril_log0",
+              "/data/vendor/radio/ril_log0_old",
+              "/data/vendor/radio/ril_log1",
+              "/data/vendor/radio/ril_log1_old",
+              "/data/vendor/radio/qmi_fw_log",
+              "/data/vendor/radio/qmi_fw_log_old",
+              "/data/vendor/radio/imsdatadaemon_log",
+              "/data/vendor/radio/imsdatadaemon_log_old",
               "/data/vendor/netmgr/netmgr_log",
               "/data/vendor/netmgr/netmgr_log_old",
               "/data/vendor/radio/power_anomaly_data.txt",
               "/data/vendor/radio/diag_logs/diag_trace.txt",
               "/data/vendor/radio/diag_logs/diag_trace_old.txt",
+              "/data/vendor/radio/diag_logs/logs/diag_poweron_log.qmdl",
               "/data/vendor/radio/metrics_data",
               "/data/vendor/ssrlog/ssr_log.txt",
               "/data/vendor/ssrlog/ssr_log_old.txt",
+              "/data/vendor/rfs/mpss/modem_efs"
             };
 
         bool smlogEnabled = android::base::GetBoolProperty(MODEM_LOGGING_SWITCH, false) && !access("/vendor/bin/smlog_dump", X_OK);
         bool diagLogEnabled = android::base::GetBoolProperty(DIAG_MDLOG_PERSIST_PROPERTY, false);
+        bool tcpdumpEnabled = android::base::GetBoolProperty(TCPDUMP_PERSIST_PROPERTY, false);
 
         if (smlogEnabled) {
             RunCommandToFd(fd, "SMLOG DUMP", {"smlog_dump", "-d", "-o", modemLogAllDir.c_str()}, CommandOptions::WithTimeout(10).Build());
@@ -164,7 +184,7 @@
                 sleep(1);
             }
 
-            dumpDiagLogs(fd, diagLogDir, modemLogAllDir);
+            dumpLogs(fd, diagLogDir, modemLogAllDir, android::base::GetIntProperty(DIAG_MDLOG_NUMBER_BUGREPORT, 100), DIAG_LOG_PREFIX);
 
             if (diagLogStarted) {
                 ALOGD("Restarting diag_mdlog...\n");
@@ -172,9 +192,17 @@
             }
         }
 
+        if (tcpdumpEnabled) {
+            dumpLogs(fd, tcpdumpLogDir, modemLogAllDir, android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX);
+        }
+
         for (const auto& logFile : rilAndNetmgrLogs) {
             RunCommandToFd(fd, "CP MODEM LOG", {"/vendor/bin/cp", logFile.c_str(), modemLogAllDir.c_str()}, CommandOptions::WithTimeout(2).Build());
         }
+
+        dumpLogs(fd, extendedLogDir, modemLogAllDir, 100, EXTENDED_LOG_PREFIX);
+
+        android::base::SetProperty(MODEM_EFS_DUMP_PROPERTY, "false");
     }
 
     RunCommandToFd(fd, "TAR LOG", {"/vendor/bin/tar", "cvf", modemLogCombined.c_str(), "-C", modemLogAllDir.c_str(), "."}, CommandOptions::WithTimeout(120).Build());
@@ -250,7 +278,7 @@
 
 static void DumpF2FS(int fd) {
     DumpFileToFd(fd, "F2FS", "/sys/kernel/debug/f2fs/status");
-    DumpFileToFd(fd, "F2FS - fragmentation", "/proc/fs/f2fs/dm-2/segment_info");
+    DumpFileToFd(fd, "F2FS - fragmentation", "/proc/fs/f2fs/dm-6/segment_info");
 }
 
 static void DumpeMMC(int fd) {
@@ -262,6 +290,8 @@
     DumpFileToFd(fd, "eMMC err_stats", "/sys/kernel/debug/mmc0/err_stats");
     DumpFileToFd(fd, "eMMC ring_buffer", "/sys/kernel/debug/mmc0/ring_buffer");
     DumpFileToFd(fd, "eMMC host status", "/sys/kernel/debug/mmc0/show_host");
+    DumpFileToFd(fd, "eMMC io_stats", "/sys/kernel/debug/mmc0/io_stats");
+    DumpFileToFd(fd, "eMMC req_stats", "/sys/kernel/debug/mmc0/req_stats");
 
     std::string bootdev = android::base::GetProperty(EMMC_BOOTDEVICE, "");
     if (!bootdev.empty()) {
@@ -289,12 +319,7 @@
         return Void();
     }
 
-    if (handle->numFds < 2) {
-        ALOGE("no FD for modem\n");
-    } else {
-        int fdModem = handle->data[1];
-        dumpModem(fd, fdModem);
-    }
+    RunCommandToFd(fd, "Notify modem", {"/vendor/bin/modem_svc", "-s"}, CommandOptions::WithTimeout(1).Build());
     RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"});
     DumpFileToFd(fd, "SoC serial number", "/sys/devices/soc0/serial_number");
     DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present");
@@ -328,7 +353,9 @@
     RunCommandToFd(fd, "Easel debug info", {"/vendor/bin/sh", "-c", "for f in `ls /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0066/@(*curr|temperature|vbat|total_power)`; do echo \"$f: `cat $f`\" ; done; file=/sys/devices/virtual/misc/mnh_sm/state; echo \"$file: `cat $file`\""});
     DumpFileToFd(fd, "MDP xlogs", "/data/vendor/display/mdp_xlog");
     DumpFileToFd(fd, "TCPM logs", "/d/tcpm/usbpd0");
-    DumpFileToFd(fd, "PD Engine", "/d/pd_engine/usbpd0");
+    DumpFileToFd(fd, "PD Engine", "/d/logbuffer/usbpd");
+    DumpFileToFd(fd, "smb-lib", "/d/logbuffer/smblib");
+    DumpFileToFd(fd, "DWC3 logs", "/d/ipc_logging/a600000.dwc3/log");
     DumpFileToFd(fd, "ipc-local-ports", "/d/msm_ipc_router/dump_local_ports");
     DumpIPCTRT(fd);
     DumpTouch(fd);
@@ -348,6 +375,14 @@
 
     RunCommandToFd(fd, "eSIM Status", {"/vendor/bin/sh", "-c", "od -t x1 /sys/firmware/devicetree/base/chosen/cdt/cdb2/esim"});
     DumpFileToFd(fd, "Modem Stat", "/data/vendor/modem_stat/debug.txt");
+    DumpFileToFd(fd, "Pixel trace", "/d/tracing/instances/pixel-trace/trace");
+
+    if (handle->numFds < 2) {
+        ALOGE("no FD for modem\n");
+    } else {
+        int fdModem = handle->data[1];
+        dumpModem(fd, fdModem);
+    }
 
     // Keep this at the end as very long on not for humans
     DumpFileToFd(fd, "WLAN FW Log Symbol Table", "/vendor/firmware/Data.msc");
diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h
index 0a1d023..ba5fcb7 100644
--- a/dumpstate/DumpstateDevice.h
+++ b/dumpstate/DumpstateDevice.h
@@ -40,7 +40,8 @@
   // Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
   Return<void> dumpstateBoard(const hidl_handle& h) override;
 
-  void dumpDiagLogs(int fd, std::string srcDir, std::string destDir);
+  void dumpLogs(int fd, std::string srcDir, std::string destDir, int maxFileNum,
+                const char *logPrefix);
   void dumpModem(int fd, int fdModem);
 };
 
diff --git a/dumpstate/android.hardware.dumpstate@1.0-service.bonito.rc b/dumpstate/android.hardware.dumpstate@1.0-service.bonito.rc
index 12180bb..5f40217 100644
--- a/dumpstate/android.hardware.dumpstate@1.0-service.bonito.rc
+++ b/dumpstate/android.hardware.dumpstate@1.0-service.bonito.rc
@@ -1,7 +1,7 @@
 service vendor.dumpstate-1-0 /vendor/bin/hw/android.hardware.dumpstate@1.0-service.bonito
     class hal
     user system
-    group system
+    group system vendor_rfs
     interface android.hardware.dumpstate@1.0::IDumpstateDevice default
 
 on boot
diff --git a/framework_manifest.xml b/framework_manifest.xml
deleted file mode 100644
index 5cae655..0000000
--- a/framework_manifest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<manifest version="1.0" type="framework">
-    <hal format="hidl">
-        <name>hardware.google.pixelstats</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IPixelStats</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-</manifest>
-
diff --git a/manifest_userdebug.xml b/framework_manifest_userdebug.xml
similarity index 87%
rename from manifest_userdebug.xml
rename to framework_manifest_userdebug.xml
index cd72075..8ff68ad 100644
--- a/manifest_userdebug.xml
+++ b/framework_manifest_userdebug.xml
@@ -1,4 +1,4 @@
-<manifest version="1.0" type="device">
+<manifest version="1.0" type="framework">
     <hal format="hidl">
         <name>vendor.qti.hardware.radio.atcmdfwd</name>
         <transport>hwbinder</transport>
diff --git a/fstab.hardware b/fstab.hardware
index 0febdc6..6b2c2f7 100644
--- a/fstab.hardware
+++ b/fstab.hardware
@@ -6,13 +6,16 @@
 # Currently we dont have e2fsck compiled. So fs check would failed.
 
 #<src>                                                 <mnt_point>                        <type>  <mnt_flags and options>                            <fs_mgr_flags>
-/dev/block/bootdevice/by-name/system                    /                                 ext4    ro,barrier=1,discard                                 wait,slotselect,avb
-/dev/block/bootdevice/by-name/metadata                  /metadata                         ext4    noatime,nosuid,nodev,discard                         wait,formattable
-/dev/block/bootdevice/by-name/userdata                  /data                             f2fs    noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier       latemount,wait,check,fileencryption=ice,keydirectory=/metadata/vold/metadata_encryption,quota,formattable,sysfs_path=/sys/devices/platform/soc/7c4000.sdhci,reservedsize=128M
+system                                                  /system                           ext4    ro,barrier=1                                         wait,slotselect,avb=vbmeta,logical,first_stage_mount
+vendor                                                  /vendor                           ext4    ro,barrier=1                                         wait,slotselect,avb,logical,first_stage_mount
+product                                                 /product                          ext4    ro,barrier=1                                         wait,slotselect,avb,logical,first_stage_mount
+/dev/block/by-name/metadata                             /metadata                         ext4    noatime,nosuid,nodev,discard                         wait,formattable,first_stage_mount
+/dev/block/bootdevice/by-name/userdata                  /data                             f2fs    noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier       latemount,wait,check,fileencryption=ice,keydirectory=/metadata/vold/metadata_encryption,quota,formattable,sysfs_path=/sys/devices/platform/soc/7c4000.sdhci,reservedsize=128M,checkpoint=fs
 /dev/block/bootdevice/by-name/modem                     /vendor/firmware_mnt              vfat    ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:vendor_firmware_file:s0 wait,slotselect
 # Need to have this entry in here even though the mount point itself is no longer needed.
 # The update_engine code looks for this entry in order to determine the boot device address
 # and fails if it does not find it.
 /dev/block/bootdevice/by-name/misc                      /misc                            emmc    defaults                                             defaults
 /devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.*.auto*     /storage/usbotg    vfat    nosuid,nodev    wait,voldmanaged=usbotg:auto
-/dev/block/zram0                                    none               swap        defaults                                              zramsize=1610612736,max_comp_streams=8
+/dev/block/zram0                                    none               swap        defaults                                              zramsize=2147483648,max_comp_streams=8,zram_loopback_path=/data/unencrypted/zram_swap,zram_loopback_size=512M
+/dev/block/platform/soc/7c4000.sdhci/by-name/persist    /mnt/vendor/persist              ext4    nosuid,nodev,noatime,barrier=1          wait,first_stage_mount
diff --git a/fstab.postinstall b/fstab.postinstall
new file mode 100644
index 0000000..df8f77b
--- /dev/null
+++ b/fstab.postinstall
@@ -0,0 +1,17 @@
+#
+# 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.
+
+#<src>                    <mnt_point>  <type> <mnt_flags and options> <fs_mgr_flags>
+/dev/block/by-name/system /postinstall ext4   ro,nosuid,nodev,noexec  slotselect_other,avb_keys=/product/etc/security/avb/system_other.avbpubkey
diff --git a/gpt-utils/gpt-utils.cpp b/gpt-utils/gpt-utils.cpp
index 633b34b..ff6e535 100644
--- a/gpt-utils/gpt-utils.cpp
+++ b/gpt-utils/gpt-utils.cpp
@@ -1533,6 +1533,7 @@
                                 __func__);
                 goto error;
         }
+        fsync(fd);
         close(fd);
         return 0;
 error:
diff --git a/health/Android.bp b/health/Android.bp
index d87a0b8..b06227b 100644
--- a/health/Android.bp
+++ b/health/Android.bp
@@ -29,6 +29,7 @@
     cflags: [
         "-Wall",
         "-Werror",
+        "-Wno-implicit-fallthrough", // warning in BatteryRechargingControl.cpp
     ],
 
     static_libs: [
@@ -36,16 +37,15 @@
         "android.hardware.health@1.0-convert",
         "libhealthservice",
         "libbatterymonitor",
-        "libpixelhealth",
     ],
 
     shared_libs: [
-        "hardware.google.pixelstats@1.0",
         "libbase",
         "libcutils",
         "libhidlbase",
         "libhidltransport",
         "libhwbinder",
+        "libpixelhealth",
         "libutils",
         "android.hardware.health@2.0",
     ],
diff --git a/health/BatteryRechargingControl.cpp b/health/BatteryRechargingControl.cpp
index 4683aa8..687e975 100644
--- a/health/BatteryRechargingControl.cpp
+++ b/health/BatteryRechargingControl.cpp
@@ -95,7 +95,10 @@
             state_ = WAIT_EOC;
             recharge_soc_ = 0;
         case WAIT_EOC:
-            if (charger_status == kStatusIsFull) {
+            if (props->batteryLevel != kFullSoc) {
+                state_ = INACTIVE;
+                recharge_soc_ = 0;
+            } else if (charger_status == kStatusIsFull) {
                 state_ = RECHARGING_CYCLE;
                 props->batteryLevel = kFullSoc;
             } else if (charger_status != kStatusIsCharging) {
diff --git a/health/LearnedCapacityBackupRestore.cpp b/health/LearnedCapacityBackupRestore.cpp
index 9ce12e6..cfea5c0 100644
--- a/health/LearnedCapacityBackupRestore.cpp
+++ b/health/LearnedCapacityBackupRestore.cpp
@@ -21,6 +21,7 @@
 namespace bonito {
 namespace health {
 
+static constexpr char kChgFullDesignFile[] = "sys/class/power_supply/bms/charge_full_design";
 static constexpr char kChgFullFile[] = "sys/class/power_supply/bms/charge_full";
 static constexpr char kSysCFPersistFile[] = "/persist/battery/qcom_charge_full";
 static constexpr int kBuffSize = 256;
@@ -28,17 +29,18 @@
 LearnedCapacityBackupRestore::LearnedCapacityBackupRestore() {}
 
 void LearnedCapacityBackupRestore::Restore() {
-    ReadFromStorage();
-    ReadFromSRAM();
+    ReadPersistData();
+    ReadNominalCapacity();
+    ReadCapacity();
     UpdateAndSave();
 }
 
 void LearnedCapacityBackupRestore::Backup() {
-    ReadFromSRAM();
+    ReadCapacity();
     UpdateAndSave();
 }
 
-void LearnedCapacityBackupRestore::ReadFromStorage() {
+void LearnedCapacityBackupRestore::ReadPersistData() {
     std::string buffer;
 
     if (!android::base::ReadFileToString(std::string(kSysCFPersistFile), &buffer)) {
@@ -63,20 +65,36 @@
         LOG(ERROR) << "Write file error: " << strerror(errno);
 }
 
-void LearnedCapacityBackupRestore::ReadFromSRAM() {
+void LearnedCapacityBackupRestore::ReadNominalCapacity() {
+    std::string buffer;
+
+    if (!android::base::ReadFileToString(std::string(kChgFullDesignFile), &buffer)) {
+        LOG(ERROR) << "Read nominal capacity error: " << strerror(errno);
+        return;
+    }
+
+    buffer = android::base::Trim(buffer);
+
+    if (sscanf(buffer.c_str(), "%d", &nom_cap_) < 1)
+        LOG(ERROR) << "Failed to parse nominal capacity: " << buffer;
+    else
+        LOG(INFO) << "nominal capacity: " << buffer;
+}
+
+void LearnedCapacityBackupRestore::ReadCapacity() {
     std::string buffer;
 
     if (!android::base::ReadFileToString(std::string(kChgFullFile), &buffer)) {
-        LOG(ERROR) << "Read cycle counter error: " << strerror(errno);
+        LOG(ERROR) << "Read capacity error: " << strerror(errno);
         return;
     }
 
     buffer = android::base::Trim(buffer);
 
     if (sscanf(buffer.c_str(), "%d", &hw_cap_) < 1)
-        LOG(ERROR) << "Failed to parse SRAM bins: " << buffer;
+        LOG(ERROR) << "Failed to parse capacity: " << buffer;
     else
-        LOG(INFO) << "SRAM data: " << buffer;
+        LOG(INFO) << "capacity: " << buffer;
 }
 
 void LearnedCapacityBackupRestore::SaveToSRAM() {
@@ -94,10 +112,11 @@
     bool backup = false;
     bool restore = false;
     if (hw_cap_) {
-        if ((hw_cap_ < sw_cap_) || (sw_cap_ == 0)) {
+        if (((hw_cap_ != sw_cap_) && (hw_cap_ != nom_cap_)) ||
+            (sw_cap_ == 0)) {
             sw_cap_ = hw_cap_;
             backup = true;
-        } else if (hw_cap_ > sw_cap_) {
+        } else if ((sw_cap_ > 0) && (hw_cap_ == nom_cap_)) {
             hw_cap_ = sw_cap_;
             restore = true;
         }
diff --git a/health/LearnedCapacityBackupRestore.h b/health/LearnedCapacityBackupRestore.h
index 4024fda..b96385e 100644
--- a/health/LearnedCapacityBackupRestore.h
+++ b/health/LearnedCapacityBackupRestore.h
@@ -36,10 +36,12 @@
   private:
     int sw_cap_;
     int hw_cap_;
+    int nom_cap_;
 
-    void ReadFromStorage();
+    void ReadPersistData();
     void SaveToStorage();
-    void ReadFromSRAM();
+    void ReadNominalCapacity();
+    void ReadCapacity();
     void SaveToSRAM();
     void UpdateAndSave();
 };
diff --git a/init.fingerprint.sh b/init.fingerprint.sh
new file mode 100755
index 0000000..413fd9e
--- /dev/null
+++ b/init.fingerprint.sh
@@ -0,0 +1,48 @@
+#!/vendor/bin/sh
+# /vendor/bin/init.fingerprint.sh [max_init_retry_times]
+
+# fps_hal service prop
+fps_svc_prop='init.svc.vendor.fps_hal'
+# fps_hal service name
+fps_svc_name='vendor.fps_hal'
+# fps_hal service init retry count
+init_retry_count_prop='vendor.fps.init_retry.count'
+# fps_hal service init succeed
+init_succeed_prop='vendor.fps.init.succeed'
+# Define maximum init retry times as default 10
+max_times=10
+
+# Deal with the input parameter
+if [ "$#" -ge 1 ]; then
+  # Check is it positive number or not
+  # If so, then set maximum times as $1
+  # If not, $max_times keeps in default value
+  if [ "$1" -eq "$1" ] && [ "$1" -gt 0 ]; then
+    max_times=$1
+    echo $max_times
+  fi
+fi
+
+# fps_hal service init retry count
+init_retry_count=0
+
+while [ "$init_retry_count" -le "$max_times" ]
+do
+  # debouncing time for init processing
+  sleep 5
+  # Get fps_hal service state and count init retry times
+  fps_svc_state=$(getprop $fps_svc_prop)
+  if [ "$fps_svc_state" == "stopped" ]; then
+    if [ "$init_retry_count" -lt "$max_times" ]; then
+      init_retry_count=$((init_retry_count+1))
+      setprop $init_retry_count_prop $init_retry_count
+      setprop $init_succeed_prop false
+      start $fps_svc_name
+    else
+      break;
+    fi
+  elif [ "$fps_svc_state" == "running" ]; then
+    setprop $init_succeed_prop true
+    break
+  fi
+done
diff --git a/init.hardware.chamber.rc.userdebug b/init.hardware.chamber.rc.userdebug
index 6263850..bd8d213 100644
--- a/init.hardware.chamber.rc.userdebug
+++ b/init.hardware.chamber.rc.userdebug
@@ -14,15 +14,11 @@
 # limitations under the License.
 #
 
-
 on property:persist.vendor.disable.thermal.control=1
-  write /sys/devices/virtual/thermal/tz-by-name/mb-therm-adc/mode disabled
-  write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-adc/mode disabled
-  write /sys/module/overheat_mitigation/parameters/enable 0
-
-on property:init.svc.vendor.thermal-engine=running && property:persist.vendor.disable.thermal.control=1
-  stop vendor.thermal-engine
+    stop vendor.thermal-engine
+    write /sys/devices/virtual/thermal/tz-by-name/mb-therm-adc/mode disabled
+    write /sys/devices/virtual/thermal/tz-by-name/mb-therm-monitor/mode disabled
+    write /sys/module/overheat_mitigation/parameters/enable 0
 
 on property:persist.vendor.disable.usb.overheat.mitigation=1
-  write /sys/devices/virtual/thermal/tz-by-name/usbc-therm-adc/mode disabled
-  write /sys/module/overheat_mitigation/parameters/enable 0
+    write /sys/module/overheat_mitigation/parameters/enable 0
diff --git a/init.hardware.diag.rc.userdebug b/init.hardware.diag.rc.userdebug
index 962306f..308535e 100644
--- a/init.hardware.diag.rc.userdebug
+++ b/init.hardware.diag.rc.userdebug
@@ -21,6 +21,7 @@
     # Modem logging collection
     mkdir /data/vendor/radio 0777 radio radio
     mkdir /data/vendor/radio/diag_logs 0777 system system
+    rm /data/vendor/radio/diag_logs/logs/diag_poweron_log.qmdl
     # WLAN logging collection
     mkdir /data/vendor/wifi 0777 system system
     mkdir /data/vendor/wifi/cnss_diag 0777 system system
@@ -30,6 +31,7 @@
     class late_start
     user shell
     group system diag media_rw
+    socket diag_router stream 0666 system system
     disabled
     oneshot
 
diff --git a/init.hardware.mpssrfs.rc.user b/init.hardware.mpssrfs.rc.user
index c0ea46e..f75a413 100644
--- a/init.hardware.mpssrfs.rc.user
+++ b/init.hardware.mpssrfs.rc.user
@@ -1,5 +1,5 @@
 on post-fs-data
     # Modem Remote FS
-    mkdir /data/vendor/rfs      0700 vendor_rfs vendor_rfs
-    mkdir /data/vendor/rfs/mpss 0700 vendor_rfs vendor_rfs
-    mkdir /data/vendor/tombstones/rfs      0700 vendor_rfs vendor_rfs
+    mkdir /data/vendor/rfs      0770 vendor_rfs vendor_rfs
+    mkdir /data/vendor/rfs/mpss 0770 vendor_rfs vendor_rfs
+    mkdir /data/vendor/tombstones/rfs      0770 vendor_rfs vendor_rfs
diff --git a/init.hardware.mpssrfs.rc.userdebug b/init.hardware.mpssrfs.rc.userdebug
index acd55e1..5939bfc 100644
--- a/init.hardware.mpssrfs.rc.userdebug
+++ b/init.hardware.mpssrfs.rc.userdebug
@@ -1,8 +1,11 @@
 on post-fs-data
     # Modem Remote FS
-    mkdir /data/vendor/rfs      0700 vendor_rfs vendor_rfs
-    mkdir /data/vendor/rfs/mpss 0700 vendor_rfs vendor_rfs
-    mkdir /data/vendor/tombstones/rfs      0700 vendor_rfs vendor_rfs
+    mkdir /data/vendor/rfs      0770 vendor_rfs vendor_rfs
+    mkdir /data/vendor/rfs/mpss 0770 vendor_rfs vendor_rfs
+    mkdir /data/vendor/tombstones/rfs      0770 vendor_rfs vendor_rfs
     write /data/vendor/rfs/mpss/mcfg_nv_list_flag "1"
     chown vendor_rfs vendor_rfs /data/vendor/rfs/mpss/mcfg_nv_list_flag
     chmod 0700 /data/vendor/rfs/mpss/mcfg_nv_list_flag
+
+on property:vendor.sys.modem.diag.efsdump=true
+    chmod 0660 /data/vendor/rfs/mpss/modem_efs
diff --git a/init.hardware.rc b/init.hardware.rc
index 5a5a146..6139b4b 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -43,6 +43,13 @@
 service vendor.charger /charger
     class charger
     seclabel u:r:charger:s0
+    user system
+    group system wakelock input
+    capabilities SYS_BOOT
+    file /dev/kmsg w
+    file /sys/fs/pstore/console-ramoops-0 r
+    file /sys/fs/pstore/console-ramoops r
+    file /proc/last_kmsg r
 
 on early-init
     mount debugfs debugfs /sys/kernel/debug
@@ -50,23 +57,6 @@
     # Enable sched_boost
     write /proc/sys/kernel/sched_boost 1
 
-    # mount schedtune and blkio together in "on early-init",
-    # so that mount schedtune in init.rc will fail
-    mkdir /dev/stune
-    mount cgroup none /dev/stune nodev noexec nosuid schedtune,blkio
-
-    mkdir /dev/stune/foreground
-    mkdir /dev/stune/background
-    mkdir /dev/stune/top-app
-    mkdir /dev/stune/rt
-
-    # blkio init setting
-    write /dev/stune/blkio.group_idle 0
-    write /dev/stune/foreground/blkio.group_idle 0
-    write /dev/stune/background/blkio.group_idle 0
-    write /dev/stune/top-app/blkio.group_idle 0
-    write /dev/stune/rt/blkio.group_idle 0
-
 # Skip init trigger for charger mode
 on early-init && property:ro.boot.mode=charger
     setprop vendor.skip.init 1
@@ -88,7 +78,6 @@
     start keymaster-4-0
 
     # start Citadel keymaster (StrongBox) early
-    start vndservicemanager
     start vendor.citadeld
     start vendor.keymaster-4-0-citadel
 
@@ -153,9 +142,14 @@
     # Property used by vintf for sku specific manifests
     setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku}
 
+on late-init
+    setprop vendor.thermal.config thermal_info_config.json
+    chown system system /sys/devices/virtual/thermal/tz-by-name/mb-therm-monitor/trip_point_0_temp
+    chown system system /sys/devices/virtual/thermal/tz-by-name/mb-therm-monitor/trip_point_0_hyst
+    chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_temp
+    chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_hyst
+
 on fs
-    # Start HW service manager early
-    start hwservicemanager
     mount_all /vendor/etc/fstab.${ro.boot.hardware.platform} --early
 
     mkdir /mnt/vendor/persist/audio 0770 media audio
@@ -291,7 +285,7 @@
     mkdir /data/vendor/audio/acdbdata/delta 0770 media audio
 
     # Create directory for radio
-    mkdir /data/vendor/radio 0771 system radio
+    mkdir /data/vendor/radio 0773 system radio
     mkdir /data/vendor/modem_stat 0771 system radio
     write /data/vendor/modem_stat/debug.txt ""
     chown system radio /data/vendor/modem_stat/debug.txt
@@ -406,6 +400,9 @@
     chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_discard_cnt
     chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_flush_cnt
 
+    # Permission for Health Storage HAL
+    chown system system /sys/devices/platform/soc/7c4000.sdhci/manual_gc
+
 on boot
     mkdir /dev/socket/qmux_radio 0770 radio radio
     chmod 2770 /dev/socket/qmux_radio
@@ -497,17 +494,11 @@
     write /dev/cpuset/restricted/cpus 2-5
 
     # Setup final blkio
-    write /dev/stune/blkio.group_idle 0
-    write /dev/stune/foreground/blkio.group_idle 1
-    write /dev/stune/background/blkio.group_idle 0
-    write /dev/stune/top-app/blkio.group_idle 2
-    write /dev/stune/rt/blkio.group_idle 2
-
-    write /dev/stune/blkio.weight 1000
-    write /dev/stune/foreground/blkio.weight 1000
-    write /dev/stune/background/blkio.weight 10
-    write /dev/stune/top-app/blkio.weight 1000
-    write /dev/stune/rt/blkio.weight 1000
+    # value for group_idle is us
+    write /dev/blkio/blkio.weight 1000
+    write /dev/blkio/background/blkio.weight 10
+    write /dev/blkio/blkio.group_idle 2000
+    write /dev/blkio/background/blkio.group_idle 0
 
     # QCOM FG SRAM dump for dumpstate
     chown system system /d/fg/sram/data
@@ -533,6 +524,8 @@
     chmod 644 /sys/kernel/debug/mmc0/ring_buffer
     chmod 644 /sys/kernel/debug/mmc0/err_stats
     chmod 644 /sys/kernel/debug/mmc0/show_host
+    chmod 644 /sys/kernel/debug/mmc0/io_stats
+    chmod 644 /sys/kernel/debug/mmc0/req_stats
 
     # Disable sched_boost
     write /proc/sys/kernel/sched_boost 0
@@ -540,6 +533,27 @@
     # Enable PowerHAL hint processing
     setprop vendor.powerhal.init 1
 
+    # Create pixel-trace.
+    # At this moment, only mm_event is available. If others want to put more,
+    # it should get hard review from pixel-perf-team.
+
+    mkdir /sys/kernel/debug/tracing/instances/pixel-trace 600
+    write /sys/kernel/debug/tracing/instances/pixel-trace/buffer_size_kb 64
+    write /sys/kernel/debug/tracing/instances/pixel-trace/events/mm_event/enable 1
+
+# turns off tracing right before bugreporting to keep more traces
+on property:init.svc.dumpstatez=running
+    write /d/tracing/instances/pixel-trace/tracing_on 0
+
+on property:init.svc.dumpstatez=stopped
+    write /d/tracing/instances/pixel-trace/tracing_on 1
+
+on property:init.svc.bugreport=running
+    write /d/tracing/instances/pixel-trace/tracing_on 0
+
+on property:init.svc.bugreport=stopped
+    write /d/tracing/instances/pixel-trace/tracing_on 1
+
 on property:init.svc.vendor.per_mgr=running
     start vendor.per_proxy
 
@@ -617,6 +631,12 @@
    user root
    group root system
 
+service modem_svc /vendor/bin/modem_svc -q
+   class core
+   user root
+   group system
+   capabilities NET_BIND_SERVICE
+
 service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
     -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -dd \
     -g@android:wpa_wlan0
@@ -626,6 +646,7 @@
     #   group wifi inet keystore
     interface android.hardware.wifi.supplicant@1.0::ISupplicant default
     interface android.hardware.wifi.supplicant@1.1::ISupplicant default
+    interface android.hardware.wifi.supplicant@1.2::ISupplicant default
     class main
     socket wpa_wlan0 dgram 660 wifi wifi
     disabled
@@ -793,31 +814,31 @@
     setprop ro.boot.sota enabled
 
 on property:ro.boot.hardware.sku=G020A
-    setprop persist.nfc.uicc_enabled true
+    setprop persist.vendor.nfc.uicc_enabled true
     setprop persist.vendor.radio.uicc_se_enabled true
 on property:ro.boot.hardware.sku=G020B
-    setprop persist.nfc.uicc_enabled true
+    setprop persist.vendor.nfc.uicc_enabled true
     setprop persist.vendor.radio.uicc_se_enabled true
 on property:ro.boot.hardware.sku=G020C
-    setprop persist.nfc.uicc_enabled true
+    setprop persist.vendor.nfc.uicc_enabled true
     setprop persist.vendor.radio.uicc_se_enabled true
 on property:ro.boot.hardware.sku=G020D
-    setprop persist.nfc.uicc_enabled false
+    setprop persist.vendor.nfc.uicc_enabled false
     setprop persist.vendor.radio.uicc_se_enabled false
-    interface_start android.hardware.secure_element@1.0::ISecureElement/eSE1
+    interface_start android.hardware.secure_element@1.1::ISecureElement/eSE1
 on property:ro.boot.hardware.sku=G020E
-    setprop persist.nfc.uicc_enabled true
+    setprop persist.vendor.nfc.uicc_enabled true
     setprop persist.vendor.radio.uicc_se_enabled true
 on property:ro.boot.hardware.sku=G020F
-    setprop persist.nfc.uicc_enabled true
+    setprop persist.vendor.nfc.uicc_enabled true
     setprop persist.vendor.radio.uicc_se_enabled true
 on property:ro.boot.hardware.sku=G020G
-    setprop persist.nfc.uicc_enabled true
+    setprop persist.vendor.nfc.uicc_enabled true
     setprop persist.vendor.radio.uicc_se_enabled true
 on property:ro.boot.hardware.sku=G020H
-    setprop persist.nfc.uicc_enabled false
+    setprop persist.vendor.nfc.uicc_enabled false
     setprop persist.vendor.radio.uicc_se_enabled false
-    interface_start android.hardware.secure_element@1.0::ISecureElement/eSE1
+    interface_start android.hardware.secure_element@1.1::ISecureElement/eSE1
 
 # charger driver exposes now finer grain control, map demo mode to those properties
 # demo mode can only be exited by wiping data which will also reset the persist properties
@@ -843,6 +864,11 @@
     chown system system /sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input2/read_report
     chown system system /sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input2/suspend
 
+# DSDS feature
+# Enable 2nd qcrild when the property set to dsds
+on property:persist.radio.multisim.config=dsds
+    start vendor.qcrild2
+
 on property:sys.boot_completed=1 && property:ro.boot.mode=firstboot
     start init-firstboot-sh
 
@@ -850,3 +876,20 @@
     user nobody
     disabled
     oneshot
+
+# init-fingerprint-sh is for stopping fps_hal after init retry fail serval times
+# It keeps running until max init retry or fps_hal running successfully
+# vendor.fps_hal restarts until max init retry times
+#
+# /vendor/bin/init.fingerprint.sh [max_init_retry_times]
+service init-fingerprint-sh /vendor/bin/init.fingerprint.sh 10
+    group root
+    user root
+    disabled
+    oneshot
+
+on property:sys.boot_completed=1
+    start init-fingerprint-sh
+
+on property:vendor.fps.init.succeed=true && property:init.svc.vendor.fps_hal=stopped
+    start init-fingerprint-sh
diff --git a/init.hardware.usb.rc b/init.hardware.usb.rc
index 787f5cd..a162f4b 100644
--- a/init.hardware.usb.rc
+++ b/init.hardware.usb.rc
@@ -50,7 +50,40 @@
     setprop sys.usb.mtp.device_type 3
     setprop sys.usb.controller "a600000.dwc3"
     symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
+    write /sys/module/libcomposite/parameters/disable_l1_for_hs "y"
     write /config/usb_gadget/g1/functions/gsi.rndis/rndis_class_id 1
 
 on boot
     setprop sys.usb.configfs 2
+
+on charger
+    mkdir /config/usb_gadget/g1 0770
+    mkdir /config/usb_gadget/g1/strings/0x409 0770
+    write /config/usb_gadget/g1/bcdUSB 0x0200
+    write /config/usb_gadget/g1/idVendor 0x18d1
+    write /config/usb_gadget/g1/bcdDevice 0x0440
+    write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
+    write /config/usb_gadget/g1/strings/0x409/manufacturer Google
+    write /config/usb_gadget/g1/strings/0x409/product Pixel
+    mkdir /config/usb_gadget/g1/functions/midi.gs5
+    mkdir /config/usb_gadget/g1/configs/b.1 0770
+    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770
+    symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
+    write /sys/module/libcomposite/parameters/disable_l1_for_hs "y"
+    setprop sys.usb.controller "a600000.dwc3"
+    setprop sys.usb.configfs 1
+
+on property:ro.bootmode=charger
+    setprop sys.usb.config midi
+
+on property:sys.usb.config=midi && property:sys.usb.configfs=1
+    write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi"
+    rm /config/usb_gadget/g1/configs/b.1/f1
+    rm /config/usb_gadget/g1/configs/b.1/f2
+    rm /config/usb_gadget/g1/configs/b.1/f3
+    rm /config/usb_gadget/g1/configs/b.1/f4
+    write /config/usb_gadget/g1/idVendor 0x18d1
+    write /config/usb_gadget/g1/idProduct 0x4eea
+    symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1
+    write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+    setprop sys.usb.state ${sys.usb.config}
diff --git a/init.logging.rc b/init.logging.rc
index 9813597..969d548 100644
--- a/init.logging.rc
+++ b/init.logging.rc
@@ -1,3 +1,4 @@
 on post-fs-data
     mkdir /data/vendor/modem_dump 0777 system system
     mkdir /data/vendor/radio/diag_logs/logs 0777 system system
+    mkdir /data/vendor/radio/extended_logs 0770 system radio
diff --git a/init.qcom.wlan.sh b/init.qcom.wlan.sh
index 7858701..0d14fab 100644
--- a/init.qcom.wlan.sh
+++ b/init.qcom.wlan.sh
@@ -1,6 +1,6 @@
 #! /vendor/bin/sh
 
 wlan_driver_version=`cat /sys/kernel/wifi/wlan/driver_version`
-setprop sys.wlan.driver.version "$wlan_driver_version"
+setprop vendor.wlan.driver.version "$wlan_driver_version"
 wlan_fw_version=`cat /sys/kernel/wifi/wlan/fw/0/version`
-setprop sys.wlan.firmware.version "$wlan_fw_version"
+setprop vendor.wlan.firmware.version "$wlan_fw_version"
diff --git a/manifest.xml b/manifest.xml
index 546d8f8..d398393 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -2,7 +2,7 @@
     <hal format="hidl">
         <name>android.hardware.audio</name>
         <transport>hwbinder</transport>
-        <version>4.0</version>
+        <version>5.0</version>
         <interface>
             <name>IDevicesFactory</name>
             <instance>default</instance>
@@ -11,7 +11,7 @@
     <hal format="hidl">
         <name>android.hardware.audio.effect</name>
         <transport>hwbinder</transport>
-        <version>4.0</version>
+        <version>5.0</version>
         <interface>
             <name>IEffectsFactory</name>
             <instance>default</instance>
@@ -81,15 +81,6 @@
         </interface>
     </hal>
     <hal format="hidl">
-        <name>android.hardware.cas</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IMediaCasService</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>android.hardware.configstore</name>
         <transport>hwbinder</transport>
         <version>1.1</version>
@@ -128,10 +119,10 @@
             <name>IDrmFactory</name>
             <instance>default</instance>
         </interface>
-        <fqname>@1.1::ICryptoFactory/clearkey</fqname>
-        <fqname>@1.1::IDrmFactory/clearkey</fqname>
-        <fqname>@1.1::ICryptoFactory/widevine</fqname>
-        <fqname>@1.1::IDrmFactory/widevine</fqname>
+        <fqname>@1.2::ICryptoFactory/clearkey</fqname>
+        <fqname>@1.2::IDrmFactory/clearkey</fqname>
+        <fqname>@1.2::ICryptoFactory/widevine</fqname>
+        <fqname>@1.2::IDrmFactory/widevine</fqname>
     </hal>
     <hal format="hidl">
         <name>android.hardware.dumpstate</name>
@@ -216,6 +207,15 @@
         </interface>
     </hal>
     <hal format="hidl">
+        <name>android.hardware.media.c2</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IComponentStore</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
         <name>android.hardware.media.omx</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
@@ -240,16 +240,13 @@
     <hal format="hidl">
         <name>android.hardware.neuralnetworks</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IDevice</name>
-            <instance>paintbox</instance>
-        </interface>
+        <fqname>@1.0::IDevice/paintbox</fqname>
+        <fqname>@1.1::IDevice/default</fqname>
     </hal>
     <hal format="hidl">
         <name>android.hardware.nfc</name>
         <transport>hwbinder</transport>
-        <version>1.1</version>
+        <version>1.2</version>
         <interface>
             <name>INfc</name>
             <instance>default</instance>
@@ -265,11 +262,11 @@
         </interface>
     </hal>
     <hal format="hidl">
-        <name>android.hardware.power</name>
+        <name>android.hardware.power.stats</name>
         <transport>hwbinder</transport>
-        <version>1.3</version>
+        <version>1.0</version>
         <interface>
-            <name>IPower</name>
+            <name>IPowerStats</name>
             <instance>default</instance>
         </interface>
     </hal>
@@ -285,7 +282,7 @@
     <hal format="hidl">
         <name>vendor.google.radioext</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>IRadioExt</name>
             <instance>default</instance>
@@ -295,12 +292,13 @@
         <name>android.hardware.radio</name>
         <transport>hwbinder</transport>
         <fqname>@1.2::ISap/slot1</fqname>
-        <fqname>@1.2::IRadio/slot1</fqname>
+        <fqname>@1.3::IRadio/slot1</fqname>
+        <fqname>@1.3::IRadio/slot2</fqname>
     </hal>
     <hal format="hidl">
       <name>android.hardware.radio.config</name>
       <transport>hwbinder</transport>
-      <version>1.0</version>
+      <version>1.1</version>
       <interface>
         <name>IRadioConfig</name>
         <instance>default</instance>
@@ -327,22 +325,13 @@
     <hal format="hidl">
         <name>android.hardware.soundtrigger</name>
         <transport>hwbinder</transport>
-        <version>2.1</version>
+        <version>2.2</version>
         <interface>
             <name>ISoundTriggerHw</name>
             <instance>default</instance>
         </interface>
     </hal>
     <hal format="hidl">
-        <name>android.hardware.thermal</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IThermal</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>android.hardware.tetheroffload.config</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
@@ -399,7 +388,7 @@
     <hal format="hidl">
         <name>android.hardware.wifi</name>
         <transport>hwbinder</transport>
-        <version>1.2</version>
+        <version>1.3</version>
         <interface>
             <name>IWifi</name>
             <instance>default</instance>
@@ -408,7 +397,7 @@
     <hal format="hidl">
         <name>android.hardware.wifi.hostapd</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>IHostapd</name>
             <instance>default</instance>
@@ -417,7 +406,7 @@
     <hal format="hidl">
         <name>android.hardware.wifi.supplicant</name>
         <transport>hwbinder</transport>
-        <version>1.1</version>
+        <version>1.2</version>
         <interface>
             <name>ISupplicant</name>
             <instance>default</instance>
@@ -430,6 +419,7 @@
         <interface>
             <name>IImsRadio</name>
             <instance>imsradio0</instance>
+            <instance>imsradio1</instance>
         </interface>
     </hal>
     <hal format="hidl">
@@ -448,6 +438,7 @@
         <interface>
             <name>IQtiOemHook</name>
             <instance>oemhook0</instance>
+            <instance>oemhook1</instance>
         </interface>
     </hal>
     <hal format="hidl">
@@ -457,6 +448,7 @@
         <interface>
             <name>IUim</name>
             <instance>Uim0</instance>
+            <instance>Uim1</instance>
         </interface>
     </hal>
     <hal format="hidl">
@@ -520,6 +512,7 @@
         <interface>
             <name>IQcRilAudio</name>
             <instance>slot1</instance>
+            <instance>slot2</instance>
         </interface>
     </hal>
     <hal format="hidl">
@@ -551,19 +544,4 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl">
-        <name>hardware.google.media.c2</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IComponentStore</name>
-            <instance>default</instance>
-            <instance>software</instance>
-        </interface>
-        <interface>
-            <name>IConfigurable</name>
-            <instance>default</instance>
-            <instance>software</instance>
-        </interface>
-    </hal>
 </manifest>
diff --git a/media_codecs.xml b/media_codecs.xml
index 1c38779..062b94d 100644
--- a/media_codecs.xml
+++ b/media_codecs.xml
@@ -1,243 +1,212 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<!-- Copyright 2016 The Android Open Source Project
+<!--
+    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
+    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
+     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.
+    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.
 -->
 
 <!--
-<!DOCTYPE MediaCodecs [
-<!ELEMENT Include EMPTY>
-<!ATTLIST Include href CDATA #REQUIRED>
-<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
-<!ELEMENT Decoders (MediaCodec|Include)*>
-<!ELEMENT Encoders (MediaCodec|Include)*>
-<!ELEMENT MediaCodec (Type|Quirk|Include)*>
-<!ATTLIST MediaCodec name CDATA #REQUIRED>
-<!ATTLIST MediaCodec type CDATA>
-<!ELEMENT Type EMPTY>
-<!ATTLIST Type name CDATA #REQUIRED>
-<!ELEMENT Quirk EMPTY>
-<!ATTLIST Quirk name CDATA #REQUIRED>
-]>
+ 670 Non-Secure decoder capabilities
+ _________________________________________________________
+ | Codec       | W       H       fps     Mbps    MB/s    |
+ |_____________|_________________________________________|
+ | h264        | 4096    2160    24      100      829440 |
+ | hevc        | 4096    2160    24      100      829440 |
+ | mpeg4-sw    | 1920    1088    30      40       244800 |
+ | vp8         | 3840    2160    30      100      972000 |
+ | vp9         | 4096    2160    24      100      829440 |
+ | vc1         | 1920    1088    30      20       244800 |
+ | div4/5/6-sw | 1920    1088    30      10       244800 |
+ | h263-sw     | 864     480     30      16        48600 |
+ | mpeg2       | 1920    1088    30      40       244800 |
+ |_____________|_________________________________________|
 
-There's a simple and a complex syntax to declare the availability of a
-media codec:
+ 670 Secure decoder capabilities
+ ______________________________________________________
+ | Codec    | W       H       fps     Mbps    MB/s    |
+ |__________|_________________________________________|
+ | h264     | 3840    2160    30      35       972000 |
+ | vp9      | 3840    2160    30      35       972000 |
+ | hevc     | 3840    2160    30      35       972000 |
+ | mpeg2    | 1920    1088    30      35       244800 |
+ |__________|_________________________________________|
 
-A codec that properly follows the OpenMax spec and therefore doesn't have any
-quirks and that only supports a single content type can be declared like so:
-
-    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
-
-If a codec has quirks OR supports multiple content types, the following syntax
-can be used:
-
-    <MediaCodec name="OMX.foo.bar" >
-        <Type name="something/interesting" />
-        <Type name="something/else" />
-        ...
-        <Quirk name="requires-allocate-on-input-ports" />
-        <Quirk name="requires-allocate-on-output-ports" />
-        <Quirk name="output-buffers-are-unreadable" />
-    </MediaCodec>
-
-Only the three quirks included above are recognized at this point:
-
-"requires-allocate-on-input-ports"
-    must be advertised if the component does not properly support specification
-    of input buffers using the OMX_UseBuffer(...) API but instead requires
-    OMX_AllocateBuffer to be used.
-
-"requires-allocate-on-output-ports"
-    must be advertised if the component does not properly support specification
-    of output buffers using the OMX_UseBuffer(...) API but instead requires
-    OMX_AllocateBuffer to be used.
-
-"output-buffers-are-unreadable"
-    must be advertised if the emitted output buffers of a decoder component
-    are not readable, i.e. use a custom format even though abusing one of
-    the official OMX colorspace constants.
-    Clients of such decoders will not be able to access the decoded data,
-    naturally making the component much less useful. The only use for
-    a component with this quirk is to render the output to the screen.
-    Audio decoders MUST NOT advertise this quirk.
-    Video decoders that advertise this quirk must be accompanied by a
-    corresponding color space converter for thumbnail extraction,
-    matching surfaceflinger support that can render the custom format to
-    a texture and possibly other code, so just DON'T USE THIS QUIRK.
-
-
--->
-
-<!--
- SDM670 Decoder capabilities
- __________________________________________________________________
- | Codec    | W       H       fps     Mbps    MB/s    | Secure-dec |
- |__________|_________________________________________|____________|
- | h264     | 4096    2160    24      100     829440  |  Y         |
- | hevc     | 4096    2160    60      100     829440  |  Y         |
- | vp8      | 3840    2160    30      100     979200  |  N         |
- | vp9      | 4096    2160    24      100     829440  |  Y         |
- |__________|_________________________________________|____________|
-
-
- SDM670 Encoder capabilities
+ 670 Non-Secure encoder capabilities (Secure not supported)
  ______________________________________________________
  | Codec    | W       H       fps     Mbps    MB/s    |
  |__________|_________________________________________|
  | h264     | 4096    2160    24      100     829440  |
  | hevc     | 4096    2160    24      100     829440  |
- | vp8      | 3840    2160    30      100     979200  |
+ | mpeg4-sw | 1280     720    30      4       108000  |
+ | vp8      | 3840    2160    30      100     972000  |
+ | h263-sw  | 864     480     30      2       48600   |
  |__________|_________________________________________|
 -->
 
 <MediaCodecs>
-    <Include href="media_codecs_google_audio.xml" />
-    <Include href="media_codecs_google_telephony.xml" />
+    <Include href="media_codecs_omx.xml" />
     <Settings>
         <Setting name="max-video-encoder-input-buffers" value="11" />
+        <Domain name="telephony" enabled="true" />
     </Settings>
-    <Encoders>
-        <!-- Audio Hardware  -->
-        <!-- Audio Software  -->
-        <!-- Video Hardware  -->
-        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Quirk name="requires-loaded-to-idle-after-allocation" />
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Quirk name="requires-loaded-to-idle-after-allocation" />
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-20000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Quirk name="requires-loaded-to-idle-after-allocation" />
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-            <Limit name="quality" range="0-100"  default="80" />
-            <Feature name="bitrate-modes" value="VBR,CQ" />
-        </MediaCodec>
-    </Encoders>
     <Decoders>
-       <!-- Video Hardware  -->
-        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
+        <!-- C2 decoders -->
+        <MediaCodec name="c2.qti.avc.decoder" type="video/avc">
+            <Alias name="OMX.qcom.video.decoder.avc" />
             <Limit name="size" min="96x96" max="4096x2160" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="972000" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-30" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-20000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-20000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-20000000" />
-            <Limit name="frame-rate" range="1-30" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="1" max="979200" />
+            <Limit name="blocks-per-second" range="24-979200" />
             <Limit name="bitrate" range="1-100000000" />
             <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
         </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2160" />
+        <MediaCodec name="c2.qti.avc.decoder.secure" type="video/avc" >
+            <Alias name="OMX.qcom.video.decoder.avc.secure" />
+            <Limit name="size" min="96x96" max="3840x2160" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
             <Limit name="blocks-per-second" min="1" max="972000" />
-            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="bitrate" range="1-35000000" />
             <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
         </MediaCodec>
-        <!-- Audio Software  -->
+        <MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" >
+            <Alias name="OMX.qcom.video.decoder.hevc" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="c2.qti.hevc.decoder.secure" type="video/hevc" >
+            <Alias name="OMX.qcom.video.decoder.hevc.secure" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp8.decoder" type="video/x-vnd.on2.vp8" >
+            <Alias name="OMX.qcom.video.decoder.vp8" />
+            <Limit name="size" min="96x96" max="3840x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="28" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" >
+            <Alias name="OMX.qcom.video.decoder.vp9" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-120000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp9.decoder.secure" type="video/x-vnd.on2.vp9" >
+            <Alias name="OMX.qcom.video.decoder.vp9.secure" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-120000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+        </MediaCodec>
     </Decoders>
-    <Include href="media_codecs_google_video.xml" />
+    <Encoders>
+        <!-- C2 encoders -->
+        <MediaCodec name="c2.qti.avc.encoder" type="video/avc">
+            <Alias name="OMX.qcom.video.encoder.avc" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+        </MediaCodec>
+        <MediaCodec name="c2.qti.hevc.encoder" type="video/hevc">
+            <Alias name="OMX.qcom.video.encoder.hevc" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-120000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100"  default="80" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="bitrate-modes" value="VBR,CQ" />
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp8.encoder" type="video/x-vnd.on2.vp8">
+            <Alias name="OMX.qcom.video.encoder.vp8" />
+            <Limit name="size" min="96x96" max="3840x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-120000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="28" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+    </Encoders>
 </MediaCodecs>
diff --git a/media_codecs_c2.xml b/media_codecs_c2.xml
deleted file mode 100644
index 8928bfb..0000000
--- a/media_codecs_c2.xml
+++ /dev/null
@@ -1,275 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
-    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.
--->
-
-<!--
- 670 Non-Secure decoder capabilities
- _________________________________________________________
- | Codec       | W       H       fps     Mbps    MB/s    |
- |_____________|_________________________________________|
- | h264        | 4096    2160    24      100      829440 |
- | hevc        | 4096    2160    24      100      829440 |
- | mpeg4-sw    | 1920    1088    30      40       244800 |
- | vp8         | 3840    2160    30      100      972000 |
- | vp9         | 4096    2160    24      100      829440 |
- | vc1         | 1920    1088    30      20       244800 |
- | div4/5/6-sw | 1920    1088    30      10       244800 |
- | h263-sw     | 864     480     30      16        48600 |
- | mpeg2       | 1920    1088    30      40       244800 |
- |_____________|_________________________________________|
-
- 670 Secure decoder capabilities
- ______________________________________________________
- | Codec    | W       H       fps     Mbps    MB/s    |
- |__________|_________________________________________|
- | h264     | 3840    2160    30      35       972000 |
- | vp9      | 3840    2160    30      35       972000 |
- | hevc     | 3840    2160    30      35       972000 |
- | mpeg2    | 1920    1088    30      35       244800 |
- |__________|_________________________________________|
-
- 670 Non-Secure encoder capabilities (Secure not supported)
- ______________________________________________________
- | Codec    | W       H       fps     Mbps    MB/s    |
- |__________|_________________________________________|
- | h264     | 4096    2160    24      100     829440  |
- | hevc     | 4096    2160    24      100     829440  |
- | mpeg4-sw | 1280     720    30      4       108000  |
- | vp8      | 3840    2160    30      100     972000  |
- | h263-sw  | 864     480     30      2       48600   |
- |__________|_________________________________________|
--->
-
-<Included>
-    <Decoders>
-        <!-- C2 decoders -->
-        <MediaCodec name="c2.qti.avc.decoder" type="video/avc">
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" range="24-979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-            <Feature name="adaptive-playback" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.avc.decoder.secure" type="video/avc" >
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="1" max="972000" />
-            <Limit name="bitrate" range="1-35000000" />
-            <Limit name="frame-rate" range="1-30" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.hevc.decoder.secure" type="video/hevc" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.vp8.decoder" type="video/x-vnd.on2.vp8" >
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.vp9.decoder.secure" type="video/x-vnd.on2.vp9" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-
-        <!-- OMX alias decoders (Codec2 decoders with OMX names) -->
-        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc">
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" range="24-979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-            <Feature name="adaptive-playback" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="1" max="972000" />
-            <Limit name="bitrate" range="1-35000000" />
-            <Limit name="frame-rate" range="1-30" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="6" />
-        </MediaCodec>
-    </Decoders>
-
-    <Encoders>
-        <!-- C2 encoders -->
-        <MediaCodec name="c2.qti.avc.encoder" type="video/avc">
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.hevc.encoder" type="video/hevc">
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-            <Limit name="quality" range="0-100"  default="80" />
-            <Feature name="bitrate-modes" value="VBR,CQ" />
-        </MediaCodec>
-        <MediaCodec name="c2.qti.vp8.encoder" type="video/x-vnd.on2.vp8">
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-
-        <!-- OMX alias encoders (Codec2 encoders with OMX names) -->
-        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc">
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc">
-            <Limit name="size" min="96x96" max="4096x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-            <Limit name="quality" range="0-100"  default="80" />
-            <Feature name="bitrate-modes" value="VBR,CQ" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8">
-            <Limit name="size" min="96x96" max="3840x2160" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="24" max="979200" />
-            <Limit name="bitrate" range="1-120000000" />
-            <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-
-    </Encoders>
-    <Include href="media_codecs_google_c2_audio.xml" />
-    <Include href="media_codecs_google_c2_video.xml" />
-</Included>
diff --git a/media_codecs_omx.xml b/media_codecs_omx.xml
new file mode 100644
index 0000000..da791c0
--- /dev/null
+++ b/media_codecs_omx.xml
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright 2016 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.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+
+<!--
+ SDM670 Decoder capabilities
+ __________________________________________________________________
+ | Codec    | W       H       fps     Mbps    MB/s    | Secure-dec |
+ |__________|_________________________________________|____________|
+ | h264     | 4096    2160    24      100     829440  |  Y         |
+ | hevc     | 4096    2160    60      100     829440  |  Y         |
+ | vp8      | 3840    2160    30      100     979200  |  N         |
+ | vp9      | 4096    2160    24      100     829440  |  Y         |
+ |__________|_________________________________________|____________|
+
+
+ SDM670 Encoder capabilities
+ ______________________________________________________
+ | Codec    | W       H       fps     Mbps    MB/s    |
+ |__________|_________________________________________|
+ | h264     | 4096    2160    24      100     829440  |
+ | hevc     | 4096    2160    24      100     829440  |
+ | vp8      | 3840    2160    30      100     979200  |
+ |__________|_________________________________________|
+-->
+
+<Included>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="972000" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="1" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="1" max="972000" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="3840x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="28" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="3840x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="96x96" max="3840x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+        </MediaCodec>
+        <!-- Audio Software  -->
+    </Decoders>
+    <Encoders>
+        <!-- Audio Hardware  -->
+        <!-- Audio Software  -->
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="4096x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100"  default="80" />
+            <Limit name="performance-point-4096x2304" value="56" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Feature name="bitrate-modes" value="VBR,CQ" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="3840x2160" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="24" max="979200" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2304" value="28" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+    </Encoders>
+    <Include href="media_codecs_google_video.xml" />
+</Included>
diff --git a/media_codecs_performance.xml b/media_codecs_performance.xml
index ea7b8a5..87ef858 100644
--- a/media_codecs_performance.xml
+++ b/media_codecs_performance.xml
@@ -14,45 +14,36 @@
      limitations under the License.
 -->
 
-<!-- Generated file for sargo using measurements between PPR1.180419.002 and PPR1.180514.002 -->
+<!-- Generated file for b4s4 using measurements on PD2A.190102.002 by get_achievable_rates.py-->
 <MediaCodecs>
     <Encoders>
-        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
-            <!-- measured 98%:178-558 med:223/223 N=90 FLAKY(112 - 558 < mx=558.7) -->
-            <Limit name="measured-frame-rate-320x240" range="223-279" /> <!-- v98%=1.8 (-PPR1.180510.004) -->
-            <!-- measured 97%:94-204 med:151/154 N=52 -->
-            <Limit name="measured-frame-rate-720x480" range="151-154" /> <!-- v97%=1.5 -->
-            <Limit name="measured-frame-rate-1280x720" range="85-85" /> <!-- N=100 v98%=1.5 -->
-            <!-- measured 98%:43-84 med:61/60 N=82 -->
-            <Limit name="measured-frame-rate-1920x1080" range="60-64" /> <!-- v98%=1.4 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
-            <!-- measured 98%:172-518 med:224/224 N=90 FLAKY(112 - 518 < mx=546.7) -->
-            <Limit name="measured-frame-rate-320x240" range="224-274" /> <!-- TWEAKED v98%=1.7 (-PPR1.180510.004) -->
-            <!-- measured 98%:95-190 med:158/158 N=82 -->
-            <Limit name="measured-frame-rate-720x480" range="158-158" /> <!-- v98%=1.4 -->
-            <!-- measured 98%:52-88 med:81/81 N=80 -->
-            <Limit name="measured-frame-rate-1280x720" range="81-81" /> <!-- v98%=1.3 -->
-            <!-- measured 97%:45-64 med:53/53 N=52 -->
-            <Limit name="measured-frame-rate-1920x1080" range="53-53" /> <!-- v97%=1.2 -->
-            <!-- measured 98%:17-46 med:19/25 N=80 -->
-            <Limit name="measured-frame-rate-3840x2160" range="19-28" /> <!-- v98%=1.6 -->
-        </MediaCodec>
-        <!-- Measurements between PPR1.180419.002 and PPR1.180510.004 -->
-        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <!-- measured 98%:144-500 med:230/230 N=92 -->
-            <Limit name="measured-frame-rate-320x180" range="230-337" /> <!-- v98%=1.9 (-PPR1.180514.002) -->
-            <!-- measured 98%:125-268 med:181/182 N=90 -->
-            <Limit name="measured-frame-rate-640x360" range="181-182" /> <!-- v98%=1.5 -->
-            <!-- measured 98%:52-97 med:82/81 N=92 -->
-            <Limit name="measured-frame-rate-1280x720" range="81-81" /> <!-- v98%=1.4 (-PPR1.180514.002) -->
-            <!-- measured 97%:45-72 med:51/51 N=58 -->
-            <Limit name="measured-frame-rate-1920x1080" range="51-51" /> <!-- v97%=1.3 -->
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="392-406" /> <!-- N=22 v90%=1.4 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
             <!-- measured 98%:216-758 med:553/552 FLAKY(mn=213.5 < 216 - 1104) -->
             <Limit name="measured-frame-rate-176x144" range="427-552" /> <!-- TWEAKED N=100 v98%=1.9 -->
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="204-220" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-720x480" range="126-129" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="52-53" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="38-40" /> <!-- N=22 v90%=1.2 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="205-219" /> <!-- N=22 v90%=1.7 -->
+            <Limit name="measured-frame-rate-720x480" range="82-103" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="53-53" /> <!-- N=22 v90%=1.6 -->
+            <!-- measured 90%:14-24 med:15 SLOW -->
+            <Limit name="measured-frame-rate-1920x1080" range="23-28" /> <!-- N=22 v90%=1.3 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="205-224" /> <!-- N=22 v90%=1.6 -->
+            <Limit name="measured-frame-rate-720x480" range="125-125" /> <!-- N=22 v90%=1.7 -->
+            <Limit name="measured-frame-rate-1280x720" range="52-53" /> <!-- N=22 v90%=1.5 -->
+            <!-- measured 90%:6-33 med:13 variance:2.2 -->
+            <Limit name="measured-frame-rate-1920x1080" range="41-41" /> <!-- N=22 -->
+        </MediaCodec>
         <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
             <!-- measured 98%:211-388 med:262/262 N=80 -->
             <Limit name="measured-frame-rate-320x240" range="262-262" /> <!-- v98%=1.4 -->
@@ -62,10 +53,48 @@
             <!-- measured 98%:39-51 med:44/45 N=82 -->
             <Limit name="measured-frame-rate-1920x1080" range="44-45" /> <!-- v98%=1.1 -->
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="227-238" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-720x480" range="117-117" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="45-45" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="38-38" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-3840x2160" range="12-16" /> <!-- N=22 v90%=1.4 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="203-203" /> <!-- N=22 v90%=1.7 -->
+            <Limit name="measured-frame-rate-720x480" range="116-116" /> <!-- N=22 v90%=1.7 -->
+            <Limit name="measured-frame-rate-1280x720" range="45-45" /> <!-- N=22 v90%=1.5 -->
+            <!-- measured 90%:7-33 med:13 variance:2.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="39-39" /> <!-- N=22 -->
+            <Limit name="measured-frame-rate-3840x2160" range="16-16" /> <!-- N=22 v90%=1.4 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <!-- measured 90%:159-355 med:227 FLAKY(113 - 476 < mx=643.5) -->
+            <Limit name="measured-frame-rate-176x144" range="374-391" /> <!-- N=22 v90%=1.5 -->
+        </MediaCodec>
         <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
             <!-- measured 98%:213-786 med:531/540 N=98 FLAKY(mn=209.9 < 213 - 1080) -->
             <Limit name="measured-frame-rate-176x144" range="419-540" /> <!-- TWEAKED v98%=1.9 -->
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="179-179" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-640x360" range="165-173" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-1280x720" range="51-51" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="34-40" /> <!-- N=22 v90%=1.1 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="332-332" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-640x360" range="119-122" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-1280x720" range="36-37" /> <!-- N=22 v90%=1.6 -->
+            <Limit name="measured-frame-rate-1920x1080" range="13-14" /> <!-- N=22 v90%=1.3 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="182-182" /> <!-- N=22 v90%=1.6 -->
+            <Limit name="measured-frame-rate-640x360" range="170-170" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-1280x720" range="51-51" /> <!-- N=22 v90%=1.6 -->
+            <!-- measured 90%:7-16 med:13 FLAKY(5 - 20 < mx=32.2) -->
+            <Limit name="measured-frame-rate-1920x1080" range="38-39" /> <!-- N=22 v90%=1.5 -->
+        </MediaCodec>
         <!-- Measurements between PPR1.180419.002 and PPR1.180510.004 -->
         <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
             <!-- measured 98%:37-66 med:59/58 N=92 -->
@@ -77,59 +106,39 @@
             <!-- measured 97%:11-15 med:12/12 N=58 -->
             <Limit name="measured-frame-rate-1920x1080" range="12-12" /> <!-- v97%=1.1 -->
         </MediaCodec>
+        <MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="140-195" />
+            <Limit name="measured-frame-rate-640x360" range="61-61" />
+            <Limit name="measured-frame-rate-1280x720" range="20-20" />
+        </MediaCodec>
     </Encoders>
-    <!-- Measurements between PPR1.180419.002 and PPR1.180510.004 -->
     <Decoders>
-        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
-            <!-- measured 97%:160-656 med:291/301 N=56 variance:2.0 -->
-            <Limit name="measured-frame-rate-320x240" range="291-388" />
-            <!-- measured 98%:170-465 med:340/338 N=64 -->
-            <Limit name="measured-frame-rate-720x480" range="321-354" /> <!-- v98%=1.7 -->
-            <!-- measured 98%:165-224 med:220/220 N=62 -->
-            <Limit name="measured-frame-rate-1280x720" range="220-220" /> <!-- v98%=1.2 -->
-            <!-- measured 97%:179-268 med:245/245 N=56 -->
-            <Limit name="measured-frame-rate-1920x1080" range="245-245" /> <!-- v97%=1.2 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
-            <!-- measured 98%:164-752 med:273/284 N=62 variance:2.1 -->
-            <Limit name="measured-frame-rate-352x288" range="273-408" /> <!-- (-PPR1.180514.002) -->
-            <!-- measured 97%:161-578 med:368/399 N=56 FLAKY(mn=159.7 < 161 - 858) -->
-            <Limit name="measured-frame-rate-640x360" range="322-429" /> <!-- v97%=1.9 -->
-            <!-- measured 97%:163-486 med:340/322 N=56 -->
-            <Limit name="measured-frame-rate-720x480" range="322-365" /> <!-- v97%=1.7 -->
-            <!-- measured 95%:169-399 med:356/358 N=38 -->
-            <Limit name="measured-frame-rate-1280x720" range="324-358" /> <!-- v95%=1.5 (-PPR1.180514.002) -->
-            <!-- measured 98%:167-308 med:283/283 N=64 -->
-            <Limit name="measured-frame-rate-1920x1080" range="283-283" /> <!-- v98%=1.4 -->
-            <!-- measured 97%:68-72 med:70/70 N=56 -->
-            <Limit name="measured-frame-rate-3840x2160" range="20-20" /> <!-- v97%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <!-- measured 98%:162-996 med:242/253 N=62 FLAKY(121 - 996 < mx=1008.1) variance:2.5 -->
-            <Limit name="measured-frame-rate-320x180" range="242-498" /> <!-- (-PPR1.180514.002) -->
-            <!-- measured 98%:170-701 med:351/348 N=64 FLAKY(mn=168.8 < 170 - 856) variance:2.0 -->
-            <Limit name="measured-frame-rate-640x360" range="339-428" />
-            <!-- measured 98%:234-405 med:392/389 N=62 -->
-            <Limit name="measured-frame-rate-1280x720" range="321-389" /> <!-- v98%=1.3 -->
-            <!-- measured 97%:200-205 med:203/203 N=56 -->
-            <Limit name="measured-frame-rate-1920x1080" range="203-203" /> <!-- v97%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
-            <!-- measured 98%:162-489 med:246/247 N=62 FLAKY(123 - 594 < mx=860.6) -->
-            <Limit name="measured-frame-rate-320x180" range="246-297" /> <!-- v98%=1.7 -->
-            <!-- measured 98%:164-639 med:344/335 N=62 -->
-            <Limit name="measured-frame-rate-640x360" range="303-397" /> <!-- v98%=2.0 -->
-            <!-- measured 98%:174-367 med:331/336 N=64 -->
-            <Limit name="measured-frame-rate-1280x720" range="331-336" /> <!-- v98%=1.5 -->
-            <!-- measured 95%:141-241 med:206/206 N=38 -->
-            <Limit name="measured-frame-rate-1920x1080" range="206-206" /> <!-- v95%=1.3 (-PPR1.180514.002) -->
-            <!-- measured 98%:33-49 med:45/45 N=62 -->
-            <Limit name="measured-frame-rate-3840x2160" range="25-25" /> <!-- v98%=1.2 -->
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="713-713" /> <!-- N=22 v90%=1.4 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
             <!-- measured 97%:166-611 med:238/236 N=56 FLAKY(118 - 612 < mx=626.6) -->
             <Limit name="measured-frame-rate-176x144" range="236-306" /> <!-- v97%=1.9 -->
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="768-787" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-720x480" range="534-536" /> <!-- N=22 v90%=1.6 -->
+            <!-- measured 90%:97-218 med:109 SLOW -->
+            <Limit name="measured-frame-rate-1280x720" range="377-378" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-1920x1080" range="179-180" /> <!-- N=22 v90%=1.1 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="305-305" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-720x480" range="63-64" /> <!--  v90%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="23-23" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="11-11" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="768-832" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-720x480" range="536-536" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-1280x720" range="377-377" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-1920x1080" range="179-180" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
         <!-- Measurements between PPR1.180419.002 and PPR1.180514.002 -->
         <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
             <!-- measured 98%:166-778 med:251/255 N=62 FLAKY(126 - 778 < mx=781.3) variance:2.2 -->
@@ -141,6 +150,29 @@
             <!-- measured 95%:23-31 med:26/26 N=38 -->
             <Limit name="measured-frame-rate-1920x1080" range="26-26" /> <!-- v95%=1.2 -->
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="838-838" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-640x360" range="606-606" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-720x480" range="505-505" /> <!-- N=22 v90%=1.2 -->
+            <Limit name="measured-frame-rate-1280x720" range="398-399" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="209-209" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-3840x2160" range="51-51" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="317-331" /> <!-- N=22 v90%=1.3  -->
+            <Limit name="measured-frame-rate-640x360" range="150-160" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-720x480" range="140-150" /> <!-- N=22 v90%=1.1-->
+            <Limit name="measured-frame-rate-1280x720" range="61-61" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="38-39" /> <!-- N=22 v90%=1.1 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="837-837" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-640x360" range="596-601" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-720x480" range="503-503" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-1280x720" range="397-398" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-1920x1080" range="209-209" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-3840x2160" range="51-51" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
         <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
             <!-- measured 97%:176-462 med:362/363 N=56 FLAKY(mn=175.5 < 176 - 726) -->
             <Limit name="measured-frame-rate-352x288" range="351-363" /> <!-- v97%=1.6 -->
@@ -153,10 +185,31 @@
             <!-- measured 98%:58-69 med:66/66 N=62 -->
             <Limit name="measured-frame-rate-1920x1080" range="66-66" /> <!-- v98%=1.1 -->
         </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="623-728" /> <!-- N=22 v90%=1.5 -->
+        </MediaCodec>
         <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" update="true">
             <!-- measured 97%:165-732 med:231/230 N=56 variance:2.1 -->
             <Limit name="measured-frame-rate-176x144" range="230-405" />
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="683-683" /> <!-- N=22 v90%=1.8 -->
+            <Limit name="measured-frame-rate-640x360" range="354-509" /> <!-- N=22 v90%=1.4 -->
+            <Limit name="measured-frame-rate-1280x720" range="395-396" /> <!-- N=22 v90%=1.2 -->
+            <Limit name="measured-frame-rate-1920x1080" range="198-199" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="422-422" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-640x360" range="158-159" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-1280x720" range="36-36" /> <!-- v98%=1.2  -->
+            <Limit name="measured-frame-rate-1920x1080" range="13-13" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="593-593" /> <!-- N=22 v90%=1.8 -->
+            <Limit name="measured-frame-rate-640x360" range="505-505" /> <!-- N=22 v90%=1.5 -->
+            <Limit name="measured-frame-rate-1280x720" range="396-396" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-1920x1080" range="198-199" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
         <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
             <!-- measured 95%:172-515 med:323/322 N=38 -->
             <Limit name="measured-frame-rate-320x180" range="1173-1174" /> <!-- v95%=1.7 (-PPB1.181031.001) -->
@@ -165,6 +218,32 @@
             <!-- measured 98%:43-45 med:43/43 N=62 -->
             <Limit name="measured-frame-rate-1920x1080" range="43-43" /> <!-- v98%=1.0 (-PPR1.180514.002) -->
         </MediaCodec>
+       <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="587-587" /> <!-- N=22 v90%=1.6 -->
+            <Limit name="measured-frame-rate-640x360" range="472-472" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-1280x720" range="339-340" /> <!-- N=22 v90%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="190-200" /> <!-- N=22 v90%=1.0 -->
+            <Limit name="measured-frame-rate-3840x2160" range="48-48" /> <!-- N=22 v90%=1.0 -->
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="435-436" /> <!-- N=22 v90%=1.0 -->
+            <!-- measured 90%:63-157 med:102 FLAKY(50 - 200 < mx=223.5) -->
+            <Limit name="measured-frame-rate-640x360" range="129-130" /> <!-- N=22 v90%=1.6 -->
+            <Limit name="measured-frame-rate-1280x720" range="70-71" /> <!-- N=22 v90%=1.3 -->
+            <Limit name="measured-frame-rate-1920x1080" range="42-43" /> <!-- N=22 v90%=1.3 -->
+        </MediaCodec>
+        <MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <!-- measured 90%:437-632 med:536 N=16 -->
+            <Limit name="measured-frame-rate-320x184" range="578-578" /> <!-- v90%=1.2 -->
+            <!-- measured 90%:494-634 med:560 N=16 -->
+            <Limit name="measured-frame-rate-640x360" range="474-475" /> <!-- v90%=1.1 -->
+            <!-- measured 90%:339-342 med:340 N=16 -->
+            <Limit name="measured-frame-rate-1280x720" range="339-340" /> <!-- v90%=1.0 -->
+            <!-- measured 90%:199-201 med:200 N=16 -->
+            <Limit name="measured-frame-rate-1920x1080" range="200-200" /> <!-- v90%=1.0 -->
+            <!-- measured 90%:20-22 med:21 N=16 -->
+            <Limit name="measured-frame-rate-3840x2160" range="48-48" /> <!-- v90%=1.0 -->
+        </MediaCodec>
         <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
             <!-- measured 98%:172-1171 med:382/381 N=62 FLAKY(143 - 1172 < mx=1176.5) variance:2.6 -->
             <Limit name="measured-frame-rate-320x180" range="286-586" />
diff --git a/media_codecs_performance_c2.xml b/media_codecs_performance_c2.xml
deleted file mode 100644
index 6d78043..0000000
--- a/media_codecs_performance_c2.xml
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!-- Copyright 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.
--->
-
-<!-- Generated file for b4s4 using measurements on PD2A.190102.002 by get_achievable_rates.py-->
-<MediaCodecs>
-    <Encoders>
-        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
-            <Limit name="measured-frame-rate-176x144" range="392-406" /> <!-- N=22 v90%=1.4 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="204-220" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-720x480" range="126-129" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="52-53" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="38-40" /> <!-- N=22 v90%=1.2 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="205-219" /> <!-- N=22 v90%=1.7 -->
-            <Limit name="measured-frame-rate-720x480" range="82-103" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="53-53" /> <!-- N=22 v90%=1.6 -->
-            <!-- measured 90%:14-24 med:15 SLOW -->
-            <Limit name="measured-frame-rate-1920x1080" range="23-28" /> <!-- N=22 v90%=1.3 -->
-        </MediaCodec>
-        <MediaCodec name="c2.qti.avc.encoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="205-224" /> <!-- N=22 v90%=1.6 -->
-            <Limit name="measured-frame-rate-720x480" range="125-125" /> <!-- N=22 v90%=1.7 -->
-            <Limit name="measured-frame-rate-1280x720" range="52-53" /> <!-- N=22 v90%=1.5 -->
-            <!-- measured 90%:6-33 med:13 variance:2.2 -->
-            <Limit name="measured-frame-rate-1920x1080" range="41-41" /> <!-- N=22 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="227-238" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-720x480" range="117-117" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="45-45" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="38-38" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-3840x2160" range="12-16" /> <!-- N=22 v90%=1.4 -->
-        </MediaCodec>
-        <MediaCodec name="c2.qti.hevc.encoder" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="203-203" /> <!-- N=22 v90%=1.7 -->
-            <Limit name="measured-frame-rate-720x480" range="116-116" /> <!-- N=22 v90%=1.7 -->
-            <Limit name="measured-frame-rate-1280x720" range="45-45" /> <!-- N=22 v90%=1.5 -->
-            <!-- measured 90%:7-33 med:13 variance:2.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="39-39" /> <!-- N=22 -->
-            <Limit name="measured-frame-rate-3840x2160" range="16-16" /> <!-- N=22 v90%=1.4 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
-            <!-- measured 90%:159-355 med:227 FLAKY(113 - 476 < mx=643.5) -->
-            <Limit name="measured-frame-rate-176x144" range="374-391" /> <!-- N=22 v90%=1.5 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="179-179" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-640x360" range="165-173" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-1280x720" range="51-51" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="34-40" /> <!-- N=22 v90%=1.1 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="332-332" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-640x360" range="119-122" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-1280x720" range="36-37" /> <!-- N=22 v90%=1.6 -->
-            <Limit name="measured-frame-rate-1920x1080" range="13-14" /> <!-- N=22 v90%=1.3 -->
-        </MediaCodec>
-        <MediaCodec name="c2.qti.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="182-182" /> <!-- N=22 v90%=1.6 -->
-            <Limit name="measured-frame-rate-640x360" range="170-170" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-1280x720" range="51-51" /> <!-- N=22 v90%=1.6 -->
-            <!-- measured 90%:7-16 med:13 FLAKY(5 - 20 < mx=32.2) -->
-            <Limit name="measured-frame-rate-1920x1080" range="38-39" /> <!-- N=22 v90%=1.5 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
-            <Limit name="measured-frame-rate-320x180" range="140-195" />
-            <Limit name="measured-frame-rate-640x360" range="61-61" />
-            <Limit name="measured-frame-rate-1280x720" range="20-20" />
-        </MediaCodec>
-    </Encoders>
-    <Decoders>
-        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
-            <Limit name="measured-frame-rate-176x144" range="713-713" /> <!-- N=22 v90%=1.4 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="768-787" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-720x480" range="534-536" /> <!-- N=22 v90%=1.6 -->
-            <!-- measured 90%:97-218 med:109 SLOW -->
-            <Limit name="measured-frame-rate-1280x720" range="377-378" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-1920x1080" range="179-180" /> <!-- N=22 v90%=1.1 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="305-305" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-720x480" range="63-64" /> <!--  v90%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="23-23" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="11-11" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="c2.qti.avc.decoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="768-832" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-720x480" range="536-536" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-1280x720" range="377-377" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-1920x1080" range="179-180" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-352x288" range="838-838" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-640x360" range="606-606" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-720x480" range="505-505" /> <!-- N=22 v90%=1.2 -->
-            <Limit name="measured-frame-rate-1280x720" range="398-399" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="209-209" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-3840x2160" range="51-51" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-352x288" range="317-331" /> <!-- N=22 v90%=1.3  -->
-            <Limit name="measured-frame-rate-640x360" range="150-160" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-720x480" range="140-150" /> <!-- N=22 v90%=1.1-->
-            <Limit name="measured-frame-rate-1280x720" range="61-61" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="38-39" /> <!-- N=22 v90%=1.1 -->
-        </MediaCodec>
-        <MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-352x288" range="837-837" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-640x360" range="596-601" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-720x480" range="503-503" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-1280x720" range="397-398" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-1920x1080" range="209-209" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-3840x2160" range="51-51" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="623-728" /> <!-- N=22 v90%=1.5 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="683-683" /> <!-- N=22 v90%=1.8 -->
-            <Limit name="measured-frame-rate-640x360" range="354-509" /> <!-- N=22 v90%=1.4 -->
-            <Limit name="measured-frame-rate-1280x720" range="395-396" /> <!-- N=22 v90%=1.2 -->
-            <Limit name="measured-frame-rate-1920x1080" range="198-199" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="422-422" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-640x360" range="158-159" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-1280x720" range="36-36" /> <!-- v98%=1.2  -->
-            <Limit name="measured-frame-rate-1920x1080" range="13-13" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="c2.qti.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="593-593" /> <!-- N=22 v90%=1.8 -->
-            <Limit name="measured-frame-rate-640x360" range="505-505" /> <!-- N=22 v90%=1.5 -->
-            <Limit name="measured-frame-rate-1280x720" range="396-396" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-1920x1080" range="198-199" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
-            <Limit name="measured-frame-rate-320x180" range="587-587" /> <!-- N=22 v90%=1.6 -->
-            <Limit name="measured-frame-rate-640x360" range="472-472" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-1280x720" range="339-340" /> <!-- N=22 v90%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="190-200" /> <!-- N=22 v90%=1.0 -->
-            <Limit name="measured-frame-rate-3840x2160" range="48-48" /> <!-- N=22 v90%=1.0 -->
-        </MediaCodec>
-        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
-            <Limit name="measured-frame-rate-320x180" range="435-436" /> <!-- N=22 v90%=1.0 -->
-            <!-- measured 90%:63-157 med:102 FLAKY(50 - 200 < mx=223.5) -->
-            <Limit name="measured-frame-rate-640x360" range="129-130" /> <!-- N=22 v90%=1.6 -->
-            <Limit name="measured-frame-rate-1280x720" range="70-71" /> <!-- N=22 v90%=1.3 -->
-            <Limit name="measured-frame-rate-1920x1080" range="42-43" /> <!-- N=22 v90%=1.3 -->
-        </MediaCodec>
-         <MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
-            <!-- measured 90%:437-632 med:536 N=16 -->
-            <Limit name="measured-frame-rate-320x184" range="578-578" /> <!-- v90%=1.2 -->
-            <!-- measured 90%:494-634 med:560 N=16 -->
-            <Limit name="measured-frame-rate-640x360" range="474-475" /> <!-- v90%=1.1 -->
-            <!-- measured 90%:339-342 med:340 N=16 -->
-            <Limit name="measured-frame-rate-1280x720" range="339-340" /> <!-- v90%=1.0 -->
-            <!-- measured 90%:199-201 med:200 N=16 -->
-            <Limit name="measured-frame-rate-1920x1080" range="200-200" /> <!-- v90%=1.0 -->
-            <!-- measured 90%:20-22 med:21 N=16 -->
-            <Limit name="measured-frame-rate-3840x2160" range="48-48" /> <!-- v90%=1.0 -->
-        </MediaCodec>
-    </Decoders>
-</MediaCodecs>
diff --git a/mixer_paths_intcodec_b4.xml b/mixer_paths_intcodec_b4.xml
index 4cf72ae..0ae4c1b 100644
--- a/mixer_paths_intcodec_b4.xml
+++ b/mixer_paths_intcodec_b4.xml
@@ -1196,6 +1196,11 @@
         <ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1" />
     </path>
 
+    <path name="voicemmode1-call hearing-aid">
+        <ctl name="AFE_PCM_RX_Voice Mixer VoiceMMode1" value="1"/>
+        <ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1"/>
+    </path>
+
     <path name="voicemmode1-call handset">
         <ctl name="SEC_TDM_RX_0_Voice Mixer VoiceMMode1" value="1" />
         <ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1" />
@@ -1838,6 +1843,10 @@
         <path name="speaker-dmic-endfire" />
     </path>
 
+    <path name="hearing-aid-mic">
+        <path name="speaker-dmic-endfire" />
+    </path>
+
     <path name="voice-speaker-dmic-ef-att">
         <path name="speaker-dmic-endfire" />
     </path>
diff --git a/mixer_paths_intcodec_s4.xml b/mixer_paths_intcodec_s4.xml
index 4cf72ae..0ae4c1b 100644
--- a/mixer_paths_intcodec_s4.xml
+++ b/mixer_paths_intcodec_s4.xml
@@ -1196,6 +1196,11 @@
         <ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1" />
     </path>
 
+    <path name="voicemmode1-call hearing-aid">
+        <ctl name="AFE_PCM_RX_Voice Mixer VoiceMMode1" value="1"/>
+        <ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1"/>
+    </path>
+
     <path name="voicemmode1-call handset">
         <ctl name="SEC_TDM_RX_0_Voice Mixer VoiceMMode1" value="1" />
         <ctl name="VoiceMMode1_Tx Mixer PRI_TDM_TX_0_MMode1" value="1" />
@@ -1838,6 +1843,10 @@
         <path name="speaker-dmic-endfire" />
     </path>
 
+    <path name="hearing-aid-mic">
+        <path name="speaker-dmic-endfire" />
+    </path>
+
     <path name="voice-speaker-dmic-ef-att">
         <path name="speaker-dmic-endfire" />
     </path>
diff --git a/nfc/libnfc-nci.conf b/nfc/libnfc-nci.conf
index 32009ad..2dea7b6 100644
--- a/nfc/libnfc-nci.conf
+++ b/nfc/libnfc-nci.conf
@@ -41,7 +41,7 @@
 # NFA_TECHNOLOGY_MASK_KOVIO         0x20    /* Proprietary Technology       */
 # NFA_TECHNOLOGY_MASK_A_ACTIVE      0x40    /* NFC Technology A active mode */
 # NFA_TECHNOLOGY_MASK_F_ACTIVE      0x80    /* NFC Technology F active mode */
-POLLING_TECH_MASK=0x6F
+POLLING_TECH_MASK=0x2F
 
 ###############################################################################
 # Force P2P to only listen for the following technology(s).
@@ -54,7 +54,7 @@
 # NFA_TECHNOLOGY_MASK_F             0x04    /* NFC Technology F             */
 # NFA_TECHNOLOGY_MASK_A_ACTIVE      0x40    /* NFC Technology A active mode */
 # NFA_TECHNOLOGY_MASK_F_ACTIVE      0x80    /* NFC Technology F active mode */
-P2P_LISTEN_TECH_MASK=0x41
+P2P_LISTEN_TECH_MASK=0x00
 
 PRESERVE_STORAGE=0x01
 
@@ -84,5 +84,9 @@
 DEFAULT_FELICA_SYS_CODE={FE:FE}
 
 ###############################################################################
+#Set if the AID routing should be blocked for the power modes not supported.
+NFA_AID_BLOCK_ROUTE=1
+
+###############################################################################
 # Power state for off host AID routing
-OFFHOST_AID_ROUTE_PWR_STATE=0x39
+OFFHOST_AID_ROUTE_PWR_STATE=0x3B
diff --git a/nfc/libnfc-nxp.bonito.conf b/nfc/libnfc-nxp.bonito.conf
index 7694786..3286d5f 100644
--- a/nfc/libnfc-nxp.bonito.conf
+++ b/nfc/libnfc-nxp.bonito.conf
@@ -179,7 +179,7 @@
     A0, 38, 04, 1A, 0B, 0B, 00,
     A0, 3A, 08, 19, 00, 19, 00, 19, 00, 19, 00,
     A0, B2, 01, 19,
-    A0, 91, 01, 00
+    A0, 91, 01, 01
 }
 
 ###############################################################################
@@ -325,3 +325,18 @@
 DEFAULT_SYS_CODE_PWR_STATE=0x3B
 
 ###############################################################################
+# Configure the NFCEEIDs of offhost UICC.
+# UICC  0x80 (UICC)
+OFFHOST_ROUTE_UICC={80}
+
+###############################################################################
+# Configure the NFCEEIDs of offhost eSEs.
+# eSE   0xC0 (eSE)
+OFFHOST_ROUTE_ESE={C0}
+
+###############################################################################
+# Configure the list of NFCEE for the ISO-DEP routing.
+# host  0x00
+# eSE   0xC0 (eSE)
+# UICC  0x80 (UICC)
+DEFAULT_ISODEP_ROUTE=0x80
diff --git a/nfc/libnfc-nxp.sargo.conf b/nfc/libnfc-nxp.sargo.conf
index 32cff77..1f35e63 100644
--- a/nfc/libnfc-nxp.sargo.conf
+++ b/nfc/libnfc-nxp.sargo.conf
@@ -179,7 +179,7 @@
     A0, 38, 04, 1A, 0B, 0B, 00,
     A0, 3A, 08, 0F, 00, 0F, 00, 0F, 00, 0F, 00,
     A0, B2, 01, 19,
-    A0, 91, 01, 00
+    A0, 91, 01, 01
 }
 
 ###############################################################################
@@ -325,3 +325,18 @@
 DEFAULT_SYS_CODE_PWR_STATE=0x3B
 
 ###############################################################################
+# Configure the NFCEEIDs of offhost UICC.
+# UICC  0x80 (UICC)
+OFFHOST_ROUTE_UICC={80}
+
+###############################################################################
+# Configure the NFCEEIDs of offhost eSEs.
+# eSE   0xC0 (eSE)
+OFFHOST_ROUTE_ESE={C0}
+
+###############################################################################
+# Configure the list of NFCEE for the ISO-DEP routing.
+# host  0x00
+# eSE   0xC0 (eSE)
+# UICC  0x80 (UICC)
+DEFAULT_ISODEP_ROUTE=0x80
diff --git a/nfc/manifest_se_eSE1.xml b/nfc/manifest_se_eSE1.xml
index 3eb7431..b334e0d 100644
--- a/nfc/manifest_se_eSE1.xml
+++ b/nfc/manifest_se_eSE1.xml
@@ -2,7 +2,7 @@
     <hal format="hidl">
         <name>android.hardware.secure_element</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>ISecureElement</name>
             <instance>eSE1</instance>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 3845c0e..1708b4a 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -67,6 +67,11 @@
         <item>3</item> <!-- COLOR_MODE_AUTOMATIC -->
     </integer-array>
 
+    <!-- Color mode to use when accessibility transforms are enabled. This color mode must be
+     supported by the device, but not necessarily appear in config_availableColorModes. The
+     regularly selected color mode will be used if this value is negative. -->
+    <integer name="config_accessibilityColorMode">2</integer>
+
     <!-- Boolean indicating whether the HWC setColorTransform function can be performed efficiently
          in hardware. -->
     <bool name="config_setColorTransformAccelerated">true</bool>
@@ -129,6 +134,9 @@
          device does not support multiple advertisement-->
     <integer translatable="false" name="config_bluetooth_max_advertisers">4</integer>
 
+    <!-- Whether Hearing Aid profile is supported -->
+    <bool name="config_hearing_aid_profile_supported">true</bool>
+
     <!-- Operating voltage for bluetooth controller. 0 by default-->
     <integer translatable="false" name="config_bluetooth_operating_voltage_mv">3300</integer>
 
@@ -208,7 +216,7 @@
 
    <!-- Enable doze mode
          ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
-    <string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
+    <string translatable="false" name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
 
     <!-- If true, the doze component is not started until after the screen has been turned off
          and the screen off animation has been performed. -->
@@ -224,7 +232,7 @@
     <bool name="config_displayBlanksAfterDoze">true</bool>
 
     <!-- ImsService package name to bind to by default, if config_dynamic_bind_ims is true -->
-    <string name="config_ims_package">org.codeaurora.ims</string>
+    <string name="config_ims_package" translatable="false">org.codeaurora.ims</string>
 
     <!-- Flag specifying whether or not IMS will use the ImsResolver dynamically -->
     <bool name="config_dynamic_bind_ims">true</bool>
@@ -309,15 +317,16 @@
     <!-- Default list of files pinned by the Pinner Service -->
     <string-array translatable="false" name="config_defaultPinnerServiceFiles">
         <item>"/system/framework/arm64/boot-framework.oat"</item>
-        <item>"/system/framework/boot-framework.vdex"</item>
+        <item>"/system/framework/framework.jar"</item>
         <item>"/system/framework/oat/arm64/services.odex"</item>
-        <item>"/system/framework/oat/arm64/services.vdex"</item>
+        <item>"/system/framework/services.jar"</item>
         <item>"/system/framework/arm64/boot.oat"</item>
-        <item>"/system/framework/boot.vdex"</item>
         <item>"/system/framework/arm64/boot-core-libart.oat"</item>
-        <item>"/system/framework/boot-core-libart.vdex"</item>
-        <item>"/system/priv-app/SystemUIGoogle/oat/arm64/SystemUIGoogle.vdex"</item>
-        <item>"/system/priv-app/SystemUIGoogle/oat/arm64/SystemUIGoogle.odex"</item>
+        <item>"/apex/com.android.runtime/javalib/core-oj.jar"</item>
+        <item>"/apex/com.android.runtime/javalib/core-libart.jar"</item>
+        <item>"/apex/com.android.media/javalib/updatable-media.jar"</item>
+        <item>"/product/priv-app/SystemUIGoogle/SystemUIGoogle.apk"</item>
+        <item>"/product/priv-app/SystemUIGoogle/oat/arm64/SystemUIGoogle.odex"</item>
         <item>"/system/lib64/libsurfaceflinger.so"</item>
     </string-array>
 
@@ -336,9 +345,6 @@
     <!-- True if Unprocessed audio source supports the required frequency range and level -->
     <bool name="config_supportAudioSourceUnprocessed">true</bool>
 
-    <!-- Colon separated list of package names that should be granted DND access -->
-    <string name="config_defaultDndAccessPackages" translatable="false">com.google.android.gms:com.google.android.GoogleCamera:com.google.android.settings.intelligence</string>
-
     <!-- Enables or disables haptic effect when the text insertion/selection handle is moved
          manually by the user. -->
     <bool name="config_enableHapticTextHandle">true</bool>
@@ -389,14 +395,6 @@
          meanings. -->
     <integer name="config_defaultNotificationVibrationIntensity">3</integer>
 
-    <!-- Boolean indicating whether framework needs to set the tx power limit for meeting SAR
-         requirements -->
-    <bool translatable="false" name="config_wifi_framework_enable_sar_tx_power_limit">true</bool>
-
-    <!-- Boolean indicating whether framework should use detection of softAP mode to set the tx
-         power limit for meeting SAR requirements -->
-    <bool translatable="false" name="config_wifi_framework_enable_soft_ap_sar_tx_power_limit">true</bool>
-
     <!-- Applications which are disabled unless matching a particular sku -->
     <string-array name="config_disableApksUnlessMatchedSku_apk_list" translatable="false">
         <item>com.felicanetworks.mfs</item>
@@ -407,9 +405,11 @@
         <item>com.felicanetworks.mfm</item>
     </string-array>
 
-    <!-- Set lowmemorykiller threshold -->
-    <integer name="config_lowMemoryKillerMinFreeKbytesAdjust">163840</integer>
+    <!-- True if the firmware supports Wi-Fi link probing -->
+    <bool name="config_wifi_link_probing_supported">true</bool>
 
-    <!-- Set direct background reclaim threshold -->
-    <integer name="config_extraFreeKbytesAbsolute">80000</integer>
+    <!-- True if the firmware supports connected MAC randomization -->
+    <bool name="config_wifi_connected_mac_randomization_supported">true</bool>
+    <!-- Enable Zram writeback feature to allow unused pages in zram be written to flash. -->
+    <bool name="config_zramWriteback">true</bool>
 </resources>
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 3bef421..bbac886 100644
--- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -18,5 +18,7 @@
 -->
 <resources>
     <!-- Default for Settings.System.VIBRATE_WHEN_RINGING -->
-    <bool name="def_vibrate_when_ringing">true</bool>
+    <bool name="def_vibrate_when_ringing">false</bool>
+    <!-- Default for Settings.Global.APPLY_RAMPING_RINGER -->
+    <bool name="def_apply_ramping_ringer">true</bool>
 </resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
index b97b372..fb7e8cb 100644
--- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
+++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -36,24 +36,4 @@
 
     <!-- Doze: whether the double tap sensor reports 2D touch coordinates -->
     <bool name="doze_double_tap_reports_touch_coordinates">true</bool>
-
-    <!-- Whether to show a warning notification when the device reaches a certain temperature. -->
-    <integer name="config_showTemperatureWarning">1</integer>
-
-    <!-- Whether to show a alarm dialog when the device of usb cable reaches a certain temperature. -->
-    <integer name="config_showTemperatureAlarm">1</integer>
-
-    <!-- Temp at which to show a alarm dialog if config_showTemperatureAlarm is true.
-         If < 0, uses the skin temperature sensor shutdown value of index[1] from
-         HardwarePropertiesManager#getDeviceTemperatures -->
-    <integer name="config_alarmTemperature">63</integer>
-
-    <!-- Whether or not beep sound should be when overheat -->
-    <bool name="config_alarmTemperatureBeepSound">false</bool>
-
-    <!-- Fudge factor for how much below the shutdown temp to show the warning. -->
-    <integer name="config_warningTemperatureTolerance">4</integer>
-
-    <!-- Fudge factor for how much below the overheat temp to dismiss alarm. -->
-    <integer name="config_alarmTemperatureTolerance">10</integer>
 </resources>
diff --git a/overlay/packages/apps/Bluetooth/res/values/config.xml b/overlay/packages/apps/Bluetooth/res/values/config.xml
index 6db14c0..e403105 100644
--- a/overlay/packages/apps/Bluetooth/res/values/config.xml
+++ b/overlay/packages/apps/Bluetooth/res/values/config.xml
@@ -29,4 +29,5 @@
 -->
 <resources>
     <bool name="profile_supported_sap">true</bool>
+    <bool name="profile_supported_hearing_aid">true</bool>
 </resources>
diff --git a/overlay/packages/apps/Settings/res/values/strings.xml b/overlay/packages/apps/Nfc/res/values/config.xml
similarity index 62%
rename from overlay/packages/apps/Settings/res/values/strings.xml
rename to overlay/packages/apps/Nfc/res/values/config.xml
index 4aec4c1..9d194dd 100644
--- a/overlay/packages/apps/Settings/res/values/strings.xml
+++ b/overlay/packages/apps/Nfc/res/values/config.xml
@@ -1,5 +1,5 @@
-<!--
-     Copyright (C) 2018 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
@@ -13,7 +13,9 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- Help URI, USB overheat [DO NOT TRANSLATE] -->
-    <string name="help_uri_usb_warm" translatable="false">intent:#Intent;action=com.google.android.gms.googlehelp.LAUNCH;S.EXTRA_CONTEXT=android_usb_warm;end</string>
+<resources>
+  <string-array name="config_skuSupportsSecureNfc" translatable="false">
+    <item>G020D</item>
+    <item>G020H</item>
+  </string-array>
 </resources>
diff --git a/permissions/privapp-permissions-aosp.xml b/permissions/privapp-permissions-aosp.xml
deleted file mode 100644
index 7ac49f6..0000000
--- a/permissions/privapp-permissions-aosp.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<permissions>
-    <privapp-permissions package="com.qualcomm.qcrilmsgtunnel">
-        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
-    </privapp-permissions>
-
-    <privapp-permissions package="com.quicinc.cne.CNEService">
-        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
-        <permission name="android.permission.PACKET_KEEPALIVE_OFFLOAD"/>
-    </privapp-permissions>
-</permissions>
diff --git a/pixelstats/Android.bp b/pixelstats/Android.bp
index 74dca0e..bb65839 100644
--- a/pixelstats/Android.bp
+++ b/pixelstats/Android.bp
@@ -18,11 +18,8 @@
   init_rc: ["pixelstats-vendor.bonito.rc"],
   srcs: [
     "service.cpp",
-    "DropDetect.cpp",
-    "UeventListener.cpp",
   ],
   shared_libs: [
-    "hardware.google.pixelstats@1.0",
     "libbase",
     "libbinder",
     "libcutils",
@@ -30,11 +27,11 @@
     "libhidltransport",
     "liblog",
     "libutils",
+    "libpixelstats",
   ],
   proprietary: true,
   static_libs: [
   "chre_client",
-  "libpixelstats",
   ],
   header_libs: ["chre_api"],
 }
diff --git a/pixelstats/DropDetect.cpp b/pixelstats/DropDetect.cpp
deleted file mode 100644
index b038eb3..0000000
--- a/pixelstats/DropDetect.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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.
- */
-#include "DropDetect.h"
-
-#include "chre/util/nanoapp/app_id.h"
-#include "chre_host/host_protocol_host.h"
-#include "chre_host/socket_client.h"
-
-#include <hardware/google/pixelstats/1.0/IPixelStats.h>
-#define LOG_TAG "pixelstats-vendor"
-#include <log/log.h>
-
-#include <inttypes.h>
-
-using namespace android::chre;
-using android::sp;
-using android::chre::IChreMessageHandlers;
-
-// following convention of CHRE code.
-namespace fbs = ::chre::fbs;
-
-namespace device {
-namespace google {
-namespace bonito {
-
-namespace {  // anonymous namespace for file-local definitions
-constexpr int64_t kDropDetectAppId = 0x476f6f676c001010ULL;
-constexpr char kChreSocketName[] = "chre";
-
-// This struct is defined in nanoapps/drop/messaging.h
-// by the DropDetect nanoapp.
-struct __attribute__((__packed__)) DropEventPayload {
-    float confidence;
-    float accel_magnitude_peak;
-    int32_t free_fall_duration_ns;
-};
-
-// This enum is defined in nanoapps/drop/messaging.h
-// by the DropDetect nanoapp.
-enum DropConstants {
-    kDropEnableRequest = 1,
-    kDropEnableNotification = 2,
-    kDropDisableRequest = 3,
-    kDropDisableNotification = 4,
-    kDropEventDetection = 5,
-};
-
-void requestNanoappList(SocketClient &client) {
-    flatbuffers::FlatBufferBuilder builder(64);
-    HostProtocolHost::encodeNanoappListRequest(builder);
-
-    if (!client.sendMessage(builder.GetBufferPointer(), builder.GetSize())) {
-        ALOGE("Failed to send NanoappList request");
-    }
-}
-
-}  // namespace
-
-void DropDetect::onConnected() {
-    requestNanoappList(*this);
-}
-
-/**
- * Decode unix socket msgs to CHRE messages, and call the appropriate
- * callback depending on the CHRE message.
- */
-void DropDetect::onMessageReceived(const void *data, size_t length) {
-    if (!HostProtocolHost::decodeMessageFromChre(data, length, *this)) {
-        ALOGE("Failed to decode message");
-    }
-}
-
-/**
- * Handle the response of a NanoappList request.
- * Ensure that the Drop Detect nanoapp is running.
- */
-void DropDetect::handleNanoappListResponse(const fbs::NanoappListResponseT &response) {
-    for (const std::unique_ptr<fbs::NanoappListEntryT> &nanoapp : response.nanoapps) {
-        if (nanoapp->app_id == kDropDetectAppId) {
-            if (!nanoapp->enabled)
-                ALOGE("Drop Detect app not enabled");
-            else
-                ALOGI("Drop Detect enabled");
-            return;
-        }
-    }
-    ALOGE("Drop Detect app not found");
-}
-
-/**
- * listen for messages from the DropDetect nanoapp and report them to
- * PixelStats.
- */
-void DropDetect::handleNanoappMessage(const fbs::NanoappMessageT &message) {
-    struct DropEventPayload *message_struct;
-
-    if (message.app_id != kDropDetectAppId || message.message_type != kDropEventDetection ||
-        message.message.size() < sizeof(struct DropEventPayload))
-        return;
-    message_struct = (struct DropEventPayload *)&message.message[0];
-    /*
-     * ALOGI("Received drop detect message! Confidence %f Peak %f Duration %g",
-     *     message_struct->confidence, message_struct->accel_magnitude_peak,
-     *     message_struct->free_fall_duration_ns / 1e9);
-     */
-    int32_t confidence = message_struct->confidence * 100;
-    confidence = std::min(confidence, 100);
-    confidence = std::max(0, confidence);
-
-    int32_t accel_magnitude_peak_1000ths_g = message_struct->accel_magnitude_peak * 1000.0;
-    int32_t free_fall_duration_ms = message_struct->free_fall_duration_ns / 1000000;
-
-    using ::hardware::google::pixelstats::V1_0::IPixelStats;
-    sp<IPixelStats> client = IPixelStats::tryGetService();
-    if (!client) {
-        ALOGE("Unable to connect to PixelStats service");
-        return;
-    }
-    client->reportPhysicalDropDetected(confidence, accel_magnitude_peak_1000ths_g,
-                                       free_fall_duration_ms);
-}
-
-sp<DropDetect> DropDetect::start() {
-    sp<DropDetect> dropDetect = new DropDetect();
-
-    if (!dropDetect->connectInBackground(kChreSocketName, dropDetect)) {
-        ALOGE("Couldn't connect to CHRE socket");
-        return nullptr;
-    }
-    return dropDetect;
-}
-
-}  // namespace bonito
-}  // namespace google
-}  // namespace device
diff --git a/pixelstats/DropDetect.h b/pixelstats/DropDetect.h
deleted file mode 100644
index 1dd239c..0000000
--- a/pixelstats/DropDetect.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef DEVICE_GOOGLE_BONITO_PIXELSTATS_DROPDETECT_H
-#define DEVICE_GOOGLE_BONITO_PIXELSTATS_DROPDETECT_H
-
-#include <utils/StrongPointer.h>
-#include "chre_host/host_protocol_host.h"
-#include "chre_host/socket_client.h"
-
-namespace device {
-namespace google {
-namespace bonito {
-
-class DropDetect : public android::chre::SocketClient::ICallbacks,
-                   public android::chre::IChreMessageHandlers,
-                   public android::chre::SocketClient {
-  public:
-    static android::sp<DropDetect> start();
-
-    void onConnected() override;
-    void onMessageReceived(const void *data, size_t length) override;
-
-    void handleNanoappMessage(const ::chre::fbs::NanoappMessageT &message) override;
-    void handleNanoappListResponse(const ::chre::fbs::NanoappListResponseT &response) override;
-};
-
-}  // namespace bonito
-}  // namespace google
-}  // namespace device
-
-#endif  // DEVICE_GOOGLE_BONITO_PIXELSTATS_DROPDETECT_H
diff --git a/pixelstats/UeventListener.cpp b/pixelstats/UeventListener.cpp
deleted file mode 100644
index 3ea86dd..0000000
--- a/pixelstats/UeventListener.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * 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.
- */
-
-#define LOG_TAG "pixelstats-uevent"
-
-#include "UeventListener.h"
-
-#include <android-base/logging.h>
-#include <android-base/parseint.h>
-#include <android-base/strings.h>
-#include <cutils/uevent.h>
-#include <hardware/google/pixelstats/1.0/IPixelStats.h>
-#include <log/log.h>
-#include <utils/StrongPointer.h>
-
-#include <unistd.h>
-#include <thread>
-
-namespace device {
-namespace google {
-namespace bonito {
-
-constexpr int32_t UEVENT_MSG_LEN = 2048;  // it's 2048 in all other users.
-
-// Report connection & disconnection of devices into the USB-C connector.
-void UeventListener::ReportUsbConnectorUevents(const char *power_supply_typec_mode) {
-    using ::hardware::google::pixelstats::V1_0::IPixelStats;
-    if (!power_supply_typec_mode) {
-        // No mode reported -> No reporting.
-        return;
-    }
-
-    // It's attached if the string *doesn't* match.
-    int attached = !!strcmp(power_supply_typec_mode, "POWER_SUPPLY_TYPEC_MODE=Nothing attached");
-    if (attached == is_usb_attached_) {
-        return;
-    }
-    is_usb_attached_ = attached;
-
-    android::sp<IPixelStats> client = IPixelStats::tryGetService();
-    if (!client) {
-        ALOGE("Unable to connect to PixelStats service");
-        return;
-    }
-
-    if (attached) {
-        client->reportUsbConnectorConnected();
-        usb_connect_time_ = android::base::Timer();
-    } else {
-        client->reportUsbConnectorDisconnected(usb_connect_time_.duration().count());
-    }
-}
-
-// Report connection & disconnection of USB audio devices.
-void UeventListener::ReportUsbAudioUevents(const char *driver, const char *product,
-                                           const char *action) {
-    // driver is not provided on remove, so it can be NULL.  Check in remove branch.
-    if (!product || !action) {
-        return;
-    }
-
-    // The PRODUCT of a USB audio device is PRODUCT=VID/PID/VERSION
-    std::vector<std::string> halves = android::base::Split(product, "=");
-    if (halves.size() != 2) {
-        return;
-    }
-    std::vector<std::string> vidPidVer = android::base::Split(halves[1], "/");
-    if (vidPidVer.size() != 3) {
-        return;
-    }
-
-    // Parse the VID/PID as hex values.
-    const int kBaseHex = 16;
-    int32_t vid, pid;
-    char *vidEnd = NULL, *pidEnd = NULL;
-
-    const char *vidC = vidPidVer[0].c_str();
-    vid = strtol(vidC, &vidEnd, kBaseHex);
-    if ((vidC == vidEnd) || !vidEnd || (*vidEnd != '\0')) {
-        return;
-    }
-
-    const char *pidC = vidPidVer[1].c_str();
-    pid = strtol(pidC, &pidEnd, kBaseHex);
-    if ((pidC == pidEnd) || !pidEnd || (*pidEnd != '\0')) {
-        return;
-    }
-
-    /* A uevent is generated for each audio interface - only report the first connected one
-     * for each device by storing its PRODUCT= string in attached_product_, and clearing
-     * it on disconnect.  This also means we will only report the first USB audio device attached
-     * to the system. Only attempt to connect to the HAL when reporting an event.
-     */
-    using ::hardware::google::pixelstats::V1_0::IPixelStats;
-    if (!attached_product_ && !strcmp(action, "ACTION=add")) {
-        if (!driver || strcmp(driver, "DRIVER=snd-usb-audio")) {
-            return;
-        }
-        usb_audio_connect_time_ = android::base::Timer();
-        attached_product_ = strdup(product);
-
-        android::sp<IPixelStats> client = IPixelStats::tryGetService();
-        if (!client) {
-            ALOGE("Couldn't connect to PixelStats service for audio connect");
-            return;
-        }
-        client->reportUsbAudioConnected(vid, pid);
-    } else if (attached_product_ && !strcmp(action, "ACTION=remove")) {
-        if (strcmp(attached_product_, product)) {
-            // Not the expected product detaching.
-            return;
-        }
-        free(attached_product_);
-        attached_product_ = NULL;
-
-        android::sp<IPixelStats> client = IPixelStats::tryGetService();
-        if (!client) {
-            ALOGE("Couldn't connect to PixelStats service for audio disconnect");
-            return;
-        }
-        client->reportUsbAudioDisconnected(vid, pid, usb_audio_connect_time_.duration().count());
-    }
-}
-
-void UeventListener::ReportMicBroken(const char *devpath, const char *mic_break_status) {
-    if (!devpath || !mic_break_status)
-        return;
-    if (!strcmp(devpath, "DEVPATH=/kernel/q6audio/q6voice_uevent") &&
-        !strcmp(mic_break_status, "MIC_BREAK_STATUS=TRUE")) {
-        ALOGD("%s: Detect MicBroken", __func__);
-        using ::hardware::google::pixelstats::V1_0::IPixelStats;
-        android::sp<IPixelStats> client = IPixelStats::tryGetService();
-        if (!client) {
-            ALOGE("Couldn't connect to PixelStats service for mic break");
-            return;
-        }
-        client->reportHardwareFailed(IPixelStats::HardwareType::MICROPHONE, 0,
-                                     IPixelStats::HardwareErrorCode::COMPLETE);
-    }
-}
-
-bool UeventListener::ProcessUevent() {
-    char msg[UEVENT_MSG_LEN + 2];
-    char *cp;
-    const char *action, *power_supply_typec_mode, *driver, *product;
-    const char *mic_break_status;
-    const char *devpath;
-    int n;
-
-    if (uevent_fd_ < 0) {
-        uevent_fd_ = uevent_open_socket(64 * 1024, true);
-        if (uevent_fd_ < 0) {
-            ALOGE("uevent_init: uevent_open_socket failed\n");
-            return false;
-        }
-    }
-
-    n = uevent_kernel_multicast_recv(uevent_fd_, msg, UEVENT_MSG_LEN);
-    if (n <= 0 || n >= UEVENT_MSG_LEN)
-        return false;
-
-    // Ensure double-null termination of msg.
-    msg[n] = '\0';
-    msg[n + 1] = '\0';
-
-    action = power_supply_typec_mode = driver = product = NULL;
-    mic_break_status = devpath = NULL;
-
-    /**
-     * msg is a sequence of null-terminated strings.
-     * Iterate through and record positions of string/value pairs of interest.
-     * Double null indicates end of the message. (enforced above).
-     */
-    cp = msg;
-    while (*cp) {
-        if (!strncmp(cp, "ACTION=", strlen("ACTION="))) {
-            action = cp;
-        } else if (!strncmp(cp, "POWER_SUPPLY_TYPEC_MODE=", strlen("POWER_SUPPLY_TYPEC_MODE="))) {
-            power_supply_typec_mode = cp;
-        } else if (!strncmp(cp, "DRIVER=", strlen("DRIVER="))) {
-            driver = cp;
-        } else if (!strncmp(cp, "PRODUCT=", strlen("PRODUCT="))) {
-            product = cp;
-        } else if (!strncmp(cp, "MIC_BREAK_STATUS=", strlen("MIC_BREAK_STATUS="))) {
-            mic_break_status = cp;
-        } else if (!strncmp(cp, "DEVPATH=", strlen("DEVPATH="))) {
-            devpath = cp;
-        }
-
-        /* advance to after the next \0 */
-        while (*cp++) {
-        }
-    }
-
-    /* Process the strings recorded. */
-    ReportUsbConnectorUevents(power_supply_typec_mode);
-    ReportUsbAudioUevents(driver, product, action);
-    ReportMicBroken(devpath, mic_break_status);
-
-    return true;
-}
-
-UeventListener::UeventListener()
-    : uevent_fd_(-1), is_usb_attached_(false), attached_product_(nullptr) {}
-
-/* Thread function for ListenForeverInNewThread.
- * Exit after kMaxConsecutiveErrors to prevent spinning. */
-static void createAndListenForever() {
-    UeventListener listener;
-    constexpr int kMaxConsecutiveErrors = 10;
-    int consecutive_errors = 0;
-    while (1) {
-        if (listener.ProcessUevent()) {
-            consecutive_errors = 0;
-        } else {
-            if (++consecutive_errors >= kMaxConsecutiveErrors) {
-                ALOGE("Too many ProcessUevent errors; exiting UeventListener.");
-                return;
-            }
-        }
-    }
-}
-
-/* Create a UeventListener in a new thread and process uevents forever. */
-void UeventListener::ListenForeverInNewThread() {
-    std::thread listenThread(createAndListenForever);
-    listenThread.detach();
-}
-
-}  // namespace bonito
-}  // namespace google
-}  // namespace device
diff --git a/pixelstats/UeventListener.h b/pixelstats/UeventListener.h
deleted file mode 100644
index 1c7e966..0000000
--- a/pixelstats/UeventListener.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef DEVICE_GOOGLE_BONITO_PIXELSTATS_UEVENTLISTENER_H
-#define DEVICE_GOOGLE_BONITO_PIXELSTATS_UEVENTLISTENER_H
-
-#include <android-base/chrono_utils.h>
-
-namespace device {
-namespace google {
-namespace bonito {
-
-/**
- * A class to listen for uevents and report reliability events to
- * the PixelStats HAL.
- * Runs in a background thread if created with ListenForeverInNewThread().
- * Alternatively, process one message at a time with ProcessUevent().
- */
-class UeventListener {
-  public:
-    UeventListener();
-
-    bool ProcessUevent();                    // Process a single Uevent.
-    static void ListenForeverInNewThread();  // Process Uevents forever in a new thread.
-  private:
-    void ReportUsbConnectorUevents(const char *power_supply_typec_mode);
-    void ReportUsbAudioUevents(const char *driver, const char *product, const char *action);
-    void ReportMicBroken(const char *devpath, const char *mic_break_status);
-
-    int uevent_fd_;
-
-    bool is_usb_attached_;                         // Tracks USB port connectivity state.
-    android::base::Timer usb_connect_time_;        // Time of last USB port connection.
-    android::base::Timer usb_audio_connect_time_;  // Time of last USB audio connection.
-    char *attached_product_;  // PRODUCT= string of currently attached USB audio device.
-};
-
-}  // namespace bonito
-}  // namespace google
-}  // namespace device
-
-#endif  // DEVICE_GOOGLE_BONITO_PIXELSTATS_UEVENTLISTENER_H
diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp
index d172d9d..2e72f44 100644
--- a/pixelstats/service.cpp
+++ b/pixelstats/service.cpp
@@ -20,13 +20,13 @@
 #include <utils/StrongPointer.h>
 
 #include <pixelstats/SysfsCollector.h>
-#include "DropDetect.h"
-#include "UeventListener.h"
+#include <pixelstats/DropDetect.h>
+#include <pixelstats/UeventListener.h>
 
 using android::sp;
 using android::hardware::google::pixel::SysfsCollector;
-using device::google::bonito::DropDetect;
-using device::google::bonito::UeventListener;
+using android::hardware::google::pixel::DropDetect;
+using android::hardware::google::pixel::UeventListener;
 
 const struct SysfsCollector::SysfsPaths sysfs_paths = {
     .SlowioReadCntPath = "/sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_read_cnt",
@@ -52,7 +52,9 @@
         return 1;
     }
 
-    UeventListener::ListenForeverInNewThread();
+    UeventListener ueventListener("");
+    std::thread listenThread(&UeventListener::ListenForever, &ueventListener);
+    listenThread.detach();
 
     SysfsCollector collector(sysfs_paths);
     collector.collect();  // This blocks forever.
diff --git a/power-libperfmgr/CameraMode.h b/power-libperfmgr/CameraMode.h
deleted file mode 100644
index 967f3f5..0000000
--- a/power-libperfmgr/CameraMode.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __CAMERA_MODE_H__
-#define __CAMERA_MODE_H__
-
-enum CameraStreamingMode {
-    CAMERA_STREAMING_OFF = 0,
-    CAMERA_STREAMING,
-    CAMERA_STREAMING_1080P,
-    CAMERA_STREAMING_4K,
-    CAMERA_STREAMING_MAX
-};
-
-#endif  //__CAMERA_MODE_H__
\ No newline at end of file
diff --git a/power-libperfmgr/InteractionHandler.cpp b/power-libperfmgr/InteractionHandler.cpp
deleted file mode 100644
index fd70678..0000000
--- a/power-libperfmgr/InteractionHandler.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * 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.
- */
-
-//#define LOG_NDEBUG 0
-
-#define LOG_TAG "android.hardware.power@1.3-service.bonito-libperfmgr"
-#define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL)
-
-#include <fcntl.h>
-#include <poll.h>
-#include <sys/eventfd.h>
-#include <time.h>
-#include <unistd.h>
-#include <utils/Log.h>
-#include <utils/Trace.h>
-
-#include "InteractionHandler.h"
-
-#define FB_IDLE_PATH "/sys/class/drm/card0/device/idle_state"
-#define MAX_LENGTH 64
-
-#define MSINSEC 1000L
-#define USINMS 1000000L
-
-InteractionHandler::InteractionHandler(std::shared_ptr<HintManager> const & hint_manager)
-    : mState(INTERACTION_STATE_UNINITIALIZED),
-      mWaitMs(100),
-      mMinDurationMs(1400),
-      mMaxDurationMs(5650),
-      mDurationMs(0),
-      mHintManager(hint_manager) {
-}
-
-InteractionHandler::~InteractionHandler() {
-    Exit();
-}
-
-bool InteractionHandler::Init() {
-    std::lock_guard<std::mutex> lk(mLock);
-
-    if (mState != INTERACTION_STATE_UNINITIALIZED)
-        return true;
-
-    mIdleFd = open(FB_IDLE_PATH, O_RDONLY);
-    if (mIdleFd < 0) {
-        ALOGE("Unable to open idle state path (%d)", errno);
-        return false;
-    }
-
-    mEventFd = eventfd(0, EFD_NONBLOCK);
-    if (mEventFd < 0) {
-        ALOGE("Unable to create event fd (%d)", errno);
-        close(mIdleFd);
-        return false;
-    }
-
-    mState = INTERACTION_STATE_IDLE;
-    mThread = std::unique_ptr<std::thread>(
-        new std::thread(&InteractionHandler::Routine, this));
-
-    return true;
-}
-
-void InteractionHandler::Exit() {
-    std::unique_lock<std::mutex> lk(mLock);
-    if (mState == INTERACTION_STATE_UNINITIALIZED)
-        return;
-
-    AbortWaitLocked();
-    mState = INTERACTION_STATE_UNINITIALIZED;
-    lk.unlock();
-
-    mCond.notify_all();
-    mThread->join();
-
-    close(mEventFd);
-    close(mIdleFd);
-}
-
-void InteractionHandler::PerfLock() {
-    ALOGV("%s: acquiring perf lock", __func__);
-    if (!mHintManager->DoHint("INTERACTION")) {
-        ALOGE("%s: do hint INTERACTION failed", __func__);
-    }
-    ATRACE_INT("interaction_lock", 1);
-}
-
-void InteractionHandler::PerfRel() {
-    ALOGV("%s: releasing perf lock", __func__);
-    if (!mHintManager->EndHint("INTERACTION")) {
-        ALOGE("%s: end hint INTERACTION failed", __func__);
-    }
-    ATRACE_INT("interaction_lock", 0);
-}
-
-long long InteractionHandler::CalcTimespecDiffMs(struct timespec start,
-                                               struct timespec end) {
-    long long diff_in_us = 0;
-    diff_in_us += (end.tv_sec - start.tv_sec) * MSINSEC;
-    diff_in_us += (end.tv_nsec - start.tv_nsec) / USINMS;
-    return diff_in_us;
-}
-
-void InteractionHandler::Acquire(int32_t duration) {
-    ATRACE_CALL();
-
-    std::lock_guard<std::mutex> lk(mLock);
-    if (mState == INTERACTION_STATE_UNINITIALIZED) {
-        ALOGW("%s: called while uninitialized", __func__);
-        return;
-    }
-
-    int inputDuration = duration + 650;
-    int finalDuration;
-    if (inputDuration > mMaxDurationMs)
-        finalDuration = mMaxDurationMs;
-    else if (inputDuration > mMinDurationMs)
-        finalDuration = inputDuration;
-    else
-        finalDuration = mMinDurationMs;
-
-    struct timespec cur_timespec;
-    clock_gettime(CLOCK_MONOTONIC, &cur_timespec);
-    if (mState != INTERACTION_STATE_IDLE && finalDuration <= mDurationMs) {
-        long long elapsed_time = CalcTimespecDiffMs(mLastTimespec, cur_timespec);
-        // don't hint if previous hint's duration covers this hint's duration
-        if (elapsed_time <= (mDurationMs - finalDuration)) {
-            ALOGV("%s: Previous duration (%d) cover this (%d) elapsed: %lld",
-                  __func__, mDurationMs, finalDuration, elapsed_time);
-            return;
-        }
-    }
-    mLastTimespec = cur_timespec;
-    mDurationMs = finalDuration;
-
-    ALOGV("%s: input: %d final duration: %d", __func__,
-          duration, finalDuration);
-
-    if (mState == INTERACTION_STATE_WAITING)
-        AbortWaitLocked();
-    else if (mState == INTERACTION_STATE_IDLE)
-        PerfLock();
-
-    mState = INTERACTION_STATE_INTERACTION;
-    mCond.notify_one();
-}
-
-void InteractionHandler::Release() {
-    std::lock_guard<std::mutex> lk(mLock);
-    if (mState == INTERACTION_STATE_WAITING) {
-        ATRACE_CALL();
-        PerfRel();
-        mState = INTERACTION_STATE_IDLE;
-    } else {
-        // clear any wait aborts pending in event fd
-        uint64_t val;
-        ssize_t ret = read(mEventFd, &val, sizeof(val));
-
-        ALOGW_IF(ret < 0, "%s: failed to clear eventfd (%zd, %d)",
-                 __func__, ret, errno);
-    }
-}
-
-// should be called while locked
-void InteractionHandler::AbortWaitLocked() {
-    uint64_t val = 1;
-    ssize_t ret = write(mEventFd, &val, sizeof(val));
-    if (ret != sizeof(val))
-        ALOGW("Unable to write to event fd (%zd)", ret);
-}
-
-void InteractionHandler::WaitForIdle(int32_t wait_ms, int32_t timeout_ms) {
-    char data[MAX_LENGTH];
-    ssize_t ret;
-    struct pollfd pfd[2];
-
-    ATRACE_CALL();
-
-    ALOGV("%s: wait:%d timeout:%d", __func__, wait_ms, timeout_ms);
-
-    pfd[0].fd = mEventFd;
-    pfd[0].events = POLLIN;
-    pfd[1].fd = mIdleFd;
-    pfd[1].events = POLLPRI | POLLERR;
-
-    ret = poll(pfd, 1, wait_ms);
-    if (ret > 0) {
-        ALOGV("%s: wait aborted", __func__);
-        return;
-    } else if (ret < 0) {
-        ALOGE("%s: error in poll while waiting", __func__);
-        return;
-    }
-
-    ret = pread(mIdleFd, data, sizeof(data), 0);
-    if (!ret) {
-        ALOGE("%s: Unexpected EOF!", __func__);
-        return;
-    }
-
-    if (!strncmp(data, "idle", 4)) {
-        ALOGV("%s: already idle", __func__);
-        return;
-    }
-
-    ret = poll(pfd, 2, timeout_ms);
-    if (ret < 0)
-        ALOGE("%s: Error on waiting for idle (%zd)", __func__, ret);
-    else if (ret == 0)
-        ALOGV("%s: timed out waiting for idle", __func__);
-    else if (pfd[0].revents)
-        ALOGV("%s: wait for idle aborted", __func__);
-    else if (pfd[1].revents)
-        ALOGV("%s: idle detected", __func__);
-}
-
-void InteractionHandler::Routine() {
-    std::unique_lock<std::mutex> lk(mLock, std::defer_lock);
-
-    while (true) {
-        lk.lock();
-        mCond.wait(lk, [&] { return mState != INTERACTION_STATE_IDLE; });
-        if (mState == INTERACTION_STATE_UNINITIALIZED)
-            return;
-        mState = INTERACTION_STATE_WAITING;
-        lk.unlock();
-
-        WaitForIdle(mWaitMs, mDurationMs);
-        Release();
-    }
-}
diff --git a/power-libperfmgr/InteractionHandler.h b/power-libperfmgr/InteractionHandler.h
deleted file mode 100644
index 893c72f..0000000
--- a/power-libperfmgr/InteractionHandler.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef INTERACTIONHANDLER_H
-#define INTERACTIONHANDLER_H
-
-#include <condition_variable>
-#include <mutex>
-#include <thread>
-
-#include <perfmgr/HintManager.h>
-
-using ::android::perfmgr::HintManager;
-
-enum interaction_state {
-    INTERACTION_STATE_UNINITIALIZED,
-    INTERACTION_STATE_IDLE,
-    INTERACTION_STATE_INTERACTION,
-    INTERACTION_STATE_WAITING,
-};
-
-struct InteractionHandler {
-    InteractionHandler(std::shared_ptr<HintManager> const & hint_manager);
-    ~InteractionHandler();
-    bool Init();
-    void Exit();
-    void Acquire(int32_t duration);
-
- private:
-    void Release();
-    void WaitForIdle(int32_t wait_ms, int32_t timeout_ms);
-    void AbortWaitLocked();
-    void Routine();
-
-    void PerfLock();
-    void PerfRel();
-
-    long long CalcTimespecDiffMs(struct timespec start, struct timespec end);
-
-    enum interaction_state mState;
-
-    int mIdleFd;
-    int mEventFd;
-
-    int32_t mWaitMs;
-    int32_t mMinDurationMs;
-    int32_t mMaxDurationMs;
-    int32_t mDurationMs;
-
-    struct timespec mLastTimespec;
-
-    std::unique_ptr<std::thread> mThread;
-    std::mutex mLock;
-    std::condition_variable mCond;
-    std::shared_ptr<HintManager> mHintManager;
-};
-
-#endif //INTERACTIONHANDLER_H
diff --git a/power-libperfmgr/Power.cpp b/power-libperfmgr/Power.cpp
deleted file mode 100644
index 05e4132..0000000
--- a/power-libperfmgr/Power.cpp
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * 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.
- */
-
-#define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL)
-#define LOG_TAG "android.hardware.power@1.3-service.bonito-libperfmgr"
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/properties.h>
-#include <android-base/strings.h>
-#include <android-base/stringprintf.h>
-
-#include <mutex>
-
-#include <utils/Log.h>
-#include <utils/Trace.h>
-
-#include "Power.h"
-#include "power-helper.h"
-#include "display-helper.h"
-
-/* RPM runs at 19.2Mhz. Divide by 19200 for msec */
-#define RPM_CLK 19200
-
-extern struct stats_section master_sections[];
-
-namespace android {
-namespace hardware {
-namespace power {
-namespace V1_3 {
-namespace implementation {
-
-using ::android::hardware::power::V1_0::Feature;
-using ::android::hardware::power::V1_0::PowerStatePlatformSleepState;
-using ::android::hardware::power::V1_0::Status;
-using ::android::hardware::power::V1_1::PowerStateSubsystem;
-using ::android::hardware::power::V1_1::PowerStateSubsystemSleepState;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-static const std::map<enum CameraStreamingMode, std::string> kCamStreamingHint = {
-    {CAMERA_STREAMING_OFF, "CAMERA_STREAMING_OFF"},
-    {CAMERA_STREAMING, "CAMERA_STREAMING"},
-    {CAMERA_STREAMING_1080P, "CAMERA_STREAMING_1080P"},
-    {CAMERA_STREAMING_4K, "CAMERA_STREAMING_4K"}};
-
-Power::Power()
-    : mHintManager(nullptr),
-      mInteractionHandler(nullptr),
-      mSustainedPerfModeOn(false),
-      mCameraStreamingMode(CAMERA_STREAMING_OFF),
-      mReady(false) {
-    mInitThread =
-            std::thread([this](){
-                            android::base::WaitForProperty(kPowerHalInitProp, "1");
-                            mHintManager = HintManager::GetFromJSON("/vendor/etc/powerhint.json");
-                            mInteractionHandler = std::make_unique<InteractionHandler>(mHintManager);
-                            mInteractionHandler->Init();
-                            std::string state = android::base::GetProperty(kPowerHalStateProp, "");
-                            if (state == "CAMERA_STREAMING") {
-                                ALOGI("Initialize with CAMERA_STREAMING on");
-                                mHintManager->DoHint("CAMERA_STREAMING");
-                                mCameraStreamingMode = CAMERA_STREAMING;
-                            } else if (state == "CAMERA_STREAMING_1080P") {
-                                ALOGI("Initialize CAMERA_STREAMING_1080P on");
-                                mHintManager->DoHint("CAMERA_STREAMING_1080P");
-                                mCameraStreamingMode = CAMERA_STREAMING_1080P;
-                            } else if (state == "CAMERA_STREAMING_4K") {
-                                ALOGI("Initialize with CAMERA_STREAMING_4K on");
-                                mHintManager->DoHint("CAMERA_STREAMING_4K");
-                                mCameraStreamingMode = CAMERA_STREAMING_4K;
-                            } else if (state == "SUSTAINED_PERFORMANCE") {
-                                ALOGI("Initialize with SUSTAINED_PERFORMANCE on");
-                                mHintManager->DoHint("SUSTAINED_PERFORMANCE");
-                                mSustainedPerfModeOn = true;
-                            } else {
-                                ALOGI("Initialize PowerHAL");
-                            }
-
-                            state = android::base::GetProperty(kPowerHalAudioProp, "");
-                            if (state == "LOW_LATENCY") {
-                                ALOGI("Initialize with AUDIO_LOW_LATENCY on");
-                                mHintManager->DoHint("AUDIO_LOW_LATENCY");
-                            }
-
-                            state = android::base::GetProperty(kPowerHalRenderingProp, "");
-                            if (state == "EXPENSIVE_RENDERING") {
-                                ALOGI("Initialize with EXPENSIVE_RENDERING on");
-                                mHintManager->DoHint("EXPENSIVE_RENDERING");
-                            }
-                            // Now start to take powerhint
-                            mReady.store(true);
-                        });
-    mInitThread.detach();
-}
-
-// Methods from ::android::hardware::power::V1_0::IPower follow.
-Return<void> Power::setInteractive(bool /* interactive */)  {
-    return Void();
-}
-
-Return<void> Power::powerHint(PowerHint_1_0 hint, int32_t data) {
-    if (!isSupportedGovernor() || !mReady) {
-        return Void();
-    }
-
-    switch(hint) {
-        case PowerHint_1_0::INTERACTION:
-            if (mSustainedPerfModeOn) {
-                ALOGV("%s: ignoring due to other active perf hints", __func__);
-            } else {
-                mInteractionHandler->Acquire(data);
-            }
-            break;
-        case PowerHint_1_0::SUSTAINED_PERFORMANCE:
-            if (data && !mSustainedPerfModeOn) {
-                ALOGD("SUSTAINED_PERFORMANCE ON");
-                mHintManager->DoHint("SUSTAINED_PERFORMANCE");
-                if (!android::base::SetProperty(kPowerHalStateProp, "SUSTAINED_PERFORMANCE")) {
-                    ALOGE("%s: could not set powerHAL state property to SUSTAINED_PERFORMANCE", __func__);
-                }
-                mSustainedPerfModeOn = true;
-            } else if (!data && mSustainedPerfModeOn) {
-                ALOGD("SUSTAINED_PERFORMANCE OFF");
-                mHintManager->EndHint("SUSTAINED_PERFORMANCE");
-                if (!android::base::SetProperty(kPowerHalStateProp, "")) {
-                    ALOGE("%s: could not clear powerHAL state property", __func__);
-                }
-                mSustainedPerfModeOn = false;
-            }
-            break;
-        case PowerHint_1_0::LAUNCH:
-            ATRACE_BEGIN("launch");
-            if (mSustainedPerfModeOn) {
-                ALOGV("%s: ignoring due to other active perf hints", __func__);
-            } else {
-                if (data) {
-                    // Hint until canceled
-                    ATRACE_INT("launch_lock", 1);
-                    mHintManager->DoHint("LAUNCH");
-                    ALOGD("LAUNCH ON");
-                } else {
-                    ATRACE_INT("launch_lock", 0);
-                    mHintManager->EndHint("LAUNCH");
-                    ALOGD("LAUNCH OFF");
-                }
-            }
-            ATRACE_END();
-            break;
-        case PowerHint_1_0::LOW_POWER:
-            {
-            ATRACE_BEGIN("low-power");
-
-            if (data) {
-              // Device in battery saver mode, enable display low power mode
-              set_display_lpm(true);
-            } else {
-              // Device exiting battery saver mode, disable display low power mode
-              set_display_lpm(false);
-            }
-            ATRACE_END();
-            }
-            break;
-        default:
-            break;
-
-    }
-    return Void();
-}
-
-Return<void> Power::setFeature(Feature /*feature*/, bool /*activate*/)  {
-    //Nothing to do
-    return Void();
-}
-
-Return<void> Power::getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) {
-
-    hidl_vec<PowerStatePlatformSleepState> states;
-    uint64_t stats[SYSTEM_SLEEP_STATE_COUNT * SYSTEM_STATE_STATS_COUNT] = {0};
-    uint64_t *state_stats;
-    struct PowerStatePlatformSleepState *state;
-
-    states.resize(SYSTEM_SLEEP_STATE_COUNT);
-
-    if (extract_system_stats(stats, ARRAY_SIZE(stats)) != 0) {
-        states.resize(0);
-        goto done;
-    }
-
-    /* Update statistics for AOSD */
-    state = &states[SYSTEM_STATE_AOSD];
-    state->name = "AOSD";
-    state_stats = &stats[SYSTEM_STATE_AOSD * SYSTEM_STATE_STATS_COUNT];
-
-    state->residencyInMsecSinceBoot = state_stats[ACCUMULATED_TIME_MS];
-    state->totalTransitions = state_stats[TOTAL_COUNT];
-    state->supportedOnlyInSuspend = false;
-    state->voters.resize(0);
-
-    /* Update statistics for CXSD */
-    state = &states[SYSTEM_STATE_CXSD];
-    state->name = "CXSD";
-    state_stats = &stats[SYSTEM_STATE_CXSD * SYSTEM_STATE_STATS_COUNT];
-
-    state->residencyInMsecSinceBoot = state_stats[ACCUMULATED_TIME_MS];
-    state->totalTransitions = state_stats[TOTAL_COUNT];
-    state->supportedOnlyInSuspend = false;
-    state->voters.resize(0);
-
-done:
-    _hidl_cb(states, Status::SUCCESS);
-    return Void();
-}
-
-static int get_master_low_power_stats(hidl_vec<PowerStateSubsystem> *subsystems) {
-    uint64_t all_stats[MASTER_COUNT * MASTER_STATS_COUNT] = {0};
-    uint64_t *section_stats;
-    struct PowerStateSubsystem *subsystem;
-    struct PowerStateSubsystemSleepState *state;
-
-    if (extract_master_stats(all_stats, ARRAY_SIZE(all_stats)) != 0) {
-        for (size_t i = 0; i < MASTER_COUNT; i++) {
-            (*subsystems)[i].name = master_sections[i].label;
-            (*subsystems)[i].states.resize(0);
-        }
-        return -1;
-    }
-
-    for (size_t i = 0; i < MASTER_COUNT; i++) {
-        subsystem = &(*subsystems)[i];
-        subsystem->name = master_sections[i].label;
-        subsystem->states.resize(MASTER_SLEEP_STATE_COUNT);
-
-        state = &(subsystem->states[MASTER_SLEEP]);
-        section_stats = &all_stats[i * MASTER_STATS_COUNT];
-
-        state->name = "Sleep";
-        state->totalTransitions = section_stats[SLEEP_ENTER_COUNT];
-        state->residencyInMsecSinceBoot = section_stats[SLEEP_CUMULATIVE_DURATION_MS] / RPM_CLK;
-        state->lastEntryTimestampMs = section_stats[SLEEP_LAST_ENTER_TSTAMP_MS] / RPM_CLK;
-        state->supportedOnlyInSuspend = false;
-    }
-
-    return 0;
-}
-
-static int get_wlan_low_power_stats(struct PowerStateSubsystem *subsystem) {
-    uint64_t stats[WLAN_STATS_COUNT] = {0};
-    struct PowerStateSubsystemSleepState *state;
-
-    subsystem->name = "wlan";
-
-    if (extract_wlan_stats(stats, ARRAY_SIZE(stats)) != 0) {
-        subsystem->states.resize(0);
-        return -1;
-    }
-
-    subsystem->states.resize(WLAN_SLEEP_STATE_COUNT);
-
-    /* Update statistics for Active State */
-    state = &subsystem->states[WLAN_STATE_ACTIVE];
-    state->name = "Active";
-    state->residencyInMsecSinceBoot = stats[CUMULATIVE_TOTAL_ON_TIME_MS];
-    state->totalTransitions = stats[DEEP_SLEEP_ENTER_COUNTER];
-    state->lastEntryTimestampMs = 0; //FIXME need a new value from Qcom
-    state->supportedOnlyInSuspend = false;
-
-    /* Update statistics for Deep-Sleep state */
-    state = &subsystem->states[WLAN_STATE_DEEP_SLEEP];
-    state->name = "Deep-Sleep";
-    state->residencyInMsecSinceBoot = stats[CUMULATIVE_SLEEP_TIME_MS];
-    state->totalTransitions = stats[DEEP_SLEEP_ENTER_COUNTER];
-    state->lastEntryTimestampMs = stats[LAST_DEEP_SLEEP_ENTER_TSTAMP_MS];
-    state->supportedOnlyInSuspend = false;
-
-    return 0;
-}
-
-// Methods from ::android::hardware::power::V1_1::IPower follow.
-Return<void> Power::getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) {
-    hidl_vec<PowerStateSubsystem> subsystems;
-
-    subsystems.resize(STATS_SOURCE_COUNT);
-
-    // Get low power stats for all of the system masters.
-    if (get_master_low_power_stats(&subsystems) != 0) {
-        ALOGE("%s: failed to process master stats", __func__);
-    }
-
-    // Get WLAN subsystem low power stats.
-    if (get_wlan_low_power_stats(&subsystems[SUBSYSTEM_WLAN]) != 0) {
-        ALOGE("%s: failed to process wlan stats", __func__);
-    }
-
-    _hidl_cb(subsystems, Status::SUCCESS);
-    return Void();
-}
-
-bool Power::isSupportedGovernor() {
-    std::string buf;
-    if (android::base::ReadFileToString("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", &buf)) {
-        buf = android::base::Trim(buf);
-    }
-    // Only support EAS 1.2, legacy EAS
-    if (buf == "schedutil" || buf == "sched") {
-        return true;
-    } else {
-        LOG(ERROR) << "Governor not supported by powerHAL, skipping";
-        return false;
-    }
-}
-
-Return<void> Power::powerHintAsync(PowerHint_1_0 hint, int32_t data) {
-    // just call the normal power hint in this oneway function
-    return powerHint(hint, data);
-}
-
-// Methods from ::android::hardware::power::V1_2::IPower follow.
-Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
-    if (!isSupportedGovernor() || !mReady) {
-        return Void();
-    }
-
-    switch(hint) {
-        case PowerHint_1_2::AUDIO_LOW_LATENCY:
-            ATRACE_BEGIN("audio_low_latency");
-            if (data) {
-                // Hint until canceled
-                ATRACE_INT("audio_low_latency_lock", 1);
-                mHintManager->DoHint("AUDIO_LOW_LATENCY");
-                ALOGD("AUDIO LOW LATENCY ON");
-                if (!android::base::SetProperty(kPowerHalAudioProp, "LOW_LATENCY")) {
-                    ALOGE("%s: could not set powerHAL audio state property to LOW_LATENCY", __func__);
-                }
-            } else {
-                ATRACE_INT("audio_low_latency_lock", 0);
-                mHintManager->EndHint("AUDIO_LOW_LATENCY");
-                ALOGD("AUDIO LOW LATENCY OFF");
-                if (!android::base::SetProperty(kPowerHalAudioProp, "")) {
-                    ALOGE("%s: could not clear powerHAL audio state property", __func__);
-                }
-            }
-            ATRACE_END();
-            break;
-        case PowerHint_1_2::AUDIO_STREAMING:
-            ATRACE_BEGIN("audio_streaming");
-            if (mSustainedPerfModeOn) {
-                ALOGV("%s: ignoring due to other active perf hints", __func__);
-            } else {
-                if (data) {
-                    // Hint until canceled
-                    ATRACE_INT("audio_streaming_lock", 1);
-                    mHintManager->DoHint("AUDIO_STREAMING");
-                    ALOGD("AUDIO STREAMING ON");
-                } else {
-                    ATRACE_INT("audio_streaming_lock", 0);
-                    mHintManager->EndHint("AUDIO_STREAMING");
-                    ALOGD("AUDIO STREAMING OFF");
-                }
-            }
-            ATRACE_END();
-            break;
-        case PowerHint_1_2::CAMERA_LAUNCH:
-            ATRACE_BEGIN("camera_launch");
-            if (data > 0) {
-                ATRACE_INT("camera_launch_lock", 1);
-                mHintManager->DoHint("CAMERA_LAUNCH", std::chrono::milliseconds(data));
-                ALOGD("CAMERA LAUNCH ON: %d MS, LAUNCH ON: 2500 MS", data);
-                // boosts 2.5s for launching
-                mHintManager->DoHint("LAUNCH", std::chrono::milliseconds(2500));
-            } else if (data == 0) {
-                ATRACE_INT("camera_launch_lock", 0);
-                mHintManager->EndHint("CAMERA_LAUNCH");
-                ALOGD("CAMERA LAUNCH OFF");
-            } else {
-                ALOGE("CAMERA LAUNCH INVALID DATA: %d", data);
-            }
-            ATRACE_END();
-            break;
-        case PowerHint_1_2::CAMERA_STREAMING: {
-            const enum CameraStreamingMode mode = static_cast<enum CameraStreamingMode>(data);
-            if (mode < CAMERA_STREAMING_OFF || mode >= CAMERA_STREAMING_MAX) {
-                ALOGE("CAMERA STREAMING INVALID Mode: %d", mode);
-                break;
-            }
-
-            if (mCameraStreamingMode == mode)
-                break;
-
-            ATRACE_BEGIN("camera_streaming");
-            // turn it off first if any previous hint.
-            if ((mCameraStreamingMode != CAMERA_STREAMING_OFF)) {
-                const auto modeValue = kCamStreamingHint.at(mCameraStreamingMode);
-                ATRACE_INT("camera_streaming_lock", 0);
-                mHintManager->EndHint(modeValue);
-                // Boost 1s for tear down
-                mHintManager->DoHint("CAMERA_LAUNCH", std::chrono::seconds(1));
-                ALOGD("CAMERA %s OFF", modeValue.c_str());
-            }
-
-            if (mode != CAMERA_STREAMING_OFF) {
-                const auto hintValue = kCamStreamingHint.at(mode);
-                ATRACE_INT("camera_streaming_lock", mode);
-                mHintManager->DoHint(hintValue);
-                ALOGD("CAMERA %s ON", hintValue.c_str());
-            }
-
-            mCameraStreamingMode = mode;
-            const auto prop = (mCameraStreamingMode == CAMERA_STREAMING_OFF)
-                                  ? ""
-                                  : kCamStreamingHint.at(mode).c_str();
-            if (!android::base::SetProperty(kPowerHalStateProp, prop)) {
-                ALOGE("%s: could set powerHAL state %s property", __func__, prop);
-            }
-            ATRACE_END();
-            break;
-        }
-        case PowerHint_1_2::CAMERA_SHOT:
-            ATRACE_BEGIN("camera_shot");
-            if (data > 0) {
-                ATRACE_INT("camera_shot_lock", 1);
-                mHintManager->DoHint("CAMERA_SHOT", std::chrono::milliseconds(data));
-                ALOGD("CAMERA SHOT ON: %d MS", data);
-            } else if (data == 0) {
-                ATRACE_INT("camera_shot_lock", 0);
-                mHintManager->EndHint("CAMERA_SHOT");
-                ALOGD("CAMERA SHOT OFF");
-            } else {
-                ALOGE("CAMERA SHOT INVALID DATA: %d", data);
-            }
-            ATRACE_END();
-            break;
-        default:
-            return powerHint(static_cast<PowerHint_1_0>(hint), data);
-    }
-    return Void();
-}
-
-// Methods from ::android::hardware::power::V1_3::IPower follow.
-Return<void> Power::powerHintAsync_1_3(PowerHint_1_3 hint, int32_t data) {
-    if (!isSupportedGovernor() || !mReady) {
-        return Void();
-    }
-
-    if (hint == PowerHint_1_3::EXPENSIVE_RENDERING) {
-        if (mSustainedPerfModeOn) {
-            ALOGV("%s: ignoring due to other active perf hints", __func__);
-            return Void();
-        }
-
-        if (data > 0) {
-            ATRACE_INT("EXPENSIVE_RENDERING", 1);
-            mHintManager->DoHint("EXPENSIVE_RENDERING");
-            if (!android::base::SetProperty(kPowerHalRenderingProp, "EXPENSIVE_RENDERING")) {
-                ALOGE("%s: could not set powerHAL rendering property to EXPENSIVE_RENDERING",
-                      __func__);
-            }
-        } else {
-            ATRACE_INT("EXPENSIVE_RENDERING", 0);
-            mHintManager->EndHint("EXPENSIVE_RENDERING");
-            if (!android::base::SetProperty(kPowerHalRenderingProp, "")) {
-                ALOGE("%s: could not clear powerHAL rendering property", __func__);
-            }
-        }
-    } else {
-        return powerHintAsync_1_2(static_cast<PowerHint_1_2>(hint), data);
-    }
-
-    return Void();
-}
-
-constexpr const char* boolToString(bool b) {
-    return b ? "true" : "false";
-}
-
-Return<void> Power::debug(const hidl_handle& handle, const hidl_vec<hidl_string>&) {
-    if (handle != nullptr && handle->numFds >= 1 && mReady) {
-        int fd = handle->data[0];
-
-        std::string buf(
-            android::base::StringPrintf("HintManager Running: %s\n"
-                                        "CameraStreamingMode: %s\n"
-                                        "SustainedPerformanceMode: %s\n",
-                                        boolToString(mHintManager->IsRunning()),
-                                        kCamStreamingHint.at(mCameraStreamingMode).c_str(),
-                                        boolToString(mSustainedPerfModeOn)));
-        // Dump nodes through libperfmgr
-        mHintManager->DumpToFd(fd);
-        if (!android::base::WriteStringToFd(buf, fd)) {
-            PLOG(ERROR) << "Failed to dump state to fd";
-        }
-        fsync(fd);
-    }
-    return Void();
-}
-
-}  // namespace implementation
-}  // namespace V1_3
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
diff --git a/power-libperfmgr/Power.h b/power-libperfmgr/Power.h
deleted file mode 100644
index 1cdbc06..0000000
--- a/power-libperfmgr/Power.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef ANDROID_HARDWARE_POWER_V1_3_POWER_H
-#define ANDROID_HARDWARE_POWER_V1_3_POWER_H
-
-#include <atomic>
-#include <thread>
-
-#include <android/hardware/power/1.3/IPower.h>
-#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
-#include <perfmgr/HintManager.h>
-
-#include "CameraMode.h"
-#include "InteractionHandler.h"
-
-namespace android {
-namespace hardware {
-namespace power {
-namespace V1_3 {
-namespace implementation {
-
-using ::android::hardware::power::V1_0::Feature;
-using ::android::hardware::power::V1_3::IPower;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::InteractionHandler;
-using PowerHint_1_0 = ::android::hardware::power::V1_0::PowerHint;
-using PowerHint_1_2 = ::android::hardware::power::V1_2::PowerHint;
-using PowerHint_1_3 = ::android::hardware::power::V1_3::PowerHint;
-using ::android::perfmgr::HintManager;
-
-constexpr char kPowerHalStateProp[] = "vendor.powerhal.state";
-constexpr char kPowerHalAudioProp[] = "vendor.powerhal.audio";
-constexpr char kPowerHalInitProp[] = "vendor.powerhal.init";
-constexpr char kPowerHalRenderingProp[] = "vendor.powerhal.rendering";
-
-struct Power : public IPower {
-    // Methods from ::android::hardware::power::V1_0::IPower follow.
-
-    Power();
-
-    Return<void> setInteractive(bool /* interactive */) override;
-    Return<void> powerHint(PowerHint_1_0 hint, int32_t data) override;
-    Return<void> setFeature(Feature feature, bool activate) override;
-    Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
-
-    // Methods from ::android::hardware::power::V1_1::IPower follow.
-    Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
-    Return<void> powerHintAsync(PowerHint_1_0 hint, int32_t data) override;
-
-    // Methods from ::android::hardware::power::V1_2::IPower follow.
-    Return<void> powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) override;
-
-    // Methods from ::android::hardware::power::V1_3::IPower follow.
-    Return<void> powerHintAsync_1_3(PowerHint_1_3 hint, int32_t data) override;
-
-    // Methods from ::android::hidl::base::V1_0::IBase follow.
-    Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& args) override;
-
- private:
-    static bool isSupportedGovernor();
-
-    std::shared_ptr<HintManager> mHintManager;
-    std::unique_ptr<InteractionHandler> mInteractionHandler;
-    std::atomic<bool> mSustainedPerfModeOn;
-    std::atomic<enum CameraStreamingMode> mCameraStreamingMode;
-    std::atomic<bool> mReady;
-    std::thread mInitThread;
-};
-
-}  // namespace implementation
-}  // namespace V1_3
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-
-#endif  // ANDROID_HARDWARE_POWER_V1_3_POWER_H
diff --git a/power-libperfmgr/android.hardware.power@1.3-service.bonito-libperfmgr.rc b/power-libperfmgr/android.hardware.power@1.3-service.bonito-libperfmgr.rc
deleted file mode 100644
index 4ed1e7c..0000000
--- a/power-libperfmgr/android.hardware.power@1.3-service.bonito-libperfmgr.rc
+++ /dev/null
@@ -1,30 +0,0 @@
-service vendor.power-hal-1-3 /vendor/bin/hw/android.hardware.power@1.3-service.bonito-libperfmgr
-    class hal
-    user root
-    group system
-
-# restart powerHAL when framework died
-on property:init.svc.zygote=restarting && property:vendor.powerhal.state=*
-   setprop vendor.powerhal.state ""
-   setprop vendor.powerhal.audio ""
-   setprop vendor.powerhal.lpm ""
-   restart vendor.power-hal-1-3
-
-# restart powerHAL when SurfaceFlinger died
-on property:init.svc.surfaceflinger=restarting && property:vendor.powerhal.rendering=EXPENSIVE_RENDERING
-   setprop vendor.powerhal.state ""
-   setprop vendor.powerhal.audio ""
-   setprop vendor.powerhal.lpm ""
-   setprop vendor.powerhal.rendering ""
-   restart vendor.power-hal-1-3
-
-# restart powerHAL when cameraHAL died
-on property:init.svc.vendor.camera-provider-2-4=restarting && property:vendor.powerhal.state=*
-   setprop vendor.powerhal.state ""
-   setprop vendor.powerhal.audio ""
-   restart vendor.power-hal-1-3
-
-# restart powerHAL when audioHAL died
-on property:init.svc.vendor.audio-hal-2-0=restarting && property:vendor.powerhal.audio=LOW_LATENCY
-   setprop vendor.powerhal.audio ""
-   restart vendor.power-hal-1-3
diff --git a/power-libperfmgr/display-helper.c b/power-libperfmgr/display-helper.c
deleted file mode 100644
index 05614e1..0000000
--- a/power-libperfmgr/display-helper.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- */
-
-#define LOG_NIDEBUG 0
-#define LOG_TAG "android.hardware.power@1.3-service.bonito-libperfmgr"
-
-#include <errno.h>
-#include <inttypes.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dlfcn.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <log/log.h>
-
-#include "display-helper.h"
-
-int daemon_socket = -1;
-
-static int connectPPDaemon() {
-    // Setup socket connection, if not already done.
-    if (daemon_socket < 0)
-        daemon_socket = socket_local_client(DAEMON_SOCKET,
-                                            ANDROID_SOCKET_NAMESPACE_RESERVED,
-                                            SOCK_STREAM);
-
-    if(daemon_socket < 0) {
-        ALOGE("Connecting to socket failed: %s", strerror(errno));
-        return -1;
-    }
-    return 0;
-}
-
-static int ppdComm(const char* cmd) {
-    int ret = -1;
-
-    ret = connectPPDaemon();
-    if (ret < 0) return ret;
-
-    ret = write(daemon_socket, cmd, strlen(cmd));
-    if (ret < 0) {
-        ALOGE("Failed to send data over socket, %s", strerror(errno));
-        return ret;
-    }
-    return 0;
-}
-
-
-void set_display_lpm(int enable) {
-    ALOGI("set_display_lpm state: %d", enable);
-    if (enable) {
-        ppdComm("foss:on");
-    } else {
-        ppdComm("foss:off");
-    }
-}
-
diff --git a/power-libperfmgr/display-helper.h b/power-libperfmgr/display-helper.h
deleted file mode 100644
index 6edd118..0000000
--- a/power-libperfmgr/display-helper.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __DISPLAY_HELPER_H__
-#define __DISPLAY_HELPER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <cutils/sockets.h>
-
-#define DAEMON_SOCKET "pps"
-
-enum display_lpm_state {
-    DISPLAY_LPM_OFF = 0,
-    DISPLAY_LPM_ON,
-    DISPLAY_LPM_UNKNOWN,
-};
-
-void set_display_lpm(int enable);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__DISPLAY_HELPER_H__
diff --git a/power-libperfmgr/power-helper.c b/power-libperfmgr/power-helper.c
deleted file mode 100644
index e06d0c1..0000000
--- a/power-libperfmgr/power-helper.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2012-2013, 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.
- */
-
-#define LOG_NIDEBUG 0
-#define LOG_TAG "android.hardware.power@1.3-service.bonito-libperfmgr"
-
-#include <errno.h>
-#include <inttypes.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dlfcn.h>
-#include <stdlib.h>
-
-#include <log/log.h>
-
-#include "power-helper.h"
-
-#ifndef MASTER_STATS_FILE
-#define MASTER_STATS_FILE "/sys/power/rpmh_stats/master_stats"
-#endif
-
-#ifndef SYSTEM_STATS_FILE
-#define SYSTEM_STATS_FILE "/sys/power/system_sleep/stats"
-#endif
-
-#ifndef WLAN_STATS_FILE
-#define WLAN_STATS_FILE "/d/wlan0/power_stats"
-#endif
-
-#define LINE_SIZE 128
-
-const char *master_stats_labels[MASTER_STATS_COUNT] = {
-    "Sleep Accumulated Duration",
-    "Sleep Count",
-    "Sleep Last Entered At",
-};
-
-struct stats_section master_sections[MASTER_COUNT] = {
-    { MASTER_APSS,       "APSS", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-    { MASTER_MPSS,       "MPSS", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-    { MASTER_ADSP,       "ADSP", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-    { MASTER_CDSP,       "CDSP", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-};
-
-const char *wlan_stats_labels[WLAN_STATS_COUNT] = {
-    "cumulative_sleep_time_ms",
-    "cumulative_total_on_time_ms",
-    "deep_sleep_enter_counter",
-    "last_deep_sleep_enter_tstamp_ms"
-};
-
-struct stats_section wlan_sections[] = {
-    { SUBSYSTEM_WLAN, "POWER DEBUG STATS", wlan_stats_labels, ARRAY_SIZE(wlan_stats_labels) },
-};
-
-const char *system_stats_labels[SYSTEM_STATE_STATS_COUNT] = {
-    "count",
-    "actual last sleep(msec)"
-};
-
-struct stats_section system_sections[] = {
-    { SYSTEM_STATES, "RPM Mode:aosd", system_stats_labels, ARRAY_SIZE(system_stats_labels) },
-    { SYSTEM_STATES, "RPM Mode:cxsd", system_stats_labels, ARRAY_SIZE(system_stats_labels) },
-};
-
-static int parse_stats(const char **stat_labels, size_t num_stats,
-        uint64_t *list, FILE *fp) {
-    ssize_t nread;
-    size_t len = LINE_SIZE;
-    char *line;
-    size_t stats_read = 0;
-    size_t i;
-
-    line = malloc(len);
-    if (!line) {
-        ALOGE("%s: no memory to hold line", __func__);
-        return -ENOMEM;
-    }
-
-    while ((stats_read < num_stats) &&
-        (nread = getline(&line, &len, fp) > 0)) {
-        char *key = line + strspn(line, " \t");
-        char *value = strchr(key, ':');
-        if (!value || (value > (line + len)))
-            continue;
-        *value++ = '\0';
-
-        for (i = 0; i < num_stats; i++) {
-            if (!strncmp(key, stat_labels[i], strlen(stat_labels[i]))) {
-                list[i] = strtoull(value, NULL, 0);
-                stats_read++;
-                break;
-            }
-        }
-    }
-
-    free(line);
-
-    return stats_read;
-}
-
-
-static int extract_stats(uint64_t *stats_list, size_t entries_per_section, char *file,
-        struct stats_section *sections, size_t num_sections) {
-    FILE *fp;
-    ssize_t read;
-    size_t len = LINE_SIZE;
-    char *line;
-    size_t i;
-    size_t sections_read = 0;
-    size_t stats_read = 0;
-    int ret = 0;
-
-    fp = fopen(file, "re");
-    if (fp == NULL) {
-        ALOGE("%s: failed to open: %s Error = %s", __func__, file, strerror(errno));
-        return -errno;
-    }
-
-    line = malloc(len);
-    if (!line) {
-        ALOGE("%s: no memory to hold line", __func__);
-        fclose(fp);
-        return -ENOMEM;
-    }
-
-    // Ensure that any missing stats default to 0
-    for (i = 0; i < (entries_per_section * num_sections); i++) {
-        stats_list[i] = 0L;
-    }
-
-    // Iterate over the sections we expect to find in the file, calling parse_stats()
-    // to process each section as we detect section headers
-    while ((sections_read < num_sections) && (read = getline(&line, &len, fp) != -1)) {
-        size_t begin = strspn(line, " \t");
-
-        for (i = 0; i < num_sections; i++) {
-            if (!strncmp(line + begin, sections[i].label, strlen(sections[i].label))) {
-                sections_read++;
-                break;
-            }
-        }
-
-        if (i == num_sections) {
-            continue;
-        }
-
-        stats_read = parse_stats(sections[i].stats_labels, sections[i].num_stats,
-                &stats_list[i * entries_per_section], fp);
-        // If we don't find all of the stats we expect in this section, our understanding of
-        // the input is wrong, and we can't just carry on as if everything is okay.  Better
-        // to log the error and give up than potentially return incorrect data as stats.
-        if (stats_read != sections[i].num_stats) {
-            ALOGE("%s: failed to read all stats for %s section (%zu of %zu)", __func__,
-                    sections[i].label, stats_read, sections[i].num_stats);
-            break;
-        }
-    }
-
-    free(line);
-    fclose(fp);
-
-    return ret;
-}
-
-int extract_master_stats(uint64_t *list, size_t list_length) {
-    size_t entries_per_section = list_length / ARRAY_SIZE(master_sections);
-    if (list_length % entries_per_section != 0) {
-        ALOGW("%s: stats list size not an even multiple of section count", __func__);
-    }
-
-    return extract_stats(list, entries_per_section, MASTER_STATS_FILE,
-            master_sections, ARRAY_SIZE(master_sections));
-}
-
-int extract_wlan_stats(uint64_t *list, size_t list_length) {
-    size_t entries_per_section = list_length / ARRAY_SIZE(wlan_sections);
-    if (list_length % entries_per_section != 0) {
-        ALOGW("%s: stats list size not an even multiple of section count", __func__);
-    }
-
-    return extract_stats(list, entries_per_section, WLAN_STATS_FILE,
-            wlan_sections, ARRAY_SIZE(wlan_sections));
-}
-
-int extract_system_stats(uint64_t *list, size_t list_length) {
-    size_t entries_per_section = list_length / ARRAY_SIZE(system_sections);
-    if (list_length % entries_per_section != 0) {
-        ALOGW("%s: stats list size not an even multiple of section count", __func__);
-    }
-
-    return extract_stats(list, entries_per_section, SYSTEM_STATS_FILE,
-            system_sections, ARRAY_SIZE(system_sections));
-}
-
diff --git a/power-libperfmgr/power-helper.h b/power-libperfmgr/power-helper.h
deleted file mode 100644
index 5ecebe4..0000000
--- a/power-libperfmgr/power-helper.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifndef __POWER_HELPER_H__
-#define __POWER_HELPER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// These values are used as indices in getSubsystemLowPowerStats(), as source IDs
-// in stats_section instances, and (in the case of the _COUNT values) to dimension
-// containers.  The values used as indices need to be contiguous, but others do
-// not (which is why SYSTEM_STATES is all the way at the end; it is not used as
-// an index, but only as a source ID).
-enum stats_source {
-    // Master stats
-    MASTER_APSS = 0,
-    MASTER_MPSS,
-    MASTER_ADSP,
-    MASTER_CDSP,
-    MASTER_COUNT, // Total master sources
-
-    // Subsystem stats.  (Numbering starts at MASTER_COUNT to preserve
-    // contiguous source numbering.)
-    SUBSYSTEM_WLAN = MASTER_COUNT,
-    // Uncomment when Citadel returns
-    //SUBSYSTEM_CITADEL,
-
-    // Don't add any lines after this line
-    STATS_SOURCE_COUNT, // Total sources of any kind excluding system states
-    SUBSYSTEM_COUNT = STATS_SOURCE_COUNT - MASTER_COUNT,
-
-    SYSTEM_STATES
-};
-
-enum master_sleep_states {
-    MASTER_SLEEP = 0,
-
-    // Don't add any lines after this line
-    MASTER_SLEEP_STATE_COUNT
-};
-
-enum master_stats {
-    SLEEP_CUMULATIVE_DURATION_MS = 0,
-    SLEEP_ENTER_COUNT,
-    SLEEP_LAST_ENTER_TSTAMP_MS,
-
-    // Don't add any lines after this line
-    MASTER_STATS_COUNT
-};
-
-enum wlan_sleep_states {
-    WLAN_STATE_ACTIVE = 0,
-    WLAN_STATE_DEEP_SLEEP,
-
-    // Don't add any lines after this line
-    WLAN_SLEEP_STATE_COUNT
-};
-
-// Note that stats for both WLAN sleep states are in a single section of the
-// source file, so there's only 1 stats section despite having 2 states
-enum wlan_stats {
-    CUMULATIVE_SLEEP_TIME_MS = 0,
-    CUMULATIVE_TOTAL_ON_TIME_MS,
-    DEEP_SLEEP_ENTER_COUNTER,
-    LAST_DEEP_SLEEP_ENTER_TSTAMP_MS,
-
-    // Don't add any lines after this line
-    WLAN_STATS_COUNT
-};
-
-enum system_sleep_states {
-    SYSTEM_STATE_AOSD = 0,
-    SYSTEM_STATE_CXSD,
-
-    //Don't add any lines after this line
-    SYSTEM_SLEEP_STATE_COUNT
-};
-
-enum system_state_stats {
-    TOTAL_COUNT = 0,
-    ACCUMULATED_TIME_MS,
-
-    //Don't add any lines after this line
-    SYSTEM_STATE_STATS_COUNT
-};
-
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(x) (sizeof((x))/sizeof((x)[0]))
-#endif
-
-struct stats_section {
-    enum stats_source source;
-    const char *label;
-    const char **stats_labels;
-    size_t num_stats;
-};
-
-int extract_master_stats(uint64_t *list, size_t list_length);
-int extract_wlan_stats(uint64_t *list, size_t list_length);
-int extract_system_stats(uint64_t *list, size_t list_length);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__POWER_HELPER_H__
diff --git a/power-libperfmgr/service.cpp b/power-libperfmgr/service.cpp
deleted file mode 100644
index c60c62c..0000000
--- a/power-libperfmgr/service.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-#define LOG_TAG "android.hardware.power@1.3-service.bonito-libperfmgr"
-
-#include <android/log.h>
-#include <hidl/HidlTransportSupport.h>
-
-#include "Power.h"
-
-using android::sp;
-using android::status_t;
-using android::OK;
-
-// libhwbinder:
-using android::hardware::configureRpcThreadpool;
-using android::hardware::joinRpcThreadpool;
-
-// Generated HIDL files
-using android::hardware::power::V1_3::IPower;
-using android::hardware::power::V1_3::implementation::Power;
-
-int main(int /* argc */, char** /* argv */) {
-    ALOGI("Power HAL Service 1.3 for Bonito is starting.");
-
-    android::sp<IPower> service = new Power();
-    if (service == nullptr) {
-        ALOGE("Can not create an instance of Power HAL Iface, exiting.");
-        return 1;
-    }
-
-    configureRpcThreadpool(1, true /*callerWillJoin*/);
-
-    status_t status = service->registerAsService();
-    if (status != OK) {
-        ALOGE("Could not register service for Power HAL Iface (%d), exiting.", status);
-        return 1;
-    }
-
-    ALOGI("Power Service is ready");
-    joinRpcThreadpool();
-
-    // In normal operation, we don't expect the thread pool to exit
-    ALOGE("Power Service is shutting down");
-    return 1;
-}
diff --git a/powerhint.json b/powerhint.json
index 127a5e3..d272cd1 100644
--- a/powerhint.json
+++ b/powerhint.json
@@ -179,7 +179,7 @@
       "Name": "PMQoSCpuDmaLatency",
       "Path": "/dev/cpu_dma_latency",
       "Values": [
-        "44",
+        "67",
         "100"
       ],
       "HoldFd": true
@@ -201,6 +201,36 @@
         "0"
       ],
       "ResetOnInit": true
+    },
+    {
+      "Name": "PowerHALMainState",
+      "Path": "vendor.powerhal.state",
+      "Values": [
+        "CAMERA_STREAMING",
+        "CAMERA_STREAMING_1080P",
+        "CAMERA_STREAMING_4K",
+        "SUSTAINED_PERFORMANCE",
+        ""
+      ],
+      "Type": "Property"
+    },
+    {
+      "Name": "PowerHALAudioState",
+      "Path": "vendor.powerhal.audio",
+      "Values": [
+        "AUDIO_LOW_LATENCY",
+        ""
+      ],
+      "Type": "Property"
+    },
+    {
+      "Name": "PowerHALRenderingState",
+      "Path": "vendor.powerhal.rendering",
+      "Values": [
+        "EXPENSIVE_RENDERING",
+        ""
+      ],
+      "Type": "Property"
     }
   ],
   "Actions": [
@@ -212,6 +242,12 @@
     },
     {
       "PowerHint": "SUSTAINED_PERFORMANCE",
+      "Node": "PowerHALMainState",
+      "Duration": 0,
+      "Value": "SUSTAINED_PERFORMANCE"
+    },
+    {
+      "PowerHint": "SUSTAINED_PERFORMANCE",
       "Node": "CPULittleClusterMaxFreq",
       "Duration": 0,
       "Value": "1209600"
@@ -298,7 +334,7 @@
       "PowerHint": "LAUNCH",
       "Node": "PMQoSCpuDmaLatency",
       "Duration": 5000,
-      "Value": "44"
+      "Value": "67"
     },
     {
       "PowerHint": "LAUNCH",
@@ -382,7 +418,13 @@
       "PowerHint": "CAMERA_LAUNCH",
       "Node": "PMQoSCpuDmaLatency",
       "Duration": 1000,
-      "Value": "44"
+      "Value": "67"
+    },
+    {
+      "PowerHint": "CAMERA_STREAMING",
+      "Node": "PowerHALMainState",
+      "Duration": 0,
+      "Value": "CAMERA_STREAMING"
     },
     {
       "PowerHint": "CAMERA_STREAMING",
@@ -392,6 +434,12 @@
     },
     {
       "PowerHint": "CAMERA_STREAMING_1080P",
+      "Node": "PowerHALMainState",
+      "Duration": 0,
+      "Value": "CAMERA_STREAMING_1080P"
+    },
+    {
+      "PowerHint": "CAMERA_STREAMING_1080P",
       "Node": "CPUBigClusterMaxFreq",
       "Duration": 0,
       "Value": "1996800"
@@ -410,6 +458,12 @@
     },
     {
       "PowerHint": "CAMERA_STREAMING_4K",
+      "Node": "PowerHALMainState",
+      "Duration": 0,
+      "Value": "CAMERA_STREAMING_4K"
+    },
+    {
+      "PowerHint": "CAMERA_STREAMING_4K",
       "Node": "CPUBigClusterMaxFreq",
       "Duration": 0,
       "Value": "1996800"
@@ -442,7 +496,7 @@
       "PowerHint": "CAMERA_SHOT",
       "Node": "PMQoSCpuDmaLatency",
       "Duration": 1000,
-      "Value": "44"
+      "Value": "67"
     },
     {
       "PowerHint": "AUDIO_STREAMING",
@@ -454,13 +508,25 @@
       "PowerHint": "AUDIO_STREAMING",
       "Node": "PMQoSCpuDmaLatency",
       "Duration": 2000,
-      "Value": "44"
+      "Value": "67"
+    },
+    {
+      "PowerHint": "AUDIO_LOW_LATENCY",
+      "Node": "PowerHALAudioState",
+      "Duration": 0,
+      "Value": "AUDIO_LOW_LATENCY"
     },
     {
       "PowerHint": "AUDIO_LOW_LATENCY",
       "Node": "PMQoSCpuDmaLatency",
       "Duration": 0,
-      "Value": "44"
+      "Value": "67"
+    },
+    {
+      "PowerHint": "EXPENSIVE_RENDERING",
+      "Node": "PowerHALRenderingState",
+      "Duration": 0,
+      "Value": "EXPENSIVE_RENDERING"
     },
     {
       "PowerHint": "EXPENSIVE_RENDERING",
diff --git a/power-libperfmgr/Android.bp b/powerstats/Android.bp
similarity index 61%
rename from power-libperfmgr/Android.bp
rename to powerstats/Android.bp
index ccd0ab7..5c4fac6 100644
--- a/power-libperfmgr/Android.bp
+++ b/powerstats/Android.bp
@@ -12,34 +12,29 @@
 // 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_headers {
-    name: "b4s4_power_headers",
-    export_include_dirs: ["."],
-}
-
 cc_binary {
-    name: "android.hardware.power@1.3-service.bonito-libperfmgr",
+    name: "android.hardware.power.stats@1.0-service.pixel",
     relative_install_path: "hw",
-    init_rc: ["android.hardware.power@1.3-service.bonito-libperfmgr.rc"],
-    srcs: ["service.cpp", "Power.cpp", "InteractionHandler.cpp", "power-helper.c",
-            "display-helper.c"],
+    init_rc: ["android.hardware.power.stats@1.0-service.pixel.rc"],
+    srcs: ["service.cpp"],
     cflags: [
         "-Wall",
         "-Werror",
     ],
+    static_libs: [
+        "libpixelpowerstats",
+    ],
     shared_libs: [
         "libbase",
+        "libcutils",
         "libhidlbase",
         "libhidltransport",
+        "libfmq",
         "liblog",
         "libutils",
-        "libcutils",
-        "android.hardware.power@1.0",
-        "android.hardware.power@1.1",
-        "android.hardware.power@1.2",
-        "android.hardware.power@1.3",
-        "libperfmgr",
+        "android.hardware.power.stats@1.0",
+        "pixelpowerstats_provider_aidl_interface-cpp",
+        "libbinder",
     ],
-    proprietary: true,
-}
\ No newline at end of file
+    vendor: true,
+}
diff --git a/powerstats/android.hardware.power.stats@1.0-service.pixel.rc b/powerstats/android.hardware.power.stats@1.0-service.pixel.rc
new file mode 100644
index 0000000..6ba83c2
--- /dev/null
+++ b/powerstats/android.hardware.power.stats@1.0-service.pixel.rc
@@ -0,0 +1,4 @@
+service vendor.power.stats-hal-1-0 /vendor/bin/hw/android.hardware.power.stats@1.0-service.pixel
+    class hal
+    user system
+    group system
diff --git a/powerstats/service.cpp b/powerstats/service.cpp
new file mode 100644
index 0000000..133c9bd
--- /dev/null
+++ b/powerstats/service.cpp
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "android.hardware.power.stats@1.0-service.pixel"
+
+#include <android-base/properties.h>
+#include <android/log.h>
+#include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include <pixelpowerstats/AidlStateResidencyDataProvider.h>
+#include <pixelpowerstats/GenericStateResidencyDataProvider.h>
+#include <pixelpowerstats/PowerStats.h>
+#include <pixelpowerstats/WlanStateResidencyDataProvider.h>
+
+using android::OK;
+using android::sp;
+using android::status_t;
+
+// libhwbinder:
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+
+// Generated HIDL files
+using android::hardware::power::stats::V1_0::IPowerStats;
+using android::hardware::power::stats::V1_0::PowerEntityInfo;
+using android::hardware::power::stats::V1_0::PowerEntityStateSpace;
+using android::hardware::power::stats::V1_0::PowerEntityType;
+using android::hardware::power::stats::V1_0::implementation::PowerStats;
+
+// Pixel specific
+using android::hardware::google::pixel::powerstats::AidlStateResidencyDataProvider;
+using android::hardware::google::pixel::powerstats::GenericStateResidencyDataProvider;
+using android::hardware::google::pixel::powerstats::PowerEntityConfig;
+using android::hardware::google::pixel::powerstats::StateResidencyConfig;
+using android::hardware::google::pixel::powerstats::WlanStateResidencyDataProvider;
+
+int main(int /* argc */, char ** /* argv */) {
+    ALOGE("power.stats service 1.0 is starting.");
+
+    bool isDebuggable = android::base::GetBoolProperty("ro.debuggable", false);
+
+    PowerStats *service = new PowerStats();
+
+    // Add power entities related to rpmh
+    const uint64_t RPM_CLK = 19200;  // RPM runs at 19.2Mhz. Divide by 19200 for msec
+    std::function<uint64_t(uint64_t)> rpmConvertToMs = [](uint64_t a) { return a / RPM_CLK; };
+    std::vector<StateResidencyConfig> rpmStateResidencyConfigs = {
+        {.name = "Sleep",
+         .entryCountSupported = true,
+         .entryCountPrefix = "Sleep Count:",
+         .totalTimeSupported = true,
+         .totalTimePrefix = "Sleep Accumulated Duration:",
+         .totalTimeTransform = rpmConvertToMs,
+         .lastEntrySupported = true,
+         .lastEntryPrefix = "Sleep Last Entered At:",
+         .lastEntryTransform = rpmConvertToMs}};
+
+    sp<GenericStateResidencyDataProvider> rpmSdp =
+        new GenericStateResidencyDataProvider("/sys/power/rpmh_stats/master_stats");
+
+    uint32_t apssId = service->addPowerEntity("APSS", PowerEntityType::SUBSYSTEM);
+    rpmSdp->addEntity(apssId, PowerEntityConfig("APSS", rpmStateResidencyConfigs));
+
+    uint32_t mpssId = service->addPowerEntity("MPSS", PowerEntityType::SUBSYSTEM);
+    rpmSdp->addEntity(mpssId, PowerEntityConfig("MPSS", rpmStateResidencyConfigs));
+
+    uint32_t adspId = service->addPowerEntity("ADSP", PowerEntityType::SUBSYSTEM);
+    rpmSdp->addEntity(adspId, PowerEntityConfig("ADSP", rpmStateResidencyConfigs));
+
+    uint32_t cdspId = service->addPowerEntity("CDSP", PowerEntityType::SUBSYSTEM);
+    rpmSdp->addEntity(cdspId, PowerEntityConfig("CDSP", rpmStateResidencyConfigs));
+
+    service->addStateResidencyDataProvider(rpmSdp);
+
+    // Add SoC power entity
+    std::vector<StateResidencyConfig> socStateResidencyConfigs = {
+        {.name = "AOSD",
+         .header = "RPM Mode:aosd",
+         .entryCountSupported = true,
+         .entryCountPrefix = "count:",
+         .totalTimeSupported = true,
+         .totalTimePrefix = "actual last sleep(msec):",
+         .lastEntrySupported = false},
+        {.name = "CXSD",
+         .header = "RPM Mode:cxsd",
+         .entryCountSupported = true,
+         .entryCountPrefix = "count:",
+         .totalTimeSupported = true,
+         .totalTimePrefix = "actual last sleep(msec):",
+         .lastEntrySupported = false}};
+
+    sp<GenericStateResidencyDataProvider> socSdp =
+        new GenericStateResidencyDataProvider("/sys/power/system_sleep/stats");
+
+    uint32_t socId = service->addPowerEntity("SoC", PowerEntityType::POWER_DOMAIN);
+    socSdp->addEntity(socId, PowerEntityConfig(socStateResidencyConfigs));
+
+    service->addStateResidencyDataProvider(socSdp);
+
+    if (isDebuggable) {
+        // Add WLAN power entity
+        uint32_t wlanId = service->addPowerEntity("WLAN", PowerEntityType::SUBSYSTEM);
+        sp<WlanStateResidencyDataProvider> wlanSdp =
+            new WlanStateResidencyDataProvider(wlanId, "/d/wlan0/power_stats");
+        service->addStateResidencyDataProvider(wlanSdp);
+    }
+
+    // Add Power Entities that require the Aidl data provider
+    sp<AidlStateResidencyDataProvider> aidlSdp = new AidlStateResidencyDataProvider();
+    uint32_t citadelId = service->addPowerEntity("Citadel", PowerEntityType::SUBSYSTEM);
+    aidlSdp->addEntity(citadelId, "Citadel", {"Last-Reset", "Active", "Deep-Sleep"});
+
+    auto serviceStatus = android::defaultServiceManager()->addService(
+        android::String16("power.stats-vendor"), aidlSdp);
+    if (serviceStatus != android::OK) {
+        ALOGE("Unable to register power.stats-vendor service %d", serviceStatus);
+        return 1;
+    }
+    sp<android::ProcessState> ps{android::ProcessState::self()};  // Create non-HW binder threadpool
+    ps->startThreadPool();
+
+    service->addStateResidencyDataProvider(aidlSdp);
+
+    // Configure the threadpool
+    configureRpcThreadpool(1, true /*callerWillJoin*/);
+
+    status_t status = service->registerAsService();
+    if (status != OK) {
+        ALOGE("Could not register service for power.stats HAL Iface (%d), exiting.", status);
+        return 1;
+    }
+
+    ALOGI("power.stats service is ready");
+    joinRpcThreadpool();
+
+    // In normal operation, we don't expect the thread pool to exit
+    ALOGE("power.stats service is shutting down");
+    return 1;
+}
diff --git a/system.prop b/product.prop
similarity index 91%
rename from system.prop
rename to product.prop
index f509d98..36f74c8 100644
--- a/system.prop
+++ b/product.prop
@@ -85,3 +85,9 @@
 #ro.use_data_netmgrd=true
 persist.data.netmgrd.qos.enable=true
 persist.data.mode=concurrent
+
+# System props to enable Bluetooth Quality Report (BQR) feature
+# BQR event mask configuration
+persist.bluetooth.bqr.event_mask=14
+# BQR minimum report interval configuration
+persist.bluetooth.bqr.min_interval_ms=500
diff --git a/sargo/BoardConfig.mk b/sargo/BoardConfig.mk
index 6827b82..13390b0 100644
--- a/sargo/BoardConfig.mk
+++ b/sargo/BoardConfig.mk
@@ -15,6 +15,7 @@
 #
 
 TARGET_BOOTLOADER_BOARD_NAME := sargo
+TARGET_SCREEN_DENSITY := 440
 TARGET_RECOVERY_UI_MARGIN_HEIGHT := 20
 
 include device/google/bonito/BoardConfig-common.mk
diff --git a/sargo/init.sargo.rc b/sargo/init.sargo.rc
index 257a554..a2ba4cd 100644
--- a/sargo/init.sargo.rc
+++ b/sargo/init.sargo.rc
@@ -16,9 +16,6 @@
 
 import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.rc
 
-on init
-    setprop ro.sf.lcd_density 440
-
 on property:sys.boot_completed=1
     # HardwareInfo needs to be able to read display info
     chmod 444 /sys/devices/platform/soc/soc:qcom,dsi-display@51/panel_info/panel0/serial_number
diff --git a/sargo/overlay/frameworks/base/core/res/res/values/config.xml b/sargo/overlay/frameworks/base/core/res/res/values/config.xml
index f499414..f798762 100755
--- a/sargo/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/sargo/overlay/frameworks/base/core/res/res/values/config.xml
@@ -42,7 +42,7 @@
 
     <!-- Enable doze mode
          ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
-    <string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
+    <string translatable="false" name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
 
     <!-- Type of the double tap sensor. Empty if double tap is not supported. -->
     <string name="config_dozeDoubleTapSensorType" translatable="false">com.google.sensor.double_touch</string>
@@ -685,6 +685,7 @@
         <item>G020H</item>
     </string-array>
 
-    <dimen name="rounded_corner_radius_top">45px</dimen>
-    <dimen name="rounded_corner_radius_bottom">46px</dimen>
+    <dimen name="rounded_corner_radius_top">40px</dimen>
+    <dimen name="rounded_corner_radius_bottom">41px</dimen>
+
 </resources>
diff --git a/sec_config b/sec_config
index 2448413..c73be69 100644
--- a/sec_config
+++ b/sec_config
@@ -315,10 +315,12 @@
 /* Allow Data dpmd to access QMI DFS */
 48:4294967295:1000:3004
 /* QMI vendor specific service from modem */
-231:4294967295:1001
+231:4294967295:1000:1001
 /* DIAG */
 4097:4294967295:2002:2950:3009:2901
 /* <WLFW QMI Service ID - 0x45>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
 69:4294967295:1000
 /* <WLPS QMI Service ID - 0x39>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
 57:4294967295:1000
+/* <MODEM_SVC QMI Service ID - 235>:<MODEM_SVC QMI Instance ID - all instances>:<Client Group ID> */
+235:4294967295:1000
diff --git a/self-extractors/extract-lists.txt b/self-extractors/extract-lists.txt
index de28ec9..20c3ed5 100644
--- a/self-extractors/extract-lists.txt
+++ b/self-extractors/extract-lists.txt
@@ -6,13 +6,10 @@
   qcom)
     TO_EXTRACT="\
             system/app/QtiTelephonyService/QtiTelephonyService.apk \
-            system/compatibility_matrix.xml \
             system/etc/cne/andsfCne.xml \
             system/etc/cne/Nexus/ATT/ATT_profiles.xml \
             system/etc/cne/Nexus/ROW/ROW_profiles.xml \
             system/etc/cne/Nexus/VZW/VZW_profiles.xml \
-            system/etc/ld.config.28.txt \
-            system/etc/llndk.libraries.28.txt \
             system/etc/permissions/cneapiclient.xml \
             system/etc/permissions/com.quicinc.cne.xml \
             system/etc/permissions/embms.xml \
@@ -31,13 +28,8 @@
             system/framework/com.android.mediadrm.signer.jar \
             system/framework/com.qualcomm.qti.uceservice-V2.0-java.jar \
             system/framework/javax.obex.jar \
-            system/framework/LteDirectDiscoveryLibrary.jar \
-            system/framework/org.apache.http.legacy.boot.jar \
-            system/framework/org.apache.http.legacy.boot.jar.prof \
             system/framework/qcrilhook.jar \
             system/framework/QtiTelephonyServicelibrary.jar \
-            system/framework/radioconfiginterfacelibrary.jar \
-            system/framework/radioconfiglibrary.jar \
             system/framework/uimlpalibrary.jar \
             system/framework/uimremoteclientlibrary.jar \
             system/framework/uimremoteserverlibrary.jar \
@@ -60,7 +52,6 @@
             system/lib64/lib-imsvtutils.so \
             system/lib64/liblistenjni.so \
             system/lib64/liblistensoundmodel2.so \
-            system/lib64/liblogcat.so \
             system/lib64/libmdsprpc_system.so \
             system/lib64/libminui.so \
             system/lib64/libqsap_sdk.so \
@@ -70,9 +61,7 @@
             system/lib64/libsdsprpc_system.so \
             system/lib64/libsecureui_svcsock_system.so \
             system/lib64/libsensorslog.so \
-            system/lib64/libsepol.so \
             system/lib64/libsns_low_lat_stream_stub.so \
-            system/lib64/libunwind.so \
             system/lib/libadsprpc_system.so \
             system/lib/libcdsprpc_system.so \
             system/lib/libdiag_system.so \
@@ -90,7 +79,6 @@
             system/lib/libmdsprpc_system.so \
             system/lib/libminui.so \
             system/lib/libnl.so \
-            system/lib/libpac.so \
             system/lib/libqct_resampler.so \
             system/lib/libqsap_sdk.so \
             system/lib/libQTEEConnector_system.so \
@@ -100,7 +88,6 @@
             system/lib/libsecureui_svcsock_system.so \
             system/lib/libsensorslog.so \
             system/lib/libsns_low_lat_stream_stub.so \
-            system/lib/libunwind.so \
             system/lib/rfsa/adsp/libsns_low_lat_stream_skel.so \
             "
     ;;
diff --git a/self-extractors/qcom/staging/device-partial.mk b/self-extractors/qcom/staging/device-partial.mk
index 67e3afb..1464243 100644
--- a/self-extractors/qcom/staging/device-partial.mk
+++ b/self-extractors/qcom/staging/device-partial.mk
@@ -14,19 +14,14 @@
 
 # AOSP packages required by the blobs
 PRODUCT_PACKAGES := \
-    com.android.ims.rcsmanager.xml \
-    com.android.ims.rcsmanager \
     QtiTelephonyService
 
 #  blob(s) necessary for bonito hardware
 PRODUCT_COPY_FILES := \
-    vendor/qcom/bonito/proprietary/compatibility_matrix.xml:system/compatibility_matrix.xml:qcom \
     vendor/qcom/bonito/proprietary/andsfCne.xml:system/etc/cne/andsfCne.xml:qcom \
     vendor/qcom/bonito/proprietary/ATT_profiles.xml:system/etc/cne/Nexus/ATT/ATT_profiles.xml:qcom \
     vendor/qcom/bonito/proprietary/ROW_profiles.xml:system/etc/cne/Nexus/ROW/ROW_profiles.xml:qcom \
     vendor/qcom/bonito/proprietary/VZW_profiles.xml:system/etc/cne/Nexus/VZW/VZW_profiles.xml:qcom \
-    vendor/qcom/bonito/proprietary/ld.config.28.txt:system/etc/ld.config.28.txt:qcom \
-    vendor/qcom/bonito/proprietary/llndk.libraries.28.txt:system/etc/llndk.libraries.28.txt:qcom \
     vendor/qcom/bonito/proprietary/cneapiclient.xml:system/etc/permissions/cneapiclient.xml:qcom \
     vendor/qcom/bonito/proprietary/com.quicinc.cne.xml:system/etc/permissions/com.quicinc.cne.xml:qcom \
     vendor/qcom/bonito/proprietary/embms.xml:system/etc/permissions/embms.xml:qcom \
@@ -45,13 +40,8 @@
     vendor/qcom/bonito/proprietary/com.android.mediadrm.signer.jar:system/framework/com.android.mediadrm.signer.jar:qcom \
     vendor/qcom/bonito/proprietary/com.qualcomm.qti.uceservice-V2.0-java.jar:system/framework/com.qualcomm.qti.uceservice-V2.0-java.jar:qcom \
     vendor/qcom/bonito/proprietary/javax.obex.jar:system/framework/javax.obex.jar:qcom \
-    vendor/qcom/bonito/proprietary/LteDirectDiscoveryLibrary.jar:system/framework/LteDirectDiscoveryLibrary.jar:qcom \
-    vendor/qcom/bonito/proprietary/org.apache.http.legacy.boot.jar:system/framework/org.apache.http.legacy.boot.jar:qcom \
-    vendor/qcom/bonito/proprietary/org.apache.http.legacy.boot.jar.prof:system/framework/org.apache.http.legacy.boot.jar.prof:qcom \
     vendor/qcom/bonito/proprietary/qcrilhook.jar:system/framework/qcrilhook.jar:qcom \
     vendor/qcom/bonito/proprietary/QtiTelephonyServicelibrary.jar:system/framework/QtiTelephonyServicelibrary.jar:qcom \
-    vendor/qcom/bonito/proprietary/radioconfiginterfacelibrary.jar:system/framework/radioconfiginterfacelibrary.jar:qcom \
-    vendor/qcom/bonito/proprietary/radioconfiglibrary.jar:system/framework/radioconfiglibrary.jar:qcom \
     vendor/qcom/bonito/proprietary/uimlpalibrary.jar:system/framework/uimlpalibrary.jar:qcom \
     vendor/qcom/bonito/proprietary/uimremoteclientlibrary.jar:system/framework/uimremoteclientlibrary.jar:qcom \
     vendor/qcom/bonito/proprietary/uimremoteserverlibrary.jar:system/framework/uimremoteserverlibrary.jar:qcom \
@@ -74,7 +64,6 @@
     vendor/qcom/bonito/proprietary/lib64/lib-imsvtutils.so:system/lib64/lib-imsvtutils.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/liblistenjni.so:system/lib64/liblistenjni.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/liblistensoundmodel2.so:system/lib64/liblistensoundmodel2.so:qcom \
-    vendor/qcom/bonito/proprietary/lib64/liblogcat.so:system/lib64/liblogcat.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/libmdsprpc_system.so:system/lib64/libmdsprpc_system.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/libminui.so:system/lib64/libminui.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/libqsap_sdk.so:system/lib64/libqsap_sdk.so:qcom \
@@ -84,9 +73,7 @@
     vendor/qcom/bonito/proprietary/lib64/libsdsprpc_system.so:system/lib64/libsdsprpc_system.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/libsecureui_svcsock_system.so:system/lib64/libsecureui_svcsock_system.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/libsensorslog.so:system/lib64/libsensorslog.so:qcom \
-    vendor/qcom/bonito/proprietary/lib64/libsepol.so:system/lib64/libsepol.so:qcom \
     vendor/qcom/bonito/proprietary/lib64/libsns_low_lat_stream_stub.so:system/lib64/libsns_low_lat_stream_stub.so:qcom \
-    vendor/qcom/bonito/proprietary/lib64/libunwind.so:system/lib64/libunwind.so:qcom \
     vendor/qcom/bonito/proprietary/libadsprpc_system.so:system/lib/libadsprpc_system.so:qcom \
     vendor/qcom/bonito/proprietary/libcdsprpc_system.so:system/lib/libcdsprpc_system.so:qcom \
     vendor/qcom/bonito/proprietary/libdiag_system.so:system/lib/libdiag_system.so:qcom \
@@ -104,7 +91,6 @@
     vendor/qcom/bonito/proprietary/libmdsprpc_system.so:system/lib/libmdsprpc_system.so:qcom \
     vendor/qcom/bonito/proprietary/libminui.so:system/lib/libminui.so:qcom \
     vendor/qcom/bonito/proprietary/libnl.so:system/lib/libnl.so:qcom \
-    vendor/qcom/bonito/proprietary/libpac.so:system/lib/libpac.so:qcom \
     vendor/qcom/bonito/proprietary/libqct_resampler.so:system/lib/libqct_resampler.so:qcom \
     vendor/qcom/bonito/proprietary/libqsap_sdk.so:system/lib/libqsap_sdk.so:qcom \
     vendor/qcom/bonito/proprietary/libQTEEConnector_system.so:system/lib/libQTEEConnector_system.so:qcom \
@@ -113,7 +99,5 @@
     vendor/qcom/bonito/proprietary/libsdsprpc_system.so:system/lib/libsdsprpc_system.so:qcom \
     vendor/qcom/bonito/proprietary/libsecureui_svcsock_system.so:system/lib/libsecureui_svcsock_system.so:qcom \
     vendor/qcom/bonito/proprietary/libsensorslog.so:system/lib/libsensorslog.so:qcom \
-    vendor/qcom/bonito/proprietary/libsns_device_mode_stub.so:system/lib/libsns_device_mode_stub.so:qcom \
     vendor/qcom/bonito/proprietary/libsns_low_lat_stream_stub.so:system/lib/libsns_low_lat_stream_stub.so:qcom \
-    vendor/qcom/bonito/proprietary/libunwind.so:system/lib/libunwind.so:qcom \
     vendor/qcom/bonito/proprietary/libsns_low_lat_stream_skel.so:system/lib/rfsa/adsp/libsns_low_lat_stream_skel.so:qcom \
diff --git a/self-extractors/root/proprietary/device-vendor.mk b/self-extractors/root/proprietary/device-vendor.mk
index b00c611..b241870 100644
--- a/self-extractors/root/proprietary/device-vendor.mk
+++ b/self-extractors/root/proprietary/device-vendor.mk
@@ -12,11 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-ifneq ($(filter sargo,$(TARGET_DEVICE)),)
-LOCAL_STEM := sargo/BoardConfigPartial.mk
-else
-LOCAL_STEM := bonito/BoardConfigPartial.mk
-endif
+LOCAL_STEM := bonito/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/self-extractors_sargo/extract-lists.txt b/self-extractors_sargo/extract-lists.txt
index de28ec9..20c3ed5 100644
--- a/self-extractors_sargo/extract-lists.txt
+++ b/self-extractors_sargo/extract-lists.txt
@@ -6,13 +6,10 @@
   qcom)
     TO_EXTRACT="\
             system/app/QtiTelephonyService/QtiTelephonyService.apk \
-            system/compatibility_matrix.xml \
             system/etc/cne/andsfCne.xml \
             system/etc/cne/Nexus/ATT/ATT_profiles.xml \
             system/etc/cne/Nexus/ROW/ROW_profiles.xml \
             system/etc/cne/Nexus/VZW/VZW_profiles.xml \
-            system/etc/ld.config.28.txt \
-            system/etc/llndk.libraries.28.txt \
             system/etc/permissions/cneapiclient.xml \
             system/etc/permissions/com.quicinc.cne.xml \
             system/etc/permissions/embms.xml \
@@ -31,13 +28,8 @@
             system/framework/com.android.mediadrm.signer.jar \
             system/framework/com.qualcomm.qti.uceservice-V2.0-java.jar \
             system/framework/javax.obex.jar \
-            system/framework/LteDirectDiscoveryLibrary.jar \
-            system/framework/org.apache.http.legacy.boot.jar \
-            system/framework/org.apache.http.legacy.boot.jar.prof \
             system/framework/qcrilhook.jar \
             system/framework/QtiTelephonyServicelibrary.jar \
-            system/framework/radioconfiginterfacelibrary.jar \
-            system/framework/radioconfiglibrary.jar \
             system/framework/uimlpalibrary.jar \
             system/framework/uimremoteclientlibrary.jar \
             system/framework/uimremoteserverlibrary.jar \
@@ -60,7 +52,6 @@
             system/lib64/lib-imsvtutils.so \
             system/lib64/liblistenjni.so \
             system/lib64/liblistensoundmodel2.so \
-            system/lib64/liblogcat.so \
             system/lib64/libmdsprpc_system.so \
             system/lib64/libminui.so \
             system/lib64/libqsap_sdk.so \
@@ -70,9 +61,7 @@
             system/lib64/libsdsprpc_system.so \
             system/lib64/libsecureui_svcsock_system.so \
             system/lib64/libsensorslog.so \
-            system/lib64/libsepol.so \
             system/lib64/libsns_low_lat_stream_stub.so \
-            system/lib64/libunwind.so \
             system/lib/libadsprpc_system.so \
             system/lib/libcdsprpc_system.so \
             system/lib/libdiag_system.so \
@@ -90,7 +79,6 @@
             system/lib/libmdsprpc_system.so \
             system/lib/libminui.so \
             system/lib/libnl.so \
-            system/lib/libpac.so \
             system/lib/libqct_resampler.so \
             system/lib/libqsap_sdk.so \
             system/lib/libQTEEConnector_system.so \
@@ -100,7 +88,6 @@
             system/lib/libsecureui_svcsock_system.so \
             system/lib/libsensorslog.so \
             system/lib/libsns_low_lat_stream_stub.so \
-            system/lib/libunwind.so \
             system/lib/rfsa/adsp/libsns_low_lat_stream_skel.so \
             "
     ;;
diff --git a/self-extractors_sargo/qcom/staging/device-partial.mk b/self-extractors_sargo/qcom/staging/device-partial.mk
index c62a33c..f4a9293 100644
--- a/self-extractors_sargo/qcom/staging/device-partial.mk
+++ b/self-extractors_sargo/qcom/staging/device-partial.mk
@@ -14,19 +14,14 @@
 
 # AOSP packages required by the blobs
 PRODUCT_PACKAGES := \
-    com.android.ims.rcsmanager.xml \
-    com.android.ims.rcsmanager \
     QtiTelephonyService
 
 #  blob(s) necessary for sargo hardware
 PRODUCT_COPY_FILES := \
-    vendor/qcom/sargo/proprietary/compatibility_matrix.xml:system/compatibility_matrix.xml:qcom \
     vendor/qcom/sargo/proprietary/andsfCne.xml:system/etc/cne/andsfCne.xml:qcom \
     vendor/qcom/sargo/proprietary/ATT_profiles.xml:system/etc/cne/Nexus/ATT/ATT_profiles.xml:qcom \
     vendor/qcom/sargo/proprietary/ROW_profiles.xml:system/etc/cne/Nexus/ROW/ROW_profiles.xml:qcom \
     vendor/qcom/sargo/proprietary/VZW_profiles.xml:system/etc/cne/Nexus/VZW/VZW_profiles.xml:qcom \
-    vendor/qcom/sargo/proprietary/ld.config.28.txt:system/etc/ld.config.28.txt:qcom \
-    vendor/qcom/sargo/proprietary/llndk.libraries.28.txt:system/etc/llndk.libraries.28.txt:qcom \
     vendor/qcom/sargo/proprietary/cneapiclient.xml:system/etc/permissions/cneapiclient.xml:qcom \
     vendor/qcom/sargo/proprietary/com.quicinc.cne.xml:system/etc/permissions/com.quicinc.cne.xml:qcom \
     vendor/qcom/sargo/proprietary/embms.xml:system/etc/permissions/embms.xml:qcom \
@@ -45,13 +40,8 @@
     vendor/qcom/sargo/proprietary/com.android.mediadrm.signer.jar:system/framework/com.android.mediadrm.signer.jar:qcom \
     vendor/qcom/sargo/proprietary/com.qualcomm.qti.uceservice-V2.0-java.jar:system/framework/com.qualcomm.qti.uceservice-V2.0-java.jar:qcom \
     vendor/qcom/sargo/proprietary/javax.obex.jar:system/framework/javax.obex.jar:qcom \
-    vendor/qcom/sargo/proprietary/LteDirectDiscoveryLibrary.jar:system/framework/LteDirectDiscoveryLibrary.jar:qcom \
-    vendor/qcom/sargo/proprietary/org.apache.http.legacy.boot.jar:system/framework/org.apache.http.legacy.boot.jar:qcom \
-    vendor/qcom/sargo/proprietary/org.apache.http.legacy.boot.jar.prof:system/framework/org.apache.http.legacy.boot.jar.prof:qcom \
     vendor/qcom/sargo/proprietary/qcrilhook.jar:system/framework/qcrilhook.jar:qcom \
     vendor/qcom/sargo/proprietary/QtiTelephonyServicelibrary.jar:system/framework/QtiTelephonyServicelibrary.jar:qcom \
-    vendor/qcom/sargo/proprietary/radioconfiginterfacelibrary.jar:system/framework/radioconfiginterfacelibrary.jar:qcom \
-    vendor/qcom/sargo/proprietary/radioconfiglibrary.jar:system/framework/radioconfiglibrary.jar:qcom \
     vendor/qcom/sargo/proprietary/uimlpalibrary.jar:system/framework/uimlpalibrary.jar:qcom \
     vendor/qcom/sargo/proprietary/uimremoteclientlibrary.jar:system/framework/uimremoteclientlibrary.jar:qcom \
     vendor/qcom/sargo/proprietary/uimremoteserverlibrary.jar:system/framework/uimremoteserverlibrary.jar:qcom \
@@ -74,7 +64,6 @@
     vendor/qcom/sargo/proprietary/lib64/lib-imsvtutils.so:system/lib64/lib-imsvtutils.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/liblistenjni.so:system/lib64/liblistenjni.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/liblistensoundmodel2.so:system/lib64/liblistensoundmodel2.so:qcom \
-    vendor/qcom/sargo/proprietary/lib64/liblogcat.so:system/lib64/liblogcat.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/libmdsprpc_system.so:system/lib64/libmdsprpc_system.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/libminui.so:system/lib64/libminui.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/libqsap_sdk.so:system/lib64/libqsap_sdk.so:qcom \
@@ -84,9 +73,7 @@
     vendor/qcom/sargo/proprietary/lib64/libsdsprpc_system.so:system/lib64/libsdsprpc_system.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/libsecureui_svcsock_system.so:system/lib64/libsecureui_svcsock_system.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/libsensorslog.so:system/lib64/libsensorslog.so:qcom \
-    vendor/qcom/sargo/proprietary/lib64/libsepol.so:system/lib64/libsepol.so:qcom \
     vendor/qcom/sargo/proprietary/lib64/libsns_low_lat_stream_stub.so:system/lib64/libsns_low_lat_stream_stub.so:qcom \
-    vendor/qcom/sargo/proprietary/lib64/libunwind.so:system/lib64/libunwind.so:qcom \
     vendor/qcom/sargo/proprietary/libadsprpc_system.so:system/lib/libadsprpc_system.so:qcom \
     vendor/qcom/sargo/proprietary/libcdsprpc_system.so:system/lib/libcdsprpc_system.so:qcom \
     vendor/qcom/sargo/proprietary/libdiag_system.so:system/lib/libdiag_system.so:qcom \
@@ -104,7 +91,6 @@
     vendor/qcom/sargo/proprietary/libmdsprpc_system.so:system/lib/libmdsprpc_system.so:qcom \
     vendor/qcom/sargo/proprietary/libminui.so:system/lib/libminui.so:qcom \
     vendor/qcom/sargo/proprietary/libnl.so:system/lib/libnl.so:qcom \
-    vendor/qcom/sargo/proprietary/libpac.so:system/lib/libpac.so:qcom \
     vendor/qcom/sargo/proprietary/libqct_resampler.so:system/lib/libqct_resampler.so:qcom \
     vendor/qcom/sargo/proprietary/libqsap_sdk.so:system/lib/libqsap_sdk.so:qcom \
     vendor/qcom/sargo/proprietary/libQTEEConnector_system.so:system/lib/libQTEEConnector_system.so:qcom \
@@ -114,5 +100,4 @@
     vendor/qcom/sargo/proprietary/libsecureui_svcsock_system.so:system/lib/libsecureui_svcsock_system.so:qcom \
     vendor/qcom/sargo/proprietary/libsensorslog.so:system/lib/libsensorslog.so:qcom \
     vendor/qcom/sargo/proprietary/libsns_low_lat_stream_stub.so:system/lib/libsns_low_lat_stream_stub.so:qcom \
-    vendor/qcom/sargo/proprietary/libunwind.so:system/lib/libunwind.so:qcom \
     vendor/qcom/sargo/proprietary/libsns_low_lat_stream_skel.so:system/lib/rfsa/adsp/libsns_low_lat_stream_skel.so:qcom \
diff --git a/sound_trigger_mixer_paths.xml b/sound_trigger_mixer_paths.xml
index 15132a3..b0109b0 100644
--- a/sound_trigger_mixer_paths.xml
+++ b/sound_trigger_mixer_paths.xml
@@ -162,7 +162,7 @@
     </path>
 
     <path name="echo-reference">
-        <ctl name="AUDIO_REF_EC_UL1 MUX" value="QUAT_TDM_RX_0"/>
+        <ctl name="AUDIO_REF_EC_UL1 MUX" value="SEC_TDM_RX_0"/>
         <ctl name="EC Reference Channels" value="Two"/>
         <ctl name="EC Reference Bit Format" value="S16_LE"/>
         <ctl name="EC Reference SampleRate" value="48000"/>
diff --git a/thermal-engine-bonito.conf b/thermal-engine-bonito.conf
index 86f8c17..56ee62e 100644
--- a/thermal-engine-bonito.conf
+++ b/thermal-engine-bonito.conf
@@ -22,8 +22,8 @@
 algo_type	monitor
 sampling	1000
 sensor		mb-therm-adc
-thresholds	47000			49000		50000			58000
-thresholds_clr	46000			48000		49000			57000
+thresholds	47000			49000		50000			60000
+thresholds_clr	46000			48000		49000			59000
 actions 	cpu0+cpu6		cpu0+cpu6	cpu0+cpu6		shutdown
 action_info	1209600+1363200 	998400+979200	748800+825600		1
 
@@ -36,15 +36,6 @@
 actions         gpu
 action_info     355000000
 
-[USB-MONITOR]
-algo_type       monitor
-sampling        1000
-sensor          usbc-therm-adc
-thresholds      58000		63000
-thresholds_clr  45000		58000
-actions         usb		usb
-action_info     1		2
-
 [MODEM-MONITOR]
 algo_type       monitor
 sampling        5000
diff --git a/thermal-engine-sargo.conf b/thermal-engine-sargo.conf
index a90a456..a6994a4 100644
--- a/thermal-engine-sargo.conf
+++ b/thermal-engine-sargo.conf
@@ -22,8 +22,8 @@
 algo_type	monitor
 sampling	1000
 sensor		mb-therm-adc
-thresholds	44000			45000		47000			55000
-thresholds_clr	43000			44000		46000			54000
+thresholds	44000			45000		47000			57000
+thresholds_clr	43000			44000		46000			56000
 actions 	cpu0+cpu6		cpu0+cpu6	cpu0+cpu6		shutdown
 action_info	1209600+1363200 	998400+979200	748800+825600		1
 
@@ -36,15 +36,6 @@
 actions         gpu
 action_info     355000000
 
-[USB-MONITOR]
-algo_type       monitor
-sampling        1000
-sensor          usbc-therm-adc
-thresholds      58000		63000
-thresholds_clr  45000		58000
-actions         usb		usb
-action_info     1		2
-
 [MODEM-MONITOR]
 algo_type       monitor
 sampling        5000
diff --git a/thermal/Android.bp b/thermal/Android.bp
deleted file mode 100644
index 9d47b74..0000000
--- a/thermal/Android.bp
+++ /dev/null
@@ -1,32 +0,0 @@
-cc_binary {
-  name: "android.hardware.thermal@1.1-service.bonito",
-  defaults: [
-    "hidl_defaults",
-  ],
-  vendor: true,
-  relative_install_path: "hw",
-  init_rc: [
-    "android.hardware.thermal@1.1-service.bonito.rc",
-  ],
-  srcs: [
-    "service.cpp",
-    "Thermal.cpp",
-    "thermal-helper.cpp",
-    "utils/cooling_devices.cpp",
-    "utils/device_file_watcher.cpp",
-    "utils/sensors.cpp",
-    "utils/ThermalConfigParser.cpp",
-  ],
-  shared_libs: [
-    "libbase",
-    "libhidlbase",
-    "libhidltransport",
-    "libutils",
-    "android.hardware.thermal@1.0",
-    "android.hardware.thermal@1.1",
-  ],
-  cflags: [
-    "-Wall",
-    "-Werror",
-  ],
-}
diff --git a/thermal/Thermal.cpp b/thermal/Thermal.cpp
deleted file mode 100644
index 70ac1d2..0000000
--- a/thermal/Thermal.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * 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.
- */
-
-#include <cerrno>
-#include <mutex>
-#include <string>
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-
-#include "Thermal.h"
-#include "thermal-helper.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-namespace {
-
-using ::android::hardware::hidl_death_recipient;
-using ::android::hardware::thermal::V1_0::CoolingDevice;
-using ::android::hardware::thermal::V1_0::Temperature;
-using ::android::hardware::thermal::V1_0::ThermalStatus;
-using ::android::hardware::thermal::V1_0::ThermalStatusCode;
-using ::android::hardware::Void;
-using ::android::hidl::base::V1_0::IBase;
-using ::android::wp;
-
-sp<IThermalCallback> gThermalCallback;
-std::mutex gThermalCallbackMutex;
-
-template <typename T, typename U>
-Return<void> setFailureAndCallback(
-    T _hidl_cb, hidl_vec<U> data, const std::string& debug_msg) {
-    ThermalStatus status;
-    status.code = ThermalStatusCode::FAILURE;
-    status.debugMessage = debug_msg;
-    _hidl_cb(status, data);
-    return Void();
-}
-
-template <typename T, typename U>
-Return<void> setInitFailureAndCallback(T _hidl_cb, hidl_vec<U> data) {
-    return setFailureAndCallback(
-        _hidl_cb, data, "Failure initializing thermal HAL");
-}
-
-// This function will hold gThermalCallbackMutex when called.
-void checkThermalCallbackAndNotify(
-        const std::pair<bool, Temperature>& notify_params) {
-    std::lock_guard<std::mutex> _lock(gThermalCallbackMutex);
-    if (gThermalCallback) {
-        Return<void> ret = gThermalCallback->notifyThrottling(
-            notify_params.first, notify_params.second);
-
-        if (!ret.isOk()) {
-            if (ret.isDeadObject()) {
-                gThermalCallback = nullptr;
-                LOG(WARNING) << "ThermalCallback died. "
-                             << "Throttling event dropped.";
-            } else {
-                LOG(WARNING)
-                    << "Failed to send throttling event to "
-                    << "ThermalCallback";
-            }
-        }
-    } else {
-        LOG(WARNING)
-            << "No ThermalCallback registered. "
-            << "Throttling event dropped.";
-    }
-}
-
-}  // namespace
-
-void Thermal::serviceDied(
-        uint64_t cookie __unused, const wp<IBase>& who __unused) {
-    std::lock_guard<std::mutex> _lock(gThermalCallbackMutex);
-    gThermalCallback = nullptr;
-    LOG(ERROR) << "IThermalCallback HIDL service died";
-}
-
-// On init we will spawn a thread which will continually watch for
-// throttling.  When throttling is seen, if we have a callback registered
-// the thread will call notifyThrottling() else it will log the dropped
-// throttling event and do nothing.  The thread is only killed when
-// Thermal() is killed.
-Thermal::Thermal() : thermal_helper_(), cpu_throttling_watcher_() {
-    cpu_throttling_watcher_.registerFilesToWatch(
-        thermal_helper_.getCoolingDevicePaths());
-    cpu_throttling_watcher_.registerCallback(
-        std::bind(&Thermal::notifyIfThrottlingSeen, this,
-                  std::placeholders::_1));
-    cpu_throttling_watcher_.registerQueueOverflowCallback(
-        std::bind(&Thermal::resetStateWhenWatcherQueueOverflows, this));
-    cpu_throttling_watcher_.startWatchingDeviceFiles();
-}
-
-// Methods from ::android::hardware::thermal::V1_0::IThermal.
-Return<void> Thermal::getTemperatures(getTemperatures_cb _hidl_cb) {
-    ThermalStatus status;
-    status.code = ThermalStatusCode::SUCCESS;
-    hidl_vec<Temperature> temperatures;
-
-    if (!thermal_helper_.isInitializedOk()) {
-        LOG(ERROR) << "ThermalHAL not initialized properly.";
-        return setInitFailureAndCallback(_hidl_cb, temperatures);
-    }
-
-    if (!thermal_helper_.fillTemperatures(&temperatures)) {
-        return setFailureAndCallback(_hidl_cb, temperatures,
-                "Failed to read thermal sensors.");
-    }
-
-    for (const auto& t : temperatures) {
-        LOG(DEBUG) << "getTemperatures "
-                   << " Type: " << android::hardware::thermal::V1_0::toString(t.type)
-                   << " Name: " << t.name
-                   << " CurrentValue: " << t.currentValue
-                   << " ThrottlingThreshold: " << t.throttlingThreshold
-                   << " ShutdownThreshold: " << t.shutdownThreshold
-                   << " VrThrottlingThreshold: " << t.vrThrottlingThreshold;
-    }
-    _hidl_cb(status, temperatures);
-    return Void();
-}
-
-Return<void> Thermal::getCpuUsages(getCpuUsages_cb _hidl_cb) {
-    ThermalStatus status;
-    status.code = ThermalStatusCode::SUCCESS;
-    hidl_vec<CpuUsage> cpu_usages;
-
-    if (!thermal_helper_.isInitializedOk()) {
-        return setInitFailureAndCallback(_hidl_cb, cpu_usages);
-    }
-
-    if (!thermal_helper_.fillCpuUsages(&cpu_usages)) {
-        return setFailureAndCallback(_hidl_cb, cpu_usages,
-            "Failed to get CPU usages.");
-    }
-
-    for (const auto& usage : cpu_usages) {
-        LOG(DEBUG) << "getCpuUsages "
-                   << " Name: " << usage.name
-                   << " Active: " << usage.active
-                   << " Total: " << usage.total
-                   << " IsOnline: " << usage.isOnline;
-    }
-    _hidl_cb(status, cpu_usages);
-    return Void();
-}
-
-Return<void> Thermal::getCoolingDevices(getCoolingDevices_cb _hidl_cb) {
-    ThermalStatus status;
-    status.code = ThermalStatusCode::SUCCESS;
-    hidl_vec<CoolingDevice> cooling_devices;
-
-    if (!thermal_helper_.isInitializedOk()) {
-        return setInitFailureAndCallback(_hidl_cb, cooling_devices);
-    }
-    LOG(DEBUG) << "No cooling device.";
-    _hidl_cb(status, cooling_devices);
-    return Void();
-}
-
-Return<void> Thermal::debug(
-        const hidl_handle& handle, const hidl_vec<hidl_string>&) {
-    if (handle != nullptr && handle->numFds >= 1) {
-        int fd = handle->data[0];
-        std::ostringstream dump_buf;
-
-        if (!thermal_helper_.isInitializedOk()) {
-            dump_buf << "ThermalHAL not initialized properly." << std::endl;
-        } else {
-            hidl_vec<Temperature> temperatures;
-            hidl_vec<CpuUsage> cpu_usages;
-
-            dump_buf << "getTemperatures:" << std::endl;
-            if (!thermal_helper_.fillTemperatures(&temperatures)) {
-                dump_buf << "Failed to read thermal sensors." << std::endl;
-            }
-
-            for (const auto& t : temperatures) {
-                dump_buf << "Name: " << t.name << " Type: "
-                         << android::hardware::thermal::V1_0::toString(t.type)
-                         << " CurrentValue: " << t.currentValue
-                         << " ThrottlingThreshold: " << t.throttlingThreshold
-                         << " ShutdownThreshold: " << t.shutdownThreshold
-                         << " VrThrottlingThreshold: "
-                         << t.vrThrottlingThreshold << std::endl;
-            }
-
-            dump_buf << "getCpuUsages:" << std::endl;
-            if (!thermal_helper_.fillCpuUsages(&cpu_usages)) {
-                dump_buf << "Failed to get CPU usages." << std::endl;
-            }
-
-            for (const auto& usage : cpu_usages) {
-                dump_buf << "Name: " << usage.name
-                         << " Active: " << usage.active
-                         << " Total: " << usage.total
-                         << " IsOnline: " << usage.isOnline
-                         << std::endl;
-            }
-
-        }
-        std::string buf = dump_buf.str();
-        if (!android::base::WriteStringToFd(buf, fd)) {
-            PLOG(ERROR) << "Failed to dump state to fd";
-        }
-        fsync(fd);
-    }
-    return Void();
-}
-
-// Methods from ::android::hardware::thermal::V1_1::IThermal.
-Return<void> Thermal::registerThermalCallback(const sp<IThermalCallback>& cb) {
-    std::lock_guard<std::mutex> _lock(gThermalCallbackMutex);
-    if (gThermalCallback) {
-        LOG(WARNING) << "Thermal callback was already assigned!";
-    }
-
-    auto cpu_throttling_watcher_status =
-        cpu_throttling_watcher_.getWatcherThreadStatus();
-    if (cpu_throttling_watcher_status == std::future_status::ready) {
-        LOG(ERROR) << "The CPU throttling watcher thread stopped running. "
-                   << "Restarting it.";
-        cpu_throttling_watcher_.startWatchingDeviceFiles();
-    }
-
-    gThermalCallback = cb;
-    if (gThermalCallback) {
-        gThermalCallback->linkToDeath(this, 0x451F /* cookie, unused */);
-        LOG(INFO) << "ThermalCallback registered.";
-    } else {
-        LOG(INFO) << "ThermalCallback unregistered.";
-    }
-    return Void();
-}
-
-void Thermal::notifyIfThrottlingSeen(
-        const std::pair<std::string, std::string>& throttling_data) {
-    std::pair<bool, Temperature> notify_params;
-    bool shouldNotify = thermal_helper_.checkThrottlingData(
-        throttling_data, &notify_params);
-
-    if (shouldNotify) {
-        checkThermalCallbackAndNotify(notify_params);
-    }
-}
-
-void Thermal::resetStateWhenWatcherQueueOverflows() {
-    int throttling_value;
-    for (const auto& entry : thermal_helper_.getValidCoolingDeviceMap()) {
-        if (thermal_helper_.readCoolingDevice(entry.first, &throttling_value)) {
-            notifyIfThrottlingSeen(std::make_pair(
-                entry.first, std::to_string(throttling_value)));
-        }
-    }
-}
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
diff --git a/thermal/Thermal.h b/thermal/Thermal.h
deleted file mode 100644
index 9157bf1..0000000
--- a/thermal/Thermal.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef ANDROID_HARDWARE_THERMAL_V1_1_BONITO_THERMAL_H
-#define ANDROID_HARDWARE_THERMAL_V1_1_BONITO_THERMAL_H
-
-#include <future>
-#include <thread>
-
-#include <android/hardware/thermal/1.1/IThermalCallback.h>
-#include <android/hardware/thermal/1.1/IThermal.h>
-#include <hidl/Status.h>
-#include <hidl/MQDescriptor.h>
-
-#include "thermal-helper.h"
-#include "utils/device_file_watcher.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-using ::android::hardware::hidl_vec;
-using ::android::hardware::thermal::V1_1::IThermal;
-using ::android::hardware::thermal::V1_1::IThermalCallback;
-using ::android::hardware::Return;
-using ::android::sp;
-
-class Thermal : public IThermal, public hidl_death_recipient {
-   public:
-    Thermal();
-    ~Thermal() = default;
-
-    // Disallow copy and assign.
-    Thermal(const Thermal&) = delete;
-    void operator= (const Thermal&) = delete;
-
-    // Notify listeners whenever the HAL sees cpu throttling. This will be
-    // registered as a callback to cpu_throttling_watcher.
-    void notifyIfThrottlingSeen(
-        const std::pair<std::string, std::string>& throttling_data);
-
-    // This will be registered as a callback to cpu_throttling_watcher if we see
-    // a Q_OVERFLOW event. Right now this will just reread all throttling
-    // levels.
-    void resetStateWhenWatcherQueueOverflows();
-
-    // Methods from ::android::hardware::thermal::V1_0::IThermal.
-    Return<void> getTemperatures(getTemperatures_cb _hidl_cb) override;
-    Return<void> getCpuUsages(getCpuUsages_cb _hidl_cb) override;
-    Return<void> getCoolingDevices(getCoolingDevices_cb _hidl_cb) override;
-
-    // Methods from ::android::hardware::thermal::V1_1::IThermal.
-    Return<void> registerThermalCallback(
-        const sp<IThermalCallback>& cb) override;
-
-    // Methods from ::android::hardware::hidl_death_recipient.
-    void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
-
-    // Methods from ::android::hidl::base::V1_0::IBase follow.
-    Return<void> debug(
-        const hidl_handle& fd, const hidl_vec<hidl_string>& args) override;
-
-   private:
-    ThermalHelper thermal_helper_;
-    DeviceFileWatcher cpu_throttling_watcher_;
-};
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
-
-#endif  // ANDROID_HARDWARE_THERMAL_V1_1_BONITO_THERMAL_H
diff --git a/thermal/android.hardware.thermal@1.1-service.bonito.rc b/thermal/android.hardware.thermal@1.1-service.bonito.rc
deleted file mode 100644
index 7c31e26..0000000
--- a/thermal/android.hardware.thermal@1.1-service.bonito.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service thermal-hal-1-1 /vendor/bin/hw/android.hardware.thermal@1.1-service.bonito
-    class hal
-    user system
-    group system
diff --git a/thermal/service.cpp b/thermal/service.cpp
deleted file mode 100644
index 7fe6a63..0000000
--- a/thermal/service.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- */
-#include <android-base/logging.h>
-#include <hidl/HidlTransportSupport.h>
-#include "Thermal.h"
-
-using ::android::status_t;
-using ::android::OK;
-
-// libhwbinder:
-using ::android::hardware::configureRpcThreadpool;
-using ::android::hardware::joinRpcThreadpool;
-
-// Generated HIDL files:
-using ::android::hardware::thermal::V1_1::implementation::Thermal;
-using ::android::hardware::thermal::V1_1::IThermal;
-
-static int shutdown() {
-  LOG(ERROR) << "Thermal Service is shutting down.";
-  return 1;
-}
-
-int main(int /* argc */, char** /* argv */) {
-    status_t status;
-    android::sp<IThermal> service = nullptr;
-
-    LOG(INFO) << "Thermal HAL Service 1.1 starting...";
-
-    service = new Thermal();
-    if (service == nullptr) {
-        LOG(ERROR) << "Error creating an instance of ThermalHAL.  Exiting...";
-        return shutdown();
-    }
-
-    configureRpcThreadpool(1, true /* callerWillJoin */);
-
-    status = service->registerAsService();
-    if (status != OK) {
-        LOG(ERROR) << "Could not register service for ThermalHAL ("
-                   << status << ")";
-        return shutdown();
-    }
-
-    LOG(INFO) << "Thermal Service started successfully.";
-    joinRpcThreadpool();
-    // We should not get past the joinRpcThreadpool().
-    return shutdown();
-}
diff --git a/thermal/thermal-helper.cpp b/thermal/thermal-helper.cpp
deleted file mode 100644
index c2257e1..0000000
--- a/thermal/thermal-helper.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * 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.
- */
-
-#include <set>
-#include <sstream>
-#include <vector>
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/properties.h>
-#include <android-base/stringprintf.h>
-#include <android-base/strings.h>
-
-#include "thermal-helper.h"
-#include "utils/ThermalConfigParser.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-constexpr char kThermalSensorsRoot[] = "/sys/devices/virtual/thermal";
-constexpr char kCpuOnlineRoot[] = "/sys/devices/system/cpu";
-constexpr char kCpuUsageFile[] = "/proc/stat";
-constexpr char kCpuOnlineFileSuffix[] = "online";
-constexpr char kThermalConfigPrefix[] = "/vendor/etc/thermal-engine-";
-constexpr char kLittleCoreCpuFreq[] = "thermal-cpufreq-0";
-constexpr char kBigCoreCpuFreq[] = "thermal-cpufreq-6";
-constexpr char kUsbCdevName[] = "usb";
-constexpr char kUsbSensorType[] = "usbc-therm-adc";
-constexpr unsigned int kMaxCpus = 8;
-// The number of available sensors in thermalHAL is:
-// 8 (for each cpu) + 2 (for each gpu) + battery + skin + usb = 13.
-constexpr unsigned int kAvailableSensors = 14;
-// The following constants are used for limiting the number of throttling
-// notifications. See b/117438310 for details.
-constexpr int kDesiredLittleCoreCoolingStateCliff = 5;
-constexpr int kDesiredBigCoreCoolingStateCliff = 7;
-
-// This is a golden set of thermal sensor name and releveant information about
-// the sensor. Used when we read in sensor values.
-const std::map<std::string, SensorInfo> kValidThermalSensorInfoMap = {
-    {"cpu0-silver-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},  // CPU0
-    {"cpu1-silver-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},  // CPU1
-    {"cpu2-silver-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},  // CPU2
-    {"cpu3-silver-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},  // CPU3
-    {"cpu4-silver-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},  // CPU4
-    {"cpu5-silver-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},  // CPU5
-    {"cpu0-gold-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},    // CPU6
-    {"cpu1-gold-usr", {TemperatureType::CPU, true, 95.0, 125.0, .001}},    // CPU7
-    // GPU thermal sensors.
-    {"gpu0-usr", {TemperatureType::GPU, true, 95.0, 125.0, .001}},
-    {"gpu1-usr", {TemperatureType::GPU, true, 95.0, 125.0, .001}},
-    // Battery thermal sensor.
-    {"battery", {TemperatureType::BATTERY, true, NAN, 60.0, .001}},
-    // Skin sensor.
-    {kSkinSensorType, {TemperatureType::SKIN, false, NAN, NAN, .001}},
-    // USBC thermal sensor.
-    {kUsbSensorType, {TemperatureType::SKIN, false, 63, NAN, .001}},
-    {"pa-therm0-adc", {TemperatureType::UNKNOWN, false, NAN, NAN, .001}},
-};
-
-namespace {
-
-using android::base::StringPrintf;
-
-void parseCpuUsagesFileAndAssignUsages(hidl_vec<CpuUsage> *cpu_usages) {
-    uint64_t cpu_num, user, nice, system, idle;
-    std::string cpu_name;
-    std::string data;
-    if (!android::base::ReadFileToString(kCpuUsageFile, &data)) {
-        LOG(ERROR) << "Error reading Cpu usage file: " << kCpuUsageFile;
-        return;
-    }
-
-    std::istringstream stat_data(data);
-    std::string line;
-    while (std::getline(stat_data, line)) {
-        if (line.find("cpu") == 0 && isdigit(line[3])) {
-            // Split the string using spaces.
-            std::vector<std::string> words = android::base::Split(line, " ");
-            cpu_name = words[0];
-            cpu_num = std::stoi(cpu_name.substr(3));
-
-            if (cpu_num < kMaxCpus) {
-                user = std::stoi(words[1]);
-                nice = std::stoi(words[2]);
-                system = std::stoi(words[3]);
-                idle = std::stoi(words[4]);
-
-                // Check if the CPU is online by reading the online file.
-                std::string cpu_online_path = StringPrintf("%s/%s/%s", kCpuOnlineRoot,
-                                                           cpu_name.c_str(), kCpuOnlineFileSuffix);
-                std::string is_online;
-                if (!android::base::ReadFileToString(cpu_online_path, &is_online)) {
-                    LOG(ERROR) << "Could not open Cpu online file: " << cpu_online_path;
-                    return;
-                }
-                is_online = android::base::Trim(is_online);
-
-                (*cpu_usages)[cpu_num].name = cpu_name;
-                (*cpu_usages)[cpu_num].active = user + nice + system;
-                (*cpu_usages)[cpu_num].total = user + nice + system + idle;
-                (*cpu_usages)[cpu_num].isOnline = (is_online == "1") ? true : false;
-            } else {
-                LOG(ERROR) << "Unexpected cpu number: " << words[0];
-                return;
-            }
-        }
-    }
-}
-
-float getThresholdFromType(const TemperatureType type, const ThrottlingThresholds &threshold) {
-    switch (type) {
-        case TemperatureType::CPU:
-            return threshold.cpu;
-        case TemperatureType::GPU:
-            return threshold.gpu;
-        case TemperatureType::BATTERY:
-            return threshold.battery;
-        case TemperatureType::SKIN:
-            return threshold.ss;
-        default:
-            return NAN;
-    }
-}
-
-}  // namespace
-
-// This is a golden set of cooling device types and their corresponding sensor
-// thernal zone name.
-static const std::map<std::string, std::string> kValidCoolingDeviceTypeMap = {
-    {kLittleCoreCpuFreq, "cpu0-silver-usr"},  // CPU0
-    {kBigCoreCpuFreq, "cpu0-gold-usr"},       // CPU6
-    {kUsbCdevName, kUsbSensorType}, // USB connector
-};
-
-void ThermalHelper::updateOverideThresholds() {
-    for (const auto &sensorMap : kValidThermalSensorInfoMap) {
-        if (sensorMap.second.is_override) {
-            switch (sensorMap.second.type) {
-                case TemperatureType::CPU:
-                    thresholds_.cpu = sensorMap.second.throttling;
-                    vr_thresholds_.cpu = sensorMap.second.throttling;
-                    shutdown_thresholds_.cpu = sensorMap.second.shutdown;
-                    break;
-                case TemperatureType::GPU:
-                    thresholds_.gpu = sensorMap.second.throttling;
-                    vr_thresholds_.gpu = sensorMap.second.throttling;
-                    shutdown_thresholds_.gpu = sensorMap.second.shutdown;
-                    break;
-                case TemperatureType::BATTERY:
-                    thresholds_.battery = sensorMap.second.throttling;
-                    vr_thresholds_.battery = sensorMap.second.throttling;
-                    shutdown_thresholds_.battery = sensorMap.second.shutdown;
-                    break;
-                case TemperatureType::SKIN:
-                    thresholds_.ss = sensorMap.second.throttling;
-                    vr_thresholds_.ss = sensorMap.second.throttling;
-                    shutdown_thresholds_.ss = sensorMap.second.shutdown;
-                    break;
-                default:
-                    break;
-            }
-        }
-    }
-}
-
-/*
- * Populate the sensor_name_to_file_map_ map by walking through the file tree,
- * reading the type file and assigning the temp file path to the map.  If we do
- * not succeed, abort.
- */
-ThermalHelper::ThermalHelper()
-    : is_initialized_(initializeSensorMap() && initializeCoolingDevices()) {
-    if (!is_initialized_) {
-        LOG(FATAL) << "ThermalHAL could not be initialized properly.";
-    }
-
-    std::string hw = android::base::GetProperty("ro.hardware", "");
-    std::string thermal_config(kThermalConfigPrefix + hw + ".conf");
-    std::string vr_thermal_config(kThermalConfigPrefix + hw + "-vr.conf");
-    InitializeThresholdsFromThermalConfig(thermal_config, vr_thermal_config,
-                                          kValidThermalSensorInfoMap, &thresholds_,
-                                          &shutdown_thresholds_, &vr_thresholds_);
-    updateOverideThresholds();
-}
-
-std::vector<std::string> ThermalHelper::getCoolingDevicePaths() {
-    std::vector<std::string> paths;
-    for (const auto &entry : kValidCoolingDeviceTypeMap) {
-        std::string path = cooling_devices_.getCoolingDevicePath(entry.first);
-        if (!path.empty()) {
-            paths.push_back(path + "/cur_state");
-        }
-    }
-    return paths;
-}
-
-const std::map<std::string, std::string> &ThermalHelper::getValidCoolingDeviceMap() const {
-    return kValidCoolingDeviceTypeMap;
-}
-
-bool ThermalHelper::readCoolingDevice(const std::string &cooling_device, int *data) const {
-    return cooling_devices_.getCoolingDeviceState(cooling_device, data);
-}
-
-bool ThermalHelper::readTemperature(const std::string &sensor_name, Temperature *out) const {
-    // Read the file.  If the file can't be read temp will be empty string.
-    std::string temp;
-    std::string path;
-
-    if (!thermal_sensors_.readSensorFile(sensor_name, &temp, &path)) {
-        LOG(ERROR) << "readTemperature: sensor not found: " << sensor_name;
-        return false;
-    }
-
-    if (temp.empty() && !path.empty()) {
-        LOG(ERROR) << "readTemperature: failed to open file: " << path;
-        return false;
-    }
-
-    SensorInfo sensor_info = kValidThermalSensorInfoMap.at(sensor_name);
-
-    out->type = sensor_info.type;
-    out->name = sensor_name;
-    out->currentValue = std::stoi(temp) * sensor_info.multiplier;
-
-    if (sensor_name == kUsbSensorType) {
-        out->throttlingThreshold = sensor_info.throttling;
-        out->shutdownThreshold = sensor_info.shutdown;
-        out->vrThrottlingThreshold = sensor_info.throttling;
-    } else {
-        out->throttlingThreshold = getThresholdFromType(sensor_info.type, thresholds_);
-        out->shutdownThreshold = getThresholdFromType(sensor_info.type, shutdown_thresholds_);
-        out->vrThrottlingThreshold = getThresholdFromType(sensor_info.type, vr_thresholds_);
-    }
-
-    LOG(DEBUG) << StringPrintf("readTemperature: %d, %s, %g, %g, %g, %g", out->type,
-                               out->name.c_str(), out->currentValue, out->throttlingThreshold,
-                               out->shutdownThreshold, out->vrThrottlingThreshold);
-
-    return true;
-}
-
-bool ThermalHelper::initializeSensorMap() {
-    for (const auto& sensor_info : kValidThermalSensorInfoMap) {
-        std::string sensor_name = sensor_info.first;
-        std::string sensor_temp_path = StringPrintf(
-            "%s/tz-by-name/%s/temp", kThermalSensorsRoot, sensor_name.c_str());
-        if (!thermal_sensors_.addSensor(sensor_name, sensor_temp_path)) {
-            LOG(ERROR) << "Could not add " << sensor_name << "to sensors map";
-        }
-    }
-    if (kAvailableSensors == thermal_sensors_.getNumSensors() ||
-        kValidThermalSensorInfoMap.size() == thermal_sensors_.getNumSensors()) {
-        return true;
-    }
-    return false;
-}
-
-bool ThermalHelper::initializeCoolingDevices() {
-    for (const auto& cooling_device_info : kValidCoolingDeviceTypeMap) {
-        std::string cooling_device_name = cooling_device_info.first;
-        std::string cooling_device_path = StringPrintf(
-            "%s/cdev-by-name/%s", kThermalSensorsRoot,
-            cooling_device_name.c_str());
-
-        if (!cooling_devices_.addCoolingDevice(
-                cooling_device_name, cooling_device_path)) {
-            LOG(ERROR) << "Could not add " << cooling_device_name
-                       << "to cooling device map";
-            continue;
-        }
-
-        int data;
-        if (cooling_devices_.getCoolingDeviceState(
-                cooling_device_name, &data)) {
-            cooling_device_path_to_throttling_level_map_.emplace(
-                cooling_devices_.getCoolingDevicePath(
-                    cooling_device_name).append("/cur_state"),
-                data);
-        } else {
-            LOG(ERROR) << "Could not read cooling device value.";
-        }
-    }
-
-    if (kValidCoolingDeviceTypeMap.size() ==
-            cooling_devices_.getNumCoolingDevices()) {
-        return true;
-    }
-    return false;
-}
-
-bool ThermalHelper::fillTemperatures(hidl_vec<Temperature> *temperatures) {
-    temperatures->resize(kAvailableSensors);
-    int current_index = 0;
-    for (const auto &name_type_pair : kValidThermalSensorInfoMap) {
-        Temperature temp;
-
-        if (readTemperature(name_type_pair.first, &temp)) {
-            (*temperatures)[current_index] = temp;
-        } else {
-            LOG(ERROR) << "Error reading temperature for sensor: " << name_type_pair.first;
-            return false;
-        }
-        ++current_index;
-    }
-    return current_index > 0;
-}
-
-bool ThermalHelper::fillCpuUsages(hidl_vec<CpuUsage> *cpu_usages) {
-    cpu_usages->resize(kMaxCpus);
-    parseCpuUsagesFileAndAssignUsages(cpu_usages);
-    return true;
-}
-
-int ThermalHelper::getMaxThrottlingLevelFromMap() const {
-    auto max_element = std::max_element(
-        cooling_device_path_to_throttling_level_map_.begin(),
-        cooling_device_path_to_throttling_level_map_.end(),
-        [](const std::pair<std::string, int> &p1, const std::pair<std::string, int> &p2) {
-            return p1.second < p2.second;
-        });
-    return max_element->second;
-}
-
-bool ThermalHelper::checkThrottlingData(const std::pair<std::string, std::string> &throttling_data,
-                                        std::pair<bool, Temperature> *notify_params) {
-    Temperature temp;
-
-    // If throttling data is in the map add it into the map and check the
-    // conditions for notification. If not just check if we're alreadhy
-    // throttling or not and notify.
-    std::string cooling_device = throttling_data.first;
-    if (!cooling_device.empty() &&
-        cooling_device_path_to_throttling_level_map_.find(cooling_device) !=
-            cooling_device_path_to_throttling_level_map_.end()) {
-        int throttling_level = std::stoi(throttling_data.second);
-        int max_throttling_level = getMaxThrottlingLevelFromMap();
-
-        // Identify if cooling device is triggered by usb mitigation.
-        std::string usb_cdev_path =
-                cooling_devices_.getCoolingDevicePath(kUsbCdevName) + "/cur_state";
-
-        if (cooling_device == usb_cdev_path) {
-            if (!readTemperature(kUsbSensorType, &temp)) {
-                LOG(ERROR) << "Could not read USBC sensor temperature.";
-                return false;
-            }
-            std::string usb_cdev_max_path =
-                cooling_devices_.getCoolingDevicePath(kUsbCdevName) + "/max_state";
-            std::string usb_cdev_max_state;
-            if (!android::base::ReadFileToString(usb_cdev_max_path, &usb_cdev_max_state)) {
-                LOG(ERROR) << "Could not read USB CDEV max state";
-                return false;
-            }
-
-	    // Only trigger notification when usb cdev state is max or clear
-            if (throttling_level == std::stoi(usb_cdev_max_state)) {
-                *notify_params = std::make_pair(true, temp);
-                return true;
-            } else if (throttling_level == 0) {
-                *notify_params = std::make_pair(false, temp);
-                return true;
-            } else {
-                return false;
-	    }
-        }
-
-        if (!readTemperature(kSkinSensorType, &temp)) {
-            LOG(ERROR) << "Could not read skin sensor temperature.";
-            return false;
-        }
-
-        // The following if-else blocks aim to reduce the number of notifications
-        // triggered by low-level throttling states. See b/117438310 for details.
-        if (throttling_level) {
-            std::string little_cd_path =
-                cooling_devices_.getCoolingDevicePath(kLittleCoreCpuFreq) + "/cur_state";
-            std::string big_cd_path =
-                cooling_devices_.getCoolingDevicePath(kBigCoreCpuFreq) + "/cur_state";
-            if ((cooling_device == little_cd_path &&
-                 throttling_level < kDesiredLittleCoreCoolingStateCliff) ||
-                (cooling_device == big_cd_path &&
-                 throttling_level < kDesiredBigCoreCoolingStateCliff)) {
-                LOG(INFO) << "Masking throttling level " << throttling_level << " for CD "
-                          << cooling_device;
-                throttling_level = 0;
-            }
-        }
-
-        cooling_device_path_to_throttling_level_map_[throttling_data.first] = throttling_level;
-
-        // We only want to send throttling notifications whenever a new
-        // throttling level is reached or if we stop throttling. This first case
-        // is to check if a CPU has been throttled higher than the current max.
-        // This means that we have to notify throttling and set is_throttling to
-        // true. The second case is to check that we are no longer throttling.
-        // Meaning that we notify throttling and set is_throttling to false.
-        if (max_throttling_level < throttling_level) {
-            *notify_params = std::make_pair(true, temp);
-            return true;
-        } else if (max_throttling_level != 0 && getMaxThrottlingLevelFromMap() == 0) {
-            *notify_params = std::make_pair(false, temp);
-            return true;
-        }
-    }
-
-    return false;
-}
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
diff --git a/thermal/thermal-helper.h b/thermal/thermal-helper.h
deleted file mode 100644
index d641cba..0000000
--- a/thermal/thermal-helper.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifndef __THERMAL_HELPER_H__
-#define __THERMAL_HELPER_H__
-
-#include <list>
-#include <string>
-#include <unordered_map>
-#include <vector>
-
-#include <fnmatch.h>
-#include <ftw.h>
-
-#include <android/hardware/thermal/1.0/IThermal.h>
-#include "utils/cooling_devices.h"
-#include "utils/sensors.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-using ::android::hardware::hidl_vec;
-using ::android::hardware::thermal::V1_0::CpuUsage;
-using ::android::hardware::thermal::V1_0::Temperature;
-using ::android::hardware::thermal::V1_0::TemperatureType;
-
-constexpr char kSkinSensorType[] = "mb-therm-adc";
-
-struct SensorInfo {
-    TemperatureType type;
-    bool is_override;
-    float throttling;
-    float shutdown;
-    float multiplier;
-};
-
-struct ThrottlingThresholds {
-    ThrottlingThresholds() : cpu(NAN), gpu(NAN), ss(NAN), battery(NAN) {}
-    float cpu;
-    float gpu;
-    float ss;
-    float battery;
-};
-
-class ThermalHelper {
-  public:
-    ThermalHelper();
-    ~ThermalHelper() = default;
-
-    bool fillTemperatures(hidl_vec<Temperature> *temperatures);
-    bool fillCpuUsages(hidl_vec<CpuUsage> *cpu_usages);
-
-    // Dissallow copy and assign.
-    ThermalHelper(const ThermalHelper &) = delete;
-    void operator=(const ThermalHelper &) = delete;
-
-    bool isInitializedOk() const { return is_initialized_; }
-
-    // Checks the throttling data after seeing a modification. This function
-    // will store the new throttling number into the throttling level map, decide
-    // whether we should notify for throttling, and set the is_throttling and
-    // temperature params used to call notifyThrottling(). Returns true if we
-    // need to notify for throttling and sets the notify params accordingly. If
-    // not the function returns false and leaves notify_params untouched.
-    bool checkThrottlingData(const std::pair<std::string, std::string> &throttling_data,
-                             std::pair<bool, Temperature> *notify_params);
-
-    // Returns a vector of all cooling devices that has been found on the
-    // device.
-    std::vector<std::string> getCoolingDevicePaths();
-
-    // Read the temperature of a single sensor.
-    bool readTemperature(const std::string &sensor_name, Temperature *out) const;
-
-    // Read the value of a single cooling device.
-    bool readCoolingDevice(const std::string &cooling_device, int *data) const;
-
-    const std::map<std::string, std::string> &getValidCoolingDeviceMap() const;
-
-  private:
-    bool initializeSensorMap();
-    bool initializeCoolingDevices();
-
-    // Read the throttling levels from
-    // cooling_device_path_to_throttling_level_map_ and return the maximum level
-    // of throttling.
-    int getMaxThrottlingLevelFromMap() const;
-
-    // Update setting not in thermal config
-    void updateOverideThresholds();
-
-    Sensors thermal_sensors_;
-    CoolingDevices cooling_devices_;
-
-    std::unordered_map<std::string, int> cooling_device_path_to_throttling_level_map_;
-    ThrottlingThresholds thresholds_;
-    ThrottlingThresholds vr_thresholds_;
-    ThrottlingThresholds shutdown_thresholds_;
-    const bool is_initialized_;
-};
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
-
-#endif  // __THERMAL_HELPER_H__
diff --git a/thermal/utils/ThermalConfigParser.cpp b/thermal/utils/ThermalConfigParser.cpp
deleted file mode 100644
index f5e6a9c..0000000
--- a/thermal/utils/ThermalConfigParser.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * 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.
- */
-
-#include <regex>
-#include <vector>
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/properties.h>
-#include <android-base/stringprintf.h>
-
-#include "ThermalConfigParser.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-constexpr float kConfigMultiplier = .001;
-
-// For now this just defines the sensor name and thresholds.
-struct SensorConfig {
-    SensorConfig() : sensor_name(""), threshold(0.0), action(""),
-        rule_name("") {}
-    SensorConfig(
-        const std::string& sensor_name, float threshold,
-        const std::string& action, const std::string& rule_name)
-            : sensor_name(sensor_name),
-              threshold(threshold),
-              action(action),
-              rule_name(rule_name) {}
-    std::string sensor_name;
-    float threshold;
-    std::string action;
-    std::string rule_name;
-};
-
-// Assign out if out == NAN or config_threshold < out.
-static void checkAndAssignThreshold(float config_threshold, float* out) {
-    if (std::isnan(*out) || config_threshold < *out) {
-        *out = config_threshold;
-    }
-}
-
-static void assignThresholdsFromConfig(
-    const std::vector<SensorConfig>& configs,
-    const std::map<std::string, SensorInfo>& sensor_name_type_map,
-    ThrottlingThresholds* threshold) {
-    for (const SensorConfig& config : configs) {
-        switch (sensor_name_type_map.at(config.sensor_name).type) {
-            case TemperatureType::CPU:
-                checkAndAssignThreshold(config.threshold, &threshold->cpu);
-                break;
-            case TemperatureType::GPU:
-                checkAndAssignThreshold(config.threshold, &threshold->gpu);
-                break;
-            case TemperatureType::BATTERY:
-                checkAndAssignThreshold(config.threshold, &threshold->battery);
-                break;
-            case TemperatureType::SKIN:
-                // For the skin throttling threshold take the min value from
-                // the skin-monitor rule.
-                if (config.rule_name == "SKIN-MONITOR") {
-                    checkAndAssignThreshold(config.threshold, &threshold->ss);
-                }
-                break;
-            default:
-                LOG(ERROR) << "Unknown sensor: " << config.sensor_name;
-                break;
-        }
-    }
-}
-
-static void parseThermalEngineConfig(
-        const std::string& config_path, std::vector<SensorConfig>* configs,
-        std::vector<SensorConfig>* shutdown_configs) {
-    std::string data;
-    if (!android::base::ReadFileToString(config_path, &data)) {
-        LOG(ERROR) << "Error reading config path: " << config_path;
-        return;
-    }
-
-    // Parse out sensor name and thresholds for ss configs.
-    static const std::regex ss_block_regex(
-        R"([.\n]*\[(.+)\]\nalgo_type\s+ss\n(?:.*\n)?sensor\s+)"
-        R"(([\w\d-]+)\n(?:.*\n)?set_point\s+(\d+))");
-    auto block_begin = std::sregex_iterator(
-        data.begin(), data.end(), ss_block_regex);
-    auto block_end = std::sregex_iterator();
-    for (std::sregex_iterator itr = block_begin; itr != block_end; ++itr) {
-        configs->emplace_back(
-            SensorConfig(
-                itr->str(2), std::stoi(itr->str(3)) * kConfigMultiplier, "",
-		itr->str(1)));
-    }
-
-    // Parse out sensor name, thresholds, and action for monitor configs.
-    static const std::regex monitor_block_regex(
-        R"([.\n]*\[(.+)\]\nalgo_type\s+monitor\n(?:.*\n)?sensor\s+)"
-        R"(([\w\d-]+)\n(?:.*\n)?thresholds\s+([^\n]+)\n(?:.*\n)?actions\s+([^\n]+))");
-    block_begin = std::sregex_iterator(
-        data.begin(), data.end(), monitor_block_regex);
-    for (std::sregex_iterator itr = block_begin; itr != block_end; ++itr) {
-        SensorConfig sensor_config;
-
-        sensor_config.rule_name = itr->str(1);
-        sensor_config.sensor_name = itr->str(2);
-        std::string thresholds_str = itr->str(3);
-        std::string actions_str = itr->str(4);
-
-        static const std::regex delim_regex{R"(\s+)"};
-        std::vector<std::string> thresholds{
-            std::sregex_token_iterator(thresholds_str.begin(), thresholds_str.end(), delim_regex, -1),
-                    std::sregex_token_iterator()
-                    };
-        std::vector<std::string> actions{
-            std::sregex_token_iterator(actions_str.begin(), actions_str.end(), delim_regex, -1),
-                    std::sregex_token_iterator()
-                    };
-
-        if (thresholds.size() != actions.size()) {
-            LOG(ERROR) << "Unbalanced thresholds ("
-                       << thresholds.size()
-                       << ") and actions ("
-                       << actions.size() << ") in monitor algo for sensor ("
-                       << sensor_config.sensor_name
-                       << ") of rule (" << sensor_config.rule_name << ")";
-            return;
-        }
-
-        for (std::size_t i = 0; i < thresholds.size(); ++i) {
-            sensor_config.threshold = std::stoi(thresholds[i]) * kConfigMultiplier;
-            sensor_config.action = actions[i];
-
-            // Filter out the shutdown thresholds.
-            if (sensor_config.action.find("shutdown") != std::string::npos)  {
-                shutdown_configs->push_back(sensor_config);
-            } else {
-                configs->push_back(sensor_config);
-            }
-        }
-    }
-}
-
-static void dumpSensorConfigs(
-    const std::vector<SensorConfig>& sensor_config_vec,
-    const std::map<std::string, SensorInfo>& typeMap) {
-    for (const auto& sensor_config : sensor_config_vec) {
-        LOG(INFO) << "Sensor name: " << sensor_config.sensor_name
-                  << " type: " << android::hardware::thermal::V1_0::toString(
-                      typeMap.at(sensor_config.sensor_name).type)
-                  << " with threshold: " << sensor_config.threshold
-                  << " from rule: " << sensor_config.rule_name
-                  << sensor_config.action.empty() ? ""
-                : " sensor config action " + sensor_config.action;
-    }
-}
-
-void InitializeThresholdsFromThermalConfig(
-    const std::string& thermal_config,
-    const std::string& vr_thermal_config,
-    const std::map<std::string, SensorInfo>& typeMap,
-    ThrottlingThresholds *thresholds,
-    ThrottlingThresholds *shutdown_thresholds,
-    ThrottlingThresholds *vr_thresholds) {
-    // For now just read the sargo configs but it would be easy to make this
-    // platform specific.
-    std::vector<SensorConfig> sensor_configs;
-    std::vector<SensorConfig> shutdown_configs;
-    parseThermalEngineConfig(
-        thermal_config, &sensor_configs, &shutdown_configs);
-
-    assignThresholdsFromConfig(sensor_configs, typeMap, thresholds);
-    assignThresholdsFromConfig(shutdown_configs, typeMap, shutdown_thresholds);
-
-    LOG(INFO) << "Sensor configs";
-    dumpSensorConfigs(sensor_configs, typeMap);
-    LOG(INFO) << "Shutdown configs";
-    dumpSensorConfigs(shutdown_configs, typeMap);
-
-    sensor_configs.clear();
-    shutdown_configs.clear();
-    parseThermalEngineConfig(
-        vr_thermal_config, &sensor_configs, &shutdown_configs);
-
-    LOG(INFO) << "VR Sensor configs";
-    dumpSensorConfigs(sensor_configs, typeMap);
-    LOG(INFO) << "VR Shutdown configs";
-    dumpSensorConfigs(shutdown_configs, typeMap);
-
-    assignThresholdsFromConfig(
-        sensor_configs, typeMap, vr_thresholds);
-}
-
-}  // namespace implementation
-}  // namespace V1_0
-}  // namespace thermal
-}  // namespace hardware
-}  // nmamespace android
diff --git a/thermal/utils/ThermalConfigParser.h b/thermal/utils/ThermalConfigParser.h
deleted file mode 100644
index cfe0bf9..0000000
--- a/thermal/utils/ThermalConfigParser.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __THERMAL_CONFIG_PARSER_H__
-#define __THERMAL_CONFIG_PARSER_H__
-
-#include "thermal-helper.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-void InitializeThresholdsFromThermalConfig(
-    const std::string& thermal_config,
-    const std::string& vr_thermal_config,
-    const std::map<std::string, SensorInfo>& typeMap,
-    ThrottlingThresholds *thresholds,
-    ThrottlingThresholds *shutdown_thresholds,
-    ThrottlingThresholds *vr_thresholds);
-
-}  // namespace implementation
-}  // namespace V1_0
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
-
-#endif
diff --git a/thermal/utils/cooling_devices.cpp b/thermal/utils/cooling_devices.cpp
deleted file mode 100644
index 4f23beb..0000000
--- a/thermal/utils/cooling_devices.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-#include <fstream>
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/stringprintf.h>
-#include <android-base/strings.h>
-
-#include "cooling_devices.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-constexpr char kCoolingDeviceCurStateSuffix[] = "cur_state";
-
-bool CoolingDevices::addCoolingDevice(
-        const std::string& cooling_device_name, const std::string& path) {
-    return cooling_device_name_to_path_map_.emplace(
-        cooling_device_name, path).second;
-}
-
-bool CoolingDevices::getCoolingDeviceState(
-        const std::string& cooling_device_name, int* data) const {
-    auto cooling_device_itr = cooling_device_name_to_path_map_.find(
-        cooling_device_name);
-    if (cooling_device_itr == cooling_device_name_to_path_map_.end()) {
-        return false;
-    }
-
-    std::string path = android::base::StringPrintf(
-        "%s/%s", cooling_device_itr->second.c_str(),
-        kCoolingDeviceCurStateSuffix);
-
-    std::string cooling_device_data;
-    android::base::ReadFileToString(path, &cooling_device_data);
-    cooling_device_data = android::base::Trim(cooling_device_data);
-
-    if (cooling_device_data.empty()) {
-        LOG(ERROR) << "Could not read "
-                   << getCoolingDevicePath(cooling_device_name);
-        return false;
-    }
-
-    *data = std::stoi(cooling_device_data);
-    return true;
-}
-
-std::string CoolingDevices::getCoolingDevicePath(
-        const std::string& cooling_device_name) const {
-    auto cooling_device_itr = cooling_device_name_to_path_map_.find(
-        cooling_device_name);
-    if (cooling_device_itr == cooling_device_name_to_path_map_.end()) {
-        return "";
-    }
-    return cooling_device_itr->second;
-}
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
diff --git a/thermal/utils/cooling_devices.h b/thermal/utils/cooling_devices.h
deleted file mode 100644
index 2fdbdee..0000000
--- a/thermal/utils/cooling_devices.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __COOLING_DEVICES_H__
-#define __COOLING_DEVICES_H__
-
-#include <unordered_map>
-#include <string>
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-class CoolingDevices {
-    public:
-     CoolingDevices() = default;
-     ~CoolingDevices() = default;
-     CoolingDevices(const CoolingDevices&) = delete;
-     void operator=(const CoolingDevices&) = delete;
-
-     // Keep track of the cooling device given the path to its directory.
-     // The cooling device names are defined in: thermal-helper.cpp in
-     // kValidCoolingDeviceNameTypeMap.  Path is the cooling device directory.
-     // This is something like: /sys/devices/virtual/thermal/cooling_device_X.
-     // This function assumes that the top level directory at least has a
-     // cur_state file in it, which represents the current state of the cooling
-     // device. Returns true if add succeeds.  False otherwise.
-     bool addCoolingDevice(const std::string& cooling_device_name,
-                           const std::string& path);
-
-     // If the cooling device name is in the map this will read the cur_state
-     // file within the directory, fill in the data param with the contents of
-     // that file, and return true.  Else it will return false and leave data
-     // untouched.
-     bool getCoolingDeviceState(const std::string& cooling_device_name,
-                                int* data) const;
-
-     // Get the file path given the cooling device name. If the cooling device
-     // name has not been added to CoolingDevices, this will return an empty
-     // string.
-     std::string getCoolingDevicePath(
-         const std::string& cooling_device_name) const;
-
-     size_t getNumCoolingDevices() const {
-         return cooling_device_name_to_path_map_.size();
-     }
-
-    private:
-     std::unordered_map<std::string, std::string>
-         cooling_device_name_to_path_map_;
-};
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
-
-#endif  // __COOLING_DEVICES_H__
-
diff --git a/thermal/utils/device_file_watcher.cpp b/thermal/utils/device_file_watcher.cpp
deleted file mode 100644
index 49a6451..0000000
--- a/thermal/utils/device_file_watcher.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.
- */
-#include <chrono>
-#include <dirent.h>
-#include <fstream>
-#include <sys/inotify.h>
-#include <sys/resource.h>
-#include <sys/types.h>
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/strings.h>
-
-#include "device_file_watcher.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-using std::chrono_literals::operator""ms;
-
-// iNotify constants.
-constexpr int kiNotifyEventSize = sizeof(struct inotify_event);
-
-void DeviceFileWatcher::registerFilesToWatch(
-        const std::vector<std::string> files_to_watch) {
-    inotify_fd_ = unique_fd(inotify_init());
-    if (inotify_fd_ < 0) {
-        LOG(ERROR) << "iNotify init error.";
-        return;
-    }
-
-    for (const auto& path : files_to_watch) {
-        std::lock_guard<std::mutex> _lock(watcher_mutex_);
-        watch_to_file_path_map_.emplace(
-            inotify_add_watch(inotify_fd_, path.c_str(), IN_MODIFY),
-            path);
-    }
-}
-
-bool DeviceFileWatcher::startWatchingDeviceFiles() {
-    if (initializedOk()) {
-        // Start the watcher thread.
-        std::packaged_task<void(void)> watcher_task(
-            std::bind(&DeviceFileWatcher::watchFilesForModificationsAndCallback,
-                      this));
-        watcher_future_ = watcher_task.get_future();
-        watcher_thread_ = std::thread(std::move(watcher_task));
-        watcher_thread_.detach();
-        return true;
-    }
-    return false;
-}
-
-void DeviceFileWatcher::registerCallback(
-        std::function<void(const std::pair<std::string, std::string>&)> cb) {
-    std::lock_guard<std::mutex> _lock(watcher_mutex_);
-    cb_ = cb;
-}
-
-void DeviceFileWatcher::registerQueueOverflowCallback(
-        std::function<void(void)> cb) {
-    std::lock_guard<std::mutex> _lock(watcher_mutex_);
-    queue_overflow_cb_ = cb;
-}
-
-void DeviceFileWatcher::watchFilesForModificationsAndCallback() {
-    // Increase the priority of the watcher thread so we minimize losing
-    // data.
-    if (int errval = setpriority(PRIO_PROCESS, 0, -5)) {
-        LOG(ERROR) << "Failed to setpriority the watcher thread: " << errval;
-    }
-
-    // We use this while(1) because inotify read() blocks, thus stopping the
-    // watcher thread from just spinning.
-    while (initializedOk()) {
-        char buffer[kiNotifyEventSize];
-        TEMP_FAILURE_RETRY(read(inotify_fd_, buffer, sizeof(buffer)));
-        struct inotify_event* event;
-        event = reinterpret_cast<struct inotify_event*>(buffer);
-
-        // Catch the case where we overflow the queue. In this case we probably
-        // dropped some modifications so we re-read everything and re-notify.
-        if (event->mask & IN_Q_OVERFLOW) {
-            LOG(ERROR) << "iNotify queue overflowed! Modification events "
-                       << "dropped.";
-            {
-                std::lock_guard<std::mutex> _lock(watcher_mutex_);
-                if (queue_overflow_cb_) {
-                    queue_overflow_cb_();
-                }
-            }
-        }
-
-        if (event->mask & IN_MODIFY) {
-            std::lock_guard<std::mutex> _lock(watcher_mutex_);
-            std::string path = watch_to_file_path_map_.at(event->wd);
-
-            std::string data;
-            android::base::ReadFileToString(path, &data);
-            data = android::base::Trim(data);
-
-            if (!data.empty()) {
-                if (cb_) {
-                    cb_(std::make_pair(path, data));
-                } else {
-                    LOG(ERROR) << "Consumer callback is null!";
-                }
-            }
-        }
-
-        // Rate limit our thread to be able to service changes at around a
-        // second. We don't want to make the system do more work if things fall
-        // off a cliff. We are watching eight files, one per CPU, so 125
-        // milliseconds should be such that if all of them had a modification at
-        // the same time it would take the thread a second to read all of them.
-        std::this_thread::sleep_for(125ms);
-    }
-
-    // We should really not get here until DeviceFileWatcher is destroyed.
-    LOG(ERROR) << "Watcher thread has stopped.";
-}
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
diff --git a/thermal/utils/device_file_watcher.h b/thermal/utils/device_file_watcher.h
deleted file mode 100644
index 402be17..0000000
--- a/thermal/utils/device_file_watcher.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.
- */
-#ifndef __DEVICE_FILE_WATCHER_H__
-#define __DEVICE_FILE_WATCHER_H__
-
-#include <chrono>
-#include <condition_variable>
-#include <future>
-#include <list>
-#include <mutex>
-#include <string>
-#include <thread>
-#include <vector>
-
-#include <android-base/unique_fd.h>
-
-#include "cooling_devices.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-using android::base::unique_fd;
-using std::chrono_literals::operator""ms;
-using WatcherCallback =
-    std::function<void(const std::pair<std::string, std::string>&)>;
-
-/* A helper class to watch modifications to files. */
-class DeviceFileWatcher {
-    public:
-     DeviceFileWatcher() = default;
-     ~DeviceFileWatcher() = default;
-
-     // Disallow copy and assign.
-     DeviceFileWatcher(const DeviceFileWatcher&) = delete;
-     void operator=(const DeviceFileWatcher&) = delete;
-
-     // Start the thread and return true if it succeeds. This function will
-     // check that there are files registered to watch and that there is a
-     // callback registered. If either conditions are not met this function will
-     // return false.
-     bool startWatchingDeviceFiles();
-     // Give the file watcher a list of files to start watching. This helper
-     // class will by default wait for modifications to the file.
-     void registerFilesToWatch(const std::vector<std::string> files_to_watch);
-     // Give the file watcher a callback to be called when processing the data
-     // read from the watched changes list.
-     void registerCallback(std::function<void(
-         const std::pair<std::string, std::string>&)> cb);
-     // Register a function called back if we see a queue overflow event from
-     // inotify.
-     void registerQueueOverflowCallback(std::function<void(void)> cb);
-     // This class is properly initialized if there is a callback that's
-     // registered and if we have files to watch.
-     bool initializedOk() const {
-       return watch_to_file_path_map_.size() && cb_;
-     }
-
-     // Get the status of the threads.  watcher_future_ can be invalid here, if
-     // we call getWatcherThreadStatus() without first calling
-     // startWatchingDeviceFiles(). In the case that we haven't spawned any
-     // threads, we'll just return std::future_status::ready which indicates
-     // that the thread is no longer running.
-     std::future_status getWatcherThreadStatus() const {
-        return watcher_future_.valid() ?
-            watcher_future_.wait_for(0ms) : std::future_status::ready;
-     }
-
-    private:
-     // The work done by the watcher thread. This will use inotify to check for
-     // modifications to the files to watch. If any modification is seen this
-     // will callback the registered function with the new data read from the
-     // modified file.
-     void watchFilesForModificationsAndCallback();
-
-     unique_fd inotify_fd_;
-     // Maps iNotify watch descriptor to cooling device state file path.
-     std::unordered_map<int, std::string> watch_to_file_path_map_;
-
-     // This thread watches the files for modifications and fills out the values
-     // buffer.
-     std::thread watcher_thread_;
-     std::future<void> watcher_future_;
-
-     // The callback function. Called whenever a modification is seen.  The
-     // function passed in should expect a pair of strings in the form
-     // (path, data). Where path is the path of the file that saw a modification
-     // and data was the modification.
-     WatcherCallback cb_;
-
-     // A callback function to use if we ever see the queue overflow. This is
-     // not required to start watching files. However, if no callback is
-     // registered and we see the queue overflow we will just log that
-     // modification events were dropped and do nothing.
-     std::function<void(void)> queue_overflow_cb_;
-
-     // Variables shared between the watcher and consumer threads.
-     std::mutex watcher_mutex_;
-};
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
-
-#endif  // __DEVICE_FILE_WATCHER_H__
diff --git a/thermal/utils/sensors.cpp b/thermal/utils/sensors.cpp
deleted file mode 100644
index d9661d3..0000000
--- a/thermal/utils/sensors.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-
-#include <algorithm>
-
-#include <android-base/file.h>
-#include <android-base/strings.h>
-#include "sensors.h"
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-std::string Sensors::getSensorPath(const std::string& sensor_name) {
-    if (sensor_names_to_path_map_.find(sensor_name) !=
-            sensor_names_to_path_map_.end()) {
-        return sensor_names_to_path_map_.at(sensor_name);
-    }
-    return "";
-}
-
-bool Sensors::addSensor(
-        const std::string& sensor_name, const std::string& path) {
-    return sensor_names_to_path_map_.emplace(sensor_name, path).second;
-}
-
-bool Sensors::readSensorFile(
-        const std::string& sensor_name, std::string* data,
-        std::string* file_path) const {
-    std::string sensor_reading;
-    if (sensor_names_to_path_map_.find(sensor_name) ==
-            sensor_names_to_path_map_.end()) {
-        *data = "";
-        *file_path = "";
-        return false;
-    }
-
-    android::base::ReadFileToString(
-        sensor_names_to_path_map_.at(sensor_name), &sensor_reading);
-    // Strip the newline.
-    *data = ::android::base::Trim(sensor_reading);
-    *file_path = sensor_names_to_path_map_.at(sensor_name);
-    return true;
-}
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
diff --git a/thermal/utils/sensors.h b/thermal/utils/sensors.h
deleted file mode 100644
index 1d94b40..0000000
--- a/thermal/utils/sensors.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __SENSORS_H__
-#define __SENSORS_H__
-
-#include <string>
-#include <unordered_map>
-
-namespace android {
-namespace hardware {
-namespace thermal {
-namespace V1_1 {
-namespace implementation {
-
-class Sensors {
-    public:
-     Sensors() = default;
-     ~Sensors() = default;
-     Sensors(const Sensors&) = delete;
-     void operator=(const Sensors&) = delete;
-
-     std::string getSensorPath(const std::string& sensor_name);
-     // Returns true if add was successful, false otherwise.
-     bool addSensor(const std::string& sensor_name, const std::string& path);
-     // If sensor is not found in the sensor names to path map, this will set
-     // data and file path to empty and return false.  If the sensor is found,
-     // this function will fill in data and file_path accordingly then return
-     // true.
-     bool readSensorFile(
-         const std::string& sensor_name, std::string* data,
-         std::string* file_path) const;
-     size_t getNumSensors() const { return sensor_names_to_path_map_.size(); }
-
-    private:
-     std::unordered_map<std::string, std::string> sensor_names_to_path_map_;
-};
-
-}  // namespace implementation
-}  // namespace V1_1
-}  // namespace thermal
-}  // namespace hardware
-}  // namespace android
-
-#endif  // __SENSORS_H__
-
diff --git a/thermal_info_config_bonito.json b/thermal_info_config_bonito.json
new file mode 100644
index 0000000..d630af4
--- /dev/null
+++ b/thermal_info_config_bonito.json
@@ -0,0 +1,237 @@
+{
+    "Sensors":[
+        {
+            "Name":"cpu0-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu1-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu2-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu3-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu4-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu5-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu0-gold-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu1-gold-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"gpu0-usr",
+            "Type":"GPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"gpu1-usr",
+            "Type":"GPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"battery",
+            "Type":"BATTERY",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                60.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"usbc-therm-monitor",
+            "Type":"USB_PORT",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "63.0",
+                "NAN"
+            ],
+            "HotHysteresis":[
+                0.0,
+                0.0,
+                0.0,
+                0.0,
+                0.0,
+                5.0,
+                0.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001,
+            "Monitor":true
+        },
+        {
+            "Name":"mb-therm-monitor",
+            "Type":"SKIN",
+            "HotThreshold":[
+                "NAN",
+                39.0,
+                43.0,
+                48.0,
+                50.0,
+                54.0,
+                58.0
+            ],
+            "HotHysteresis":[
+                0.0,
+                0.9,
+                0.9,
+                0.9,
+                0.9,
+                0.9,
+                0.9
+            ],
+            "VrThreshold":53.0,
+            "Multiplier":0.001,
+            "Monitor":true
+        }
+    ],
+    "CoolingDevices":[
+        {
+            "Name":"thermal-cpufreq-0",
+            "Type":"CPU"
+        },
+        {
+            "Name":"thermal-cpufreq-6",
+            "Type":"CPU"
+        },
+        {
+            "Name":"thermal-devfreq-0",
+            "Type":"GPU"
+        },
+        {
+            "Name":"battery",
+            "Type":"BATTERY"
+        }
+    ]
+}
diff --git a/thermal_info_config_sargo.json b/thermal_info_config_sargo.json
new file mode 100644
index 0000000..af208cb
--- /dev/null
+++ b/thermal_info_config_sargo.json
@@ -0,0 +1,237 @@
+{
+    "Sensors":[
+        {
+            "Name":"cpu0-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu1-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu2-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu3-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu4-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu5-silver-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu0-gold-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"cpu1-gold-usr",
+            "Type":"CPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"gpu0-usr",
+            "Type":"GPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"gpu1-usr",
+            "Type":"GPU",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                95.0,
+                "NAN",
+                "NAN",
+                125.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"battery",
+            "Type":"BATTERY",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                60.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001
+        },
+        {
+            "Name":"usbc-therm-monitor",
+            "Type":"USB_PORT",
+            "HotThreshold":[
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "NAN",
+                "63.0",
+                "NAN"
+            ],
+            "HotHysteresis":[
+                0.0,
+                0.0,
+                0.0,
+                0.0,
+                0.0,
+                5.0,
+                0.0
+            ],
+            "VrThreshold":"NAN",
+            "Multiplier":0.001,
+            "Monitor":true
+        },
+        {
+            "Name":"mb-therm-monitor",
+            "Type":"SKIN",
+            "HotThreshold":[
+                "NAN",
+                39.0,
+                43.0,
+                46.0,
+                47.0,
+                51.0,
+                55.0
+            ],
+            "HotHysteresis":[
+                0.0,
+                0.9,
+                0.9,
+                0.9,
+                0.9,
+                0.9,
+                0.9
+            ],
+            "VrThreshold":51.0,
+            "Multiplier":0.001,
+            "Monitor":true
+        }
+    ],
+    "CoolingDevices":[
+        {
+            "Name":"thermal-cpufreq-0",
+            "Type":"CPU"
+        },
+        {
+            "Name":"thermal-cpufreq-6",
+            "Type":"CPU"
+        },
+        {
+            "Name":"thermal-devfreq-0",
+            "Type":"GPU"
+        },
+        {
+            "Name":"battery",
+            "Type":"BATTERY"
+        }
+    ]
+}
diff --git a/ueventd.hardware.rc b/ueventd.hardware.rc
index c60ceb7..657f22a 100644
--- a/ueventd.hardware.rc
+++ b/ueventd.hardware.rc
@@ -64,6 +64,7 @@
 /dev/msm_amrwb            0660   system     audio
 /dev/msm_amrwbplus        0660   system     audio
 /dev/msm_aac              0660   system     audio
+/dev/msm_mp3*             0660   system     audio
 /dev/msm_multi_aac        0660   system     audio
 /dev/msm_aac_in           0660   system     audio
 /dev/msm_qcelp_in         0660   system     audio
@@ -93,6 +94,7 @@
 /dev/hbtp_vm              0660   system     system
 
 # BT
+/dev/ttyMSM0              0600   bluetooth  bluetooth
 /dev/ttyHS0               0660   bluetooth  net_bt
 /dev/btpower              0660   bluetooth  net_bt
 
diff --git a/vibrator/Vibrator.cpp b/vibrator/Vibrator.cpp
index 4cca814..509d739 100644
--- a/vibrator/Vibrator.cpp
+++ b/vibrator/Vibrator.cpp
@@ -18,17 +18,16 @@
 
 #include <log/log.h>
 
+#include <cutils/properties.h>
 #include <hardware/hardware.h>
 #include <hardware/vibrator.h>
-#include <cutils/properties.h>
 
 #include "Vibrator.h"
 
 #include <cinttypes>
 #include <cmath>
-#include <iostream>
 #include <fstream>
-
+#include <iostream>
 
 namespace android {
 namespace hardware {
@@ -68,70 +67,51 @@
 using Status = ::android::hardware::vibrator::V1_0::Status;
 using EffectStrength = ::android::hardware::vibrator::V1_0::EffectStrength;
 
-Vibrator::Vibrator(std::ofstream&& activate, std::ofstream&& duration,
-        std::ofstream&& state, std::ofstream&& rtpinput,
-        std::ofstream&& mode, std::ofstream&& sequencer,
-        std::ofstream&& scale, std::ofstream&& ctrlloop, std::ofstream&& lptrigger,
-        std::ofstream&& lrawaveshape, std::ofstream&& odclamp, std::ofstream&& ollraperiod,
-        std::uint32_t short_lra_period, std::uint32_t long_lra_period) :
-    mActivate(std::move(activate)),
-    mDuration(std::move(duration)),
-    mState(std::move(state)),
-    mRtpInput(std::move(rtpinput)),
-    mMode(std::move(mode)),
-    mSequencer(std::move(sequencer)),
-    mScale(std::move(scale)),
-    mCtrlLoop(std::move(ctrlloop)),
-    mLpTriggerEffect(std::move(lptrigger)),
-    mLraWaveShape(std::move(lrawaveshape)),
-    mOdClamp(std::move(odclamp)),
-    mOlLraPeriod(std::move(ollraperiod)),
-    mShortLraPeriod(short_lra_period),
-    mLongLraPeriod(long_lra_period) {
-
+Vibrator::Vibrator(HwApi &&hwapi, std::uint32_t short_lra_period, std::uint32_t long_lra_period)
+    : mHwApi(std::move(hwapi)), mShortLraPeriod(short_lra_period), mLongLraPeriod(long_lra_period) {
     mClickDuration = property_get_int32("ro.vibrator.hal.click.duration", WAVEFORM_CLICK_EFFECT_MS);
     mTickDuration = property_get_int32("ro.vibrator.hal.tick.duration", WAVEFORM_TICK_EFFECT_MS);
-    mHeavyClickDuration = property_get_int32(
-        "ro.vibrator.hal.heavyclick.duration", WAVEFORM_HEAVY_CLICK_EFFECT_MS);
+    mHeavyClickDuration =
+        property_get_int32("ro.vibrator.hal.heavyclick.duration", WAVEFORM_HEAVY_CLICK_EFFECT_MS);
     mShortVoltageMax = property_get_int32("ro.vibrator.hal.short.voltage", VOLTAGE_MAX);
     mLongVoltageMax = property_get_int32("ro.vibrator.hal.long.voltage", VOLTAGE_MAX);
 
     // This enables effect #1 from the waveform library to be triggered by SLPI
     // while the AP is in suspend mode
-    mLpTriggerEffect << 1 << std::endl;
-    if (!mLpTriggerEffect) {
+    mHwApi.lpTriggerEffect << 1 << std::endl;
+    if (!mHwApi.lpTriggerEffect) {
         ALOGW("Failed to set LP trigger mode (%d): %s", errno, strerror(errno));
     }
 }
 
 Return<Status> Vibrator::on(uint32_t timeoutMs, bool isWaveform) {
     // Bonito / Sargo only support open-loop mode
-    mCtrlLoop << LOOP_MODE_OPEN << std::endl;
-    mDuration << timeoutMs << std::endl;
-    if (!mDuration) {
+    mHwApi.ctrlLoop << LOOP_MODE_OPEN << std::endl;
+    mHwApi.duration << timeoutMs << std::endl;
+    if (!mHwApi.duration) {
         ALOGE("Failed to set duration (%d): %s", errno, strerror(errno));
         return Status::UNKNOWN_ERROR;
     }
 
     if (isWaveform) {
-        mMode << WAVEFORM_MODE << std::endl;
-        mLraWaveShape << SINE_WAVE << std::endl;
-        mOdClamp << mShortVoltageMax << std::endl;
-        mOlLraPeriod << mShortLraPeriod << std::endl;
+        mHwApi.mode << WAVEFORM_MODE << std::endl;
+        mHwApi.lraWaveShape << SINE_WAVE << std::endl;
+        mHwApi.odClamp << mShortVoltageMax << std::endl;
+        mHwApi.olLraPeriod << mShortLraPeriod << std::endl;
     } else {
-        mMode << RTP_MODE << std::endl;
-        mLraWaveShape << SQUARE_WAVE << std::endl;
-        mOdClamp << mLongVoltageMax << std::endl;
-        mOlLraPeriod << mLongLraPeriod << std::endl;
+        mHwApi.mode << RTP_MODE << std::endl;
+        mHwApi.lraWaveShape << SQUARE_WAVE << std::endl;
+        mHwApi.odClamp << mLongVoltageMax << std::endl;
+        mHwApi.olLraPeriod << mLongLraPeriod << std::endl;
     }
 
-    mActivate << 1 << std::endl;
-    if (!mActivate) {
+    mHwApi.activate << 1 << std::endl;
+    if (!mHwApi.activate) {
         ALOGE("Failed to activate (%d): %s", errno, strerror(errno));
         return Status::UNKNOWN_ERROR;
     }
 
-   return Status::OK;
+    return Status::OK;
 }
 
 // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
@@ -140,30 +120,28 @@
 }
 
 Return<Status> Vibrator::off()  {
-    mActivate << 0 << std::endl;
-    if (!mActivate) {
+    mHwApi.activate << 0 << std::endl;
+    if (!mHwApi.activate) {
         ALOGE("Failed to turn vibrator off (%d): %s", errno, strerror(errno));
         return Status::UNKNOWN_ERROR;
     }
     return Status::OK;
 }
 
-Return<bool> Vibrator::supportsAmplitudeControl()  {
-    return (mRtpInput ? true : false);
+Return<bool> Vibrator::supportsAmplitudeControl() {
+    return (mHwApi.rtpInput ? true : false);
 }
 
 Return<Status> Vibrator::setAmplitude(uint8_t amplitude) {
-
     if (amplitude == 0) {
         return Status::BAD_VALUE;
     }
 
     int32_t rtp_input =
-            std::round((amplitude - 1) / 254.0 * (MAX_RTP_INPUT - MIN_RTP_INPUT) +
-            MIN_RTP_INPUT);
+        std::round((amplitude - 1) / 254.0 * (MAX_RTP_INPUT - MIN_RTP_INPUT) + MIN_RTP_INPUT);
 
-    mRtpInput << rtp_input << std::endl;
-    if (!mRtpInput) {
+    mHwApi.rtpInput << rtp_input << std::endl;
+    if (!mHwApi.rtpInput) {
         ALOGE("Failed to set amplitude (%d): %s", errno, strerror(errno));
         return Status::UNKNOWN_ERROR;
     }
@@ -175,28 +153,43 @@
     uint8_t scale;
 
     switch (strength) {
-    case EffectStrength::LIGHT:
-        scale = 2; // 50%
-        break;
-    case EffectStrength::MEDIUM:
-    case EffectStrength::STRONG:
-        scale = 0; // 100%
-        break;
+        case EffectStrength::LIGHT:
+            scale = 2;  // 50%
+            break;
+        case EffectStrength::MEDIUM:
+        case EffectStrength::STRONG:
+            scale = 0;  // 100%
+            break;
     }
 
     return scale;
 }
 
 Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
-    return performEffect(static_cast<Effect>(effect), strength, _hidl_cb);
+    return performWrapper(effect, strength, _hidl_cb);
 }
 
 Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength,
-        perform_cb _hidl_cb) {
-    return performEffect(static_cast<Effect>(effect), strength, _hidl_cb);
+                                   perform_cb _hidl_cb) {
+    return performWrapper(effect, strength, _hidl_cb);
 }
 
 Return<void> Vibrator::perform_1_2(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) {
+    auto validEffectRange = hidl_enum_range<T>();
+    if (effect < *validEffectRange.begin() || effect > *std::prev(validEffectRange.end())) {
+        _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
+        return Void();
+    }
+    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);
 }
 
@@ -205,34 +198,33 @@
     uint32_t timeMS;
 
     switch (effect) {
-    case Effect::CLICK:
-        mSequencer << WAVEFORM_CLICK_EFFECT_SEQ << std::endl;
-        timeMS = mClickDuration;
-        break;
-    case Effect::DOUBLE_CLICK:
-        mSequencer << WAVEFORM_DOUBLE_CLICK_EFFECT_SEQ << std::endl;
-        timeMS = WAVEFORM_DOUBLE_CLICK_EFFECT_MS;
-        break;
-    case Effect::TICK:
-        mSequencer << WAVEFORM_TICK_EFFECT_SEQ << std::endl;
-        timeMS = mTickDuration;
-        break;
-    case Effect::HEAVY_CLICK:
-        mSequencer << WAVEFORM_HEAVY_CLICK_EFFECT_SEQ << std::endl;
-        timeMS = mHeavyClickDuration;
-        break;
-    default:
-        _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
-        return Void();
+        case Effect::CLICK:
+            mHwApi.sequencer << WAVEFORM_CLICK_EFFECT_SEQ << std::endl;
+            timeMS = mClickDuration;
+            break;
+        case Effect::DOUBLE_CLICK:
+            mHwApi.sequencer << WAVEFORM_DOUBLE_CLICK_EFFECT_SEQ << std::endl;
+            timeMS = WAVEFORM_DOUBLE_CLICK_EFFECT_MS;
+            break;
+        case Effect::TICK:
+            mHwApi.sequencer << WAVEFORM_TICK_EFFECT_SEQ << std::endl;
+            timeMS = mTickDuration;
+            break;
+        case Effect::HEAVY_CLICK:
+            mHwApi.sequencer << WAVEFORM_HEAVY_CLICK_EFFECT_SEQ << std::endl;
+            timeMS = mHeavyClickDuration;
+            break;
+        default:
+            _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
+            return Void();
     }
-    mScale << convertEffectStrength(strength) << std::endl;
+    mHwApi.scale << convertEffectStrength(strength) << std::endl;
     on(timeMS, true /* isWaveform */);
     _hidl_cb(status, timeMS);
     return Void();
 }
 
-
-} // namespace implementation
+}  // namespace implementation
 }  // namespace V1_2
 }  // namespace vibrator
 }  // namespace hardware
diff --git a/vibrator/Vibrator.h b/vibrator/Vibrator.h
index 105fc08..08635cf 100644
--- a/vibrator/Vibrator.h
+++ b/vibrator/Vibrator.h
@@ -28,43 +28,45 @@
 namespace implementation {
 
 class Vibrator : public IVibrator {
-public:
-    Vibrator(std::ofstream&& activate, std::ofstream&& duration,
-            std::ofstream&& state, std::ofstream&& rtpinput,
-            std::ofstream&& mode, std::ofstream&& sequencer,
-            std::ofstream&& scale, std::ofstream&& ctrlloop, std::ofstream&& lptrigger,
-            std::ofstream&& lrawaveshape, std::ofstream&& odclamp, std::ofstream&& ollraperiod,
-            std::uint32_t short_lra_period, std::uint32_t long_lra_period);
+  public:
+    typedef struct {
+        std::ofstream activate;
+        std::ofstream ctrlLoop;
+        std::ofstream duration;
+        std::ofstream lpTriggerEffect;
+        std::ofstream lraWaveShape;
+        std::ofstream mode;
+        std::ofstream odClamp;
+        std::ofstream olLraPeriod;
+        std::ofstream rtpInput;
+        std::ofstream scale;
+        std::ofstream sequencer;
+        std::ofstream state;
+    } HwApi;
+
+  public:
+    Vibrator(HwApi &&hwapi, std::uint32_t short_lra_period, std::uint32_t long_lra_period);
 
     // 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<Status> on(uint32_t timeoutMs) override;
+    Return<Status> off() override;
     Return<bool> supportsAmplitudeControl() override;
     Return<Status> setAmplitude(uint8_t amplitude) 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(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(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
 
-private:
+  private:
     Return<Status> on(uint32_t timeoutMs, bool isWaveform);
+    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);
-    std::ofstream mActivate;
-    std::ofstream mDuration;
-    std::ofstream mState;
-    std::ofstream mRtpInput;
-    std::ofstream mMode;
-    std::ofstream mSequencer;
-    std::ofstream mScale;
-    std::ofstream mCtrlLoop;
-    std::ofstream mLpTriggerEffect;
-    std::ofstream mLraWaveShape;
-    std::ofstream mOdClamp;
-    std::ofstream mOlLraPeriod;
+    HwApi mHwApi;
     std::uint32_t mShortLraPeriod;
     std::uint32_t mLongLraPeriod;
     int32_t mClickDuration;
diff --git a/vibrator/service.cpp b/vibrator/service.cpp
index c26b630..b090420 100644
--- a/vibrator/service.cpp
+++ b/vibrator/service.cpp
@@ -61,8 +61,7 @@
     return 1000000000 / (24615 * in);
 }
 
-static std::string trim(const std::string& str,
-        const std::string& whitespace = " \t") {
+static 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 "";
@@ -74,31 +73,27 @@
     return str.substr(str_begin, str_range);
 }
 
-static bool loadCalibrationData(std::uint32_t &short_lra_period,
-        std::uint32_t &long_lra_period) {
+static bool loadCalibrationData(std::uint32_t &short_lra_period, std::uint32_t &long_lra_period) {
     std::map<std::string, std::string> config_data;
 
     std::ofstream autocal{AUTOCAL_FILEPATH};
     if (!autocal) {
         int error = errno;
-        ALOGE("Failed to open %s (%d): %s", AUTOCAL_FILEPATH, error,
-                strerror(error));
+        ALOGE("Failed to open %s (%d): %s", AUTOCAL_FILEPATH, error, strerror(error));
         return false;
     }
 
     std::ofstream ol_lra_period{OL_LRA_PERIOD_FILEPATH};
     if (!ol_lra_period) {
         int error = errno;
-        ALOGE("Failed to open %s (%d): %s", OL_LRA_PERIOD_FILEPATH, error,
-                strerror(error));
+        ALOGE("Failed to open %s (%d): %s", OL_LRA_PERIOD_FILEPATH, error, strerror(error));
         return false;
     }
 
     std::ifstream cal_data{CALIBRATION_FILEPATH};
     if (!cal_data) {
         int error = errno;
-        ALOGE("Failed to open %s (%d): %s", CALIBRATION_FILEPATH, error,
-                strerror(error));
+        ALOGE("Failed to open %s (%d): %s", CALIBRATION_FILEPATH, error, strerror(error));
         return false;
     }
 
@@ -119,11 +114,11 @@
         }
     }
 
-    if(config_data.find(AUTOCAL_CONFIG) != config_data.end()) {
+    if (config_data.find(AUTOCAL_CONFIG) != config_data.end()) {
         autocal << config_data[AUTOCAL_CONFIG] << std::endl;
     }
 
-    if(config_data.find(LRA_PERIOD_CONFIG) != config_data.end()) {
+    if (config_data.find(LRA_PERIOD_CONFIG) != config_data.end()) {
         uint32_t thisFrequency;
         uint32_t thisPeriod;
         ol_lra_period << config_data[LRA_PERIOD_CONFIG] << std::endl;
@@ -132,9 +127,9 @@
         // 1. Change long lra period to frequency
         // 2. Get frequency': subtract the frequency shift from the frequency
         // 3. Get final long lra period after put the frequency' to formula
-        thisFrequency = freqPeriodFormula(thisPeriod) -
-                property_get_int32("ro.vibrator.hal.long.frequency.shift",
-                        DEFAULT_FREQUENCY_SHIFT);
+        thisFrequency =
+            freqPeriodFormula(thisPeriod) -
+            property_get_int32("ro.vibrator.hal.long.frequency.shift", DEFAULT_FREQUENCY_SHIFT);
         long_lra_period = freqPeriodFormula(thisFrequency);
     }
 
@@ -145,87 +140,88 @@
     // Calibration data: lra period 262(i.e. 155Hz)
     std::uint32_t short_lra_period(DEFAULT_LRA_PERIOD);
     std::uint32_t long_lra_period(DEFAULT_LRA_PERIOD);
+    Vibrator::HwApi hwapi;
 
     // ostreams below are required
-    std::ofstream activate{ACTIVATE_PATH};
-    if (!activate) {
+    hwapi.activate.open(ACTIVATE_PATH);
+    if (!hwapi.activate) {
         int error = errno;
         ALOGE("Failed to open %s (%d): %s", ACTIVATE_PATH, error, strerror(error));
         return -error;
     }
 
-    std::ofstream duration{DURATION_PATH};
-    if (!duration) {
+    hwapi.duration.open(DURATION_PATH);
+    if (!hwapi.duration) {
         int error = errno;
         ALOGE("Failed to open %s (%d): %s", DURATION_PATH, error, strerror(error));
         return -error;
     }
 
-    std::ofstream state{STATE_PATH};
-    if (!state) {
+    hwapi.state.open(STATE_PATH);
+    if (!hwapi.state) {
         int error = errno;
         ALOGE("Failed to open %s (%d): %s", STATE_PATH, error, strerror(error));
         return -error;
     }
 
-    state << 1 << std::endl;
-    if (!state) {
+    hwapi.state << 1 << std::endl;
+    if (!hwapi.state) {
         int error = errno;
         ALOGE("Failed to set state (%d): %s", errno, strerror(errno));
         return -error;
     }
 
     // ostreams below are optional
-    std::ofstream rtpinput{RTP_INPUT_PATH};
-    if (!rtpinput) {
+    hwapi.rtpInput.open(RTP_INPUT_PATH);
+    if (!hwapi.rtpInput) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", RTP_INPUT_PATH, error, strerror(error));
     }
 
-    std::ofstream mode{MODE_PATH};
-    if (!mode) {
+    hwapi.mode.open(MODE_PATH);
+    if (!hwapi.mode) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", MODE_PATH, error, strerror(error));
     }
 
-    std::ofstream sequencer{SEQUENCER_PATH};
-    if (!sequencer) {
+    hwapi.sequencer.open(SEQUENCER_PATH);
+    if (!hwapi.sequencer) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", SEQUENCER_PATH, error, strerror(error));
     }
 
-    std::ofstream scale{SCALE_PATH};
-    if (!scale) {
+    hwapi.scale.open(SCALE_PATH);
+    if (!hwapi.scale) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", SCALE_PATH, error, strerror(error));
     }
 
-    std::ofstream ctrlloop{CTRL_LOOP_PATH};
-    if (!ctrlloop) {
+    hwapi.ctrlLoop.open(CTRL_LOOP_PATH);
+    if (!hwapi.ctrlLoop) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", CTRL_LOOP_PATH, error, strerror(error));
     }
 
-    std::ofstream lptrigger{LP_TRIGGER_PATH};
-    if (!lptrigger) {
+    hwapi.lpTriggerEffect.open(LP_TRIGGER_PATH);
+    if (!hwapi.lpTriggerEffect) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", LP_TRIGGER_PATH, error, strerror(error));
     }
 
-    std::ofstream lrawaveshape{LRA_WAVE_SHAPE_PATH};
-    if (!lrawaveshape) {
+    hwapi.lraWaveShape.open(LRA_WAVE_SHAPE_PATH);
+    if (!hwapi.lraWaveShape) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", LRA_WAVE_SHAPE_PATH, error, strerror(error));
     }
 
-    std::ofstream odclamp{OD_CLAMP_PATH};
-    if (!odclamp) {
+    hwapi.odClamp.open(OD_CLAMP_PATH);
+    if (!hwapi.odClamp) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", OD_CLAMP_PATH, error, strerror(error));
     }
 
-    std::ofstream ollraperiod{OL_LRA_PERIOD_FILEPATH};
-    if (!ollraperiod) {
+    hwapi.olLraPeriod.open(OL_LRA_PERIOD_FILEPATH);
+    if (!hwapi.olLraPeriod) {
         int error = errno;
         ALOGW("Failed to open %s (%d): %s", OL_LRA_PERIOD_FILEPATH, error, strerror(error));
     }
@@ -234,11 +230,7 @@
         ALOGW("Failed load calibration data");
     }
 
-    sp<IVibrator> vibrator = new Vibrator(std::move(activate), std::move(duration),
-            std::move(state), std::move(rtpinput), std::move(mode),
-            std::move(sequencer), std::move(scale), std::move(ctrlloop), std::move(lptrigger),
-            std::move(lrawaveshape), std::move(odclamp), std::move(ollraperiod),
-            short_lra_period, long_lra_period);
+    sp<IVibrator> vibrator = new Vibrator(std::move(hwapi), short_lra_period, long_lra_period);
 
     return vibrator->registerAsService();
 }
diff --git a/wpa_supplicant_overlay.conf b/wpa_supplicant_overlay.conf
index d8f5a21..3ac13d1 100644
--- a/wpa_supplicant_overlay.conf
+++ b/wpa_supplicant_overlay.conf
@@ -3,3 +3,4 @@
 tdls_external_control=1
 wowlan_triggers=magic_pkt
 bss_max_count=512
+bss_no_flush_when_down=1