Merge "Enabling sound trigger V2_2 for crosshatch"
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index 5056f7e..8beed4f 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -28,17 +28,21 @@
 TARGET_CPU_ABI := arm64-v8a
 TARGET_CPU_ABI2 :=
 ifeq (,$(filter %_mainline,$(TARGET_PRODUCT)))
-TARGET_CPU_VARIANT := cortex-a75
+TARGET_CPU_VARIANT := kryo385
 else
 TARGET_CPU_VARIANT := generic
 endif
 
 TARGET_2ND_ARCH := arm
+ifeq (,$(filter %_mainline,$(TARGET_PRODUCT)))
+TARGET_2ND_ARCH_VARIANT := armv8-2a
+else
 TARGET_2ND_ARCH_VARIANT := armv8-a
+endif
 TARGET_2ND_CPU_ABI := armeabi-v7a
 TARGET_2ND_CPU_ABI2 := armeabi
 ifeq (,$(filter %_mainline,$(TARGET_PRODUCT)))
-TARGET_2ND_CPU_VARIANT := cortex-a75
+TARGET_2ND_CPU_VARIANT := kryo385
 else
 TARGET_2ND_CPU_VARIANT := generic
 endif
@@ -100,16 +104,23 @@
 BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
 
 # product.img
+ifneq ($(PRODUCT_NO_PRODUCT_PARTITION), true)
 ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
   BOARD_PRODUCTIMAGE_PARTITION_SIZE := 314572800
 endif
 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
 TARGET_COPY_OUT_PRODUCT := product
+endif
 
 # system.img
 ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
   BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2952790016
+ifeq ($(PRODUCT_NO_PRODUCT_PARTITION), true)
+  # Increase inode count to add product modules
+  BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 8192
+else
   BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 4096
+endif
 else
   BOARD_EXT4_SHARE_DUP_BLOCKS := true
 endif
@@ -170,6 +181,12 @@
 BOARD_ROOT_EXTRA_SYMLINKS := /vendor/dsp:/dsp
 BOARD_ROOT_EXTRA_SYMLINKS += /mnt/vendor/persist:/persist
 
+# Add QC specific symlinks for backward compatibility
+# Move the symlinks here instead of removing them
+ifeq ($(PRODUCT_USE_QC_SPECIFIC_SYMLINKS), true)
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt:/firmware
+endif
+
 include device/google/crosshatch-sepolicy/crosshatch-sepolicy.mk
 
 TARGET_FS_CONFIG_GEN := device/google/crosshatch/config.fs
diff --git a/aosp_blueline.mk b/aosp_blueline.mk
index 7836fdb..487097d 100644
--- a/aosp_blueline.mk
+++ b/aosp_blueline.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/crosshatch/device-blueline.mk)
 $(call inherit-product-if-exists, vendor/google_devices/crosshatch/proprietary/device-vendor.mk)
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.config.ringtone=Ring_Synth_04.ogg \
+    ro.com.android.dataroaming=true \
+
 PRODUCT_PACKAGES += \
-    Dialer \
-    Launcher3QuickStep \
-    WallpaperPicker
+    PhotoTable \
+    WallpaperPicker \
+    WAPPushManager \
 
 # STOPSHIP deal with Qualcomm stuff later
 # PRODUCT_RESTRICT_VENDOR_FILES := all
@@ -35,6 +39,6 @@
 PRODUCT_DEVICE := blueline
 PRODUCT_MODEL := AOSP on blueline
 
-# 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_crosshatch.mk b/aosp_crosshatch.mk
index 65d42c6..8f0c652 100644
--- a/aosp_crosshatch.mk
+++ b/aosp_crosshatch.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/crosshatch/device-crosshatch.mk)
 $(call inherit-product-if-exists, vendor/google_devices/crosshatch/proprietary/device-vendor.mk)
 
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.config.ringtone=Ring_Synth_04.ogg \
+    ro.com.android.dataroaming=true \
+
 PRODUCT_PACKAGES += \
-    Dialer \
-    Launcher3QuickStep \
-    WallpaperPicker
+    PhotoTable \
+    WallpaperPicker \
+    WAPPushManager \
 
 # STOPSHIP deal with Qualcomm stuff later
 # PRODUCT_RESTRICT_VENDOR_FILES := all
@@ -35,6 +39,6 @@
 PRODUCT_DEVICE := crosshatch
 PRODUCT_MODEL := AOSP on crosshatch
 
-# 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/blueline/BoardConfig.mk b/blueline/BoardConfig.mk
index 6cd5db3..da0472d 100644
--- a/blueline/BoardConfig.mk
+++ b/blueline/BoardConfig.mk
@@ -17,4 +17,4 @@
 TARGET_BOOTLOADER_BOARD_NAME := blueline
 TARGET_RECOVERY_UI_MARGIN_HEIGHT := 20
 
-include device/google/crosshatch/BoardConfig-common.mk
\ No newline at end of file
+include device/google/crosshatch/BoardConfig-common.mk
diff --git a/device-blueline.mk b/device-blueline.mk
index 2295a84..f0f2f6d 100644
--- a/device-blueline.mk
+++ b/device-blueline.mk
@@ -14,12 +14,6 @@
 # limitations under the License.
 #
 
-ifeq (,$(filter %_mainline,$(TARGET_PRODUCT)))
-PRODUCT_AAPT_CONFIG := normal
-PRODUCT_AAPT_PREF_CONFIG := xxhdpi
-PRODUCT_AAPT_PREBUILT_DPI := xxhdpi xhdpi hdpi
-endif
-
 PRODUCT_HARDWARE := blueline
 
 include device/google/crosshatch/device-common.mk
diff --git a/device-crosshatch.mk b/device-crosshatch.mk
index f23f9e5..502996c 100644
--- a/device-crosshatch.mk
+++ b/device-crosshatch.mk
@@ -14,12 +14,6 @@
 # limitations under the License.
 #
 
-ifeq (,$(filter %_mainline,$(TARGET_PRODUCT)))
-PRODUCT_AAPT_CONFIG := normal
-PRODUCT_AAPT_PREF_CONFIG := 560dpi
-PRODUCT_AAPT_PREBUILT_DPI := xxxhdpi xxhdpi xhdpi hdpi
-endif
-
 PRODUCT_HARDWARE := crosshatch
 
 include device/google/crosshatch/device-common.mk
diff --git a/device.mk b/device.mk
index 404801e..ca1ba13 100644
--- a/device.mk
+++ b/device.mk
@@ -151,8 +151,13 @@
     boot \
     system \
     vbmeta \
-    dtbo \
+    dtbo
+
+# Skip product partition for nodap build
+ifeq ($(filter %_nodap,$(TARGET_PRODUCT)),)
+AB_OTA_PARTITIONS += \
     product
+endif
 
 ifneq ($(filter %_mainline,$(TARGET_PRODUCT)),)
 AB_OTA_PARTITIONS += \
@@ -169,7 +174,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 += \
@@ -488,7 +494,6 @@
 PRODUCT_PACKAGES += \
     android.hardware.wifi@1.0-service \
     wificond \
-    wifilogd \
     libwpa_client
 
 LIB_NL := libnl_2
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 33091e9..54841db 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -291,6 +291,29 @@
     }
 }
 
+static void DumpVibrator(int fd) {
+    const std::string dir = "/sys/class/leds/vibrator/device/";
+    const std::vector<std::string> files {
+        "comp_enable",
+        "cp_dig_scale",
+        "cp_trigger_index",
+        "cp_trigger_queue",
+        "dig_scale",
+        "f0_stored",
+        "heartbeat",
+        "leds/vibrator/activate",
+        "leds/vibrator/duration",
+        "leds/vibrator/state",
+        "num_waves",
+        "redc_stored",
+        "standby_timeout",
+    };
+
+    for (const auto &file : files) {
+        DumpFileToFd(fd, "Vibrator", dir+file);
+    }
+}
+
 // Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
 Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
     // Exit when dump is completed since this is a lazy HAL.
@@ -382,6 +405,8 @@
         RunCommandToFd(fd, "Citadel SELFTEST", {"/vendor/bin/hw/citadel_updater", "--selftest"});
     }
 
+    DumpVibrator(fd);
+
     // Dump various events in WiFi data path
     DumpFileToFd(fd, "WLAN DP Trace", "/d/wlan/dpt_stats/dump_set_dpt_logs");
 
diff --git a/fstab.hardware b/fstab.hardware
index 8ba5e1b..e492e66 100644
--- a/fstab.hardware
+++ b/fstab.hardware
@@ -4,9 +4,9 @@
 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/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/1d84000.ufshc,reservedsize=128M
+/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/1d84000.ufshc,reservedsize=128M,checkpoint=fs
 /dev/block/bootdevice/by-name/misc                  /misc              emmc        defaults                                              defaults
 /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:firmware_file:s0   wait,slotselect
 /devices/platform/soc/a600000.ssusb/a600000.dwc3*   auto               vfat        defaults                                              voldmanaged=usb:auto
-/dev/block/zram0                                    none               swap        defaults                                              zramsize=1073741824,max_comp_streams=8
+/dev/block/zram0                                    none               swap        defaults                                              zramsize=2147483648,max_comp_streams=8
diff --git a/fstab.mainline.hardware b/fstab.mainline.hardware
index 1b1b8ea..58974d7 100644
--- a/fstab.mainline.hardware
+++ b/fstab.mainline.hardware
@@ -5,9 +5,9 @@
 vendor                                              /vendor            ext4        ro,barrier=1                                          wait,slotselect,avb=vbmeta,logical,first_stage_mount
 product                                             /product           ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
 product_services                                    /product_services  ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
-/dev/block/bootdevice/by-name/metadata              /metadata          ext4        noatime,nosuid,nodev,discard                          wait,check,formattable
+/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/1d84000.ufshc,reservedsize=128M
 /dev/block/bootdevice/by-name/misc                  /misc              emmc        defaults                                              defaults
 /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:firmware_file:s0   wait,slotselect
 /devices/platform/soc/a600000.ssusb/a600000.dwc3*   auto               vfat        defaults                                              voldmanaged=usb:auto
-/dev/block/zram0                                    none               swap        defaults                                              zramsize=536870912,max_comp_streams=8
+/dev/block/zram0                                    none               swap        defaults                                              zramsize=2147483648,max_comp_streams=8
diff --git a/init.hardware.rc b/init.hardware.rc
index 0977c9f..71f72fc 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -76,24 +76,6 @@
     start vendor.citadeld
     start vendor.keymaster-4-0-citadel
 
-    # Boot time fs tune
-    write /sys/block/sda/queue/iostats 0
-    write /sys/block/sda/queue/scheduler cfq
-    write /sys/block/sda/queue/iosched/slice_idle 0
-    write /sys/block/sda/queue/read_ahead_kb 2048
-    write /sys/block/sda/queue/nr_requests 256
-    write /sys/block/sdf/queue/iostats 0
-    write /sys/block/sdf/queue/scheduler cfq
-    write /sys/block/sdf/queue/iosched/slice_idle 0
-    write /sys/block/sdf/queue/read_ahead_kb 2048
-    write /sys/block/sdf/queue/nr_requests 256
-    write /sys/block/dm-0/queue/read_ahead_kb 2048
-    write /sys/block/dm-1/queue/read_ahead_kb 2048
-    write /sys/block/dm-2/queue/read_ahead_kb 2048
-    write /sys/block/dm-3/queue/read_ahead_kb 2048
-    write /sys/block/dm-4/queue/read_ahead_kb 2048
-    write /sys/block/dm-5/queue/read_ahead_kb 2048
-
     # Disable UFS powersaving
     write /sys/devices/platform/soc/${ro.boot.bootdevice}/clkgate_enable 0
     write /sys/devices/platform/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 0
@@ -267,10 +249,6 @@
 
     # Mount RW partitions which need run fsck
     mount_all /vendor/etc/fstab.${ro.boot.hardware.platform} --late
-    # Boot time fs tune
-    write /sys/block/dm-3/queue/read_ahead_kb 2048
-    write /sys/block/dm-4/queue/read_ahead_kb 2048
-    write /sys/block/dm-6/queue/read_ahead_kb 2048
 
     # Required for time_daemon
     mkdir /persist/time 0770 system system
@@ -441,11 +419,16 @@
     chmod 0660 /dev/vd6281
 
     # Permission for Vibrator
+    chown system system /sys/class/leds/vibrator/device/comp_enable
+    chown system system /sys/class/leds/vibrator/device/cp_dig_scale
     chown system system /sys/class/leds/vibrator/device/cp_trigger_index
     chown system system /sys/class/leds/vibrator/device/cp_trigger_queue
     chown system system /sys/class/leds/vibrator/device/dig_scale
     chown system system /sys/class/leds/vibrator/device/f0_stored
+    chown system system /sys/class/leds/vibrator/device/heartbeat
+    chown system system /sys/class/leds/vibrator/device/num_waves
     chown system system /sys/class/leds/vibrator/device/redc_stored
+    chown system system /sys/class/leds/vibrator/device/standby_timeout
 
     # Permission for LED driver
     chown system system /sys/class/leds/red/on_off_ms
@@ -600,23 +583,6 @@
     write /dev/cpuset/application/background/cpus 0-1
     write /dev/cpuset/application/cpus 0-1,4-5
 
-    # Runtime fs tuning: as we have init boottime setting and kernel patch setting
-    # default readahead to 2048KB. We should adjust the setting upon boot_complete
-    # for runtime performance
-    write /sys/block/sda/queue/read_ahead_kb 128
-    write /sys/block/sda/queue/nr_requests 128
-    write /sys/block/sda/queue/iostats 1
-    write /sys/block/sdf/queue/read_ahead_kb 128
-    write /sys/block/sdf/queue/nr_requests 128
-    write /sys/block/sdf/queue/iostats 1
-    write /sys/block/dm-0/queue/read_ahead_kb 128
-    write /sys/block/dm-1/queue/read_ahead_kb 128
-    write /sys/block/dm-2/queue/read_ahead_kb 128
-    write /sys/block/dm-3/queue/read_ahead_kb 128
-    write /sys/block/dm-4/queue/read_ahead_kb 128
-    write /sys/block/dm-5/queue/read_ahead_kb 128
-    write /sys/block/dm-6/queue/read_ahead_kb 128
-
     # QCOM FG SRAM dump for dumpstate
     chown system system /d/fg/sram/data
     chown system system /d/fg/sram/count
diff --git a/nfc/libnfc-nxp.blueline.conf b/nfc/libnfc-nxp.blueline.conf
index 01f953b..a356096 100644
--- a/nfc/libnfc-nxp.blueline.conf
+++ b/nfc/libnfc-nxp.blueline.conf
@@ -321,4 +321,7 @@
 # bit pos 5 = Screen Off lock
 DEFAULT_SYS_CODE_PWR_STATE=0x3B
 
-###############################################################################
+##############################################################################
+# Update Phase tirm offset signbit
+NXP_PHASE_TIRM_OFFSET_SIGN_UPDATE=0x01
+
diff --git a/nfc/libnfc-nxp.crosshatch.conf b/nfc/libnfc-nxp.crosshatch.conf
index ee8dc04..c326a79 100644
--- a/nfc/libnfc-nxp.crosshatch.conf
+++ b/nfc/libnfc-nxp.crosshatch.conf
@@ -321,3 +321,6 @@
 DEFAULT_SYS_CODE_PWR_STATE=0x3B
 
 ###############################################################################
+# Update Phase tirm offset signbit
+NXP_PHASE_TIRM_OFFSET_SIGN_UPDATE=0x01
+
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index d37c7c2..9265a9f 100755
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -408,6 +408,11 @@
          meanings. -->
     <integer name="config_defaultNotificationVibrationIntensity">3</integer>
 
+    <!-- Enables or disables haptic effect when the text insertion/selection handle is moved
+          manually by the user. Off by default, since the expected haptic feedback may not be
+          available on some devices. -->
+     <bool name="config_enableHapticTextHandle">true</bool>
+
     <!-- 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>
@@ -425,4 +430,7 @@
         <item>com.felicanetworks.mfc</item>
         <item>com.felicanetworks.mfm</item>
     </string-array>
+
+    <!-- True if the firmware supports connected MAC randomization -->
+    <bool name="config_wifi_connected_mac_randomization_supported">true</bool>
 </resources>
diff --git a/power-libperfmgr/Android.bp b/power-libperfmgr/Android.bp
index 1fd5acf..45d129c 100644
--- a/power-libperfmgr/Android.bp
+++ b/power-libperfmgr/Android.bp
@@ -16,15 +16,12 @@
     name: "android.hardware.power@1.3-service.crosshatch-libperfmgr",
     relative_install_path: "hw",
     init_rc: ["android.hardware.power@1.3-service.crosshatch-libperfmgr.rc"],
-    srcs: ["service.cpp", "Power.cpp", "InteractionHandler.cpp", "power-helper.c",
+    srcs: ["service.cpp", "Power.cpp", "InteractionHandler.cpp",
             "display-helper.c"],
     cflags: [
         "-Wall",
         "-Werror",
     ],
-    static_libs: [
-        "libpixelpowerstats",
-    ],
     shared_libs: [
         "libbase",
         "libhidlbase",
diff --git a/power-libperfmgr/Power.cpp b/power-libperfmgr/Power.cpp
index 10fd651..dfe8377 100644
--- a/power-libperfmgr/Power.cpp
+++ b/power-libperfmgr/Power.cpp
@@ -23,20 +23,14 @@
 #include <android-base/strings.h>
 #include <android-base/stringprintf.h>
 
-#include <pixelpowerstats/Debugging.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 {
@@ -46,15 +40,10 @@
 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;
-using ::hardware::google::pixel::powerstats::DumpPowerHal1_0PlatStatsToFd;
-using ::hardware::google::pixel::powerstats::DumpPowerHal1_1SubsysStatsToFd;
 
 Power::Power() :
         mHintManager(nullptr),
@@ -216,171 +205,15 @@
 }
 
 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);
+    LOG(ERROR) << "getPlatformLowPowerStats not supported. Use IPowerStats HAL.";
+    _hidl_cb({}, 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;
-}
-
-static const std::string get_easel_state_name(int state) {
-    if (state == EASEL_OFF) {
-        return "Off";
-    } else if (state == EASEL_ACTIVE) {
-        return "Active";
-    } else if (state == EASEL_SUSPEND) {
-        return "Suspend";
-    } else {
-        return "Unknown";
-    }
-}
-
-// Get low power stats for easel subsystem
-static int get_easel_low_power_stats(struct PowerStateSubsystem *subsystem) {
-    uint64_t stats[EASEL_SLEEP_STATE_COUNT * EASEL_STATS_COUNT] = {0};
-    uint64_t *state_stats;
-    struct PowerStateSubsystemSleepState *state;
-
-    subsystem->name = "Easel";
-
-    if (extract_easel_stats(stats, ARRAY_SIZE(stats)) != 0) {
-        subsystem->states.resize(0);
-        return -1;
-    }
-
-    subsystem->states.resize(EASEL_SLEEP_STATE_COUNT);
-
-    for (int easel_state = 0; easel_state < EASEL_SLEEP_STATE_COUNT; easel_state++) {
-        state = &subsystem->states[easel_state];
-        state_stats = &stats[easel_state * EASEL_STATS_COUNT];
-
-        state->name = get_easel_state_name(easel_state);
-        state->residencyInMsecSinceBoot = state_stats[CUMULATIVE_DURATION_MS];
-        state->totalTransitions = state_stats[CUMULATIVE_COUNT];
-        state->lastEntryTimestampMs = state_stats[LAST_ENTRY_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__);
-    }
-
-    // Get Easel subsystem low power stats.
-    if (get_easel_low_power_stats(&subsystems[SUBSYSTEM_EASEL]) != 0) {
-        ALOGE("%s: failed to process Easel stats", __func__);
-    }
-
-    _hidl_cb(subsystems, Status::SUCCESS);
+    LOG(ERROR) << "getSubsystemLowPowerStats not supported. Use IPowerStats HAL.";
+    _hidl_cb({}, Status::SUCCESS);
     return Void();
 }
 
@@ -547,20 +380,6 @@
             PLOG(ERROR) << "Failed to dump state to fd";
         }
 
-        // Dump platform low power stats
-        getPlatformLowPowerStats([fd](const auto& platStats, const auto result) {
-            if (!DumpPowerHal1_0PlatStatsToFd(result, platStats, fd)) {
-                PLOG(ERROR) << "Failed to dump platform low power stats to fd";
-            }
-        });
-
-        // Dump subsystem low power stats
-        getSubsystemLowPowerStats([fd](const auto& subsysStats, const auto result) {
-            if (!DumpPowerHal1_1SubsysStatsToFd(result, subsysStats, fd)) {
-                PLOG(ERROR) << "Failed to dump subsystem low power stats to fd";
-            }
-        });
-
         fsync(fd);
     }
     return Void();
diff --git a/power-libperfmgr/power-helper.c b/power-libperfmgr/power-helper.c
deleted file mode 100644
index c65537a..0000000
--- a/power-libperfmgr/power-helper.c
+++ /dev/null
@@ -1,253 +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.crosshatch-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
-
-#ifndef EASEL_STATS_FILE
-#define EASEL_STATS_FILE "/d/mnh_sm/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_SLPI,       "SLPI", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-    { MASTER_CDSP,       "CDSP", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-    // The following masters are currently unused
-    //{ MASTER_GPU,         "GPU", master_stats_labels, ARRAY_SIZE(master_stats_labels) },
-    //{ MASTER_DISPLAY, "DISPLAY", 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 *easel_stats_labels[EASEL_STATS_COUNT] = {
-    "Cumulative count",
-    "Cumulative duration msec",
-    "Last entry timestamp msec"
-};
-
-struct stats_section easel_sections[] = {
-    { SUBSYSTEM_EASEL,     "OFF", easel_stats_labels, ARRAY_SIZE(easel_stats_labels) },
-    { SUBSYSTEM_EASEL,  "ACTIVE", easel_stats_labels, ARRAY_SIZE(easel_stats_labels) },
-    { SUBSYSTEM_EASEL, "SUSPEND", easel_stats_labels, ARRAY_SIZE(easel_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_easel_stats(uint64_t *list, size_t list_length) {
-    size_t entries_per_section = list_length / ARRAY_SIZE(easel_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, EASEL_STATS_FILE,
-            easel_sections, ARRAY_SIZE(easel_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 653c118..0000000
--- a/power-libperfmgr/power-helper.h
+++ /dev/null
@@ -1,161 +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_SLPI,
-    MASTER_CDSP,  // Not technically used, but included for precautionary stats tracking
-    // The following masters are supported by the RPMh stats driver, but not
-    // in use on our devices.
-    // MASTER_GPU,
-    // MASTER_DISPLAY,
-    MASTER_COUNT, // Total master sources
-
-    // Subsystem stats.  (Numbering starts at MASTER_COUNT to preserve
-    // contiguous source numbering.)
-    SUBSYSTEM_WLAN = MASTER_COUNT,
-    SUBSYSTEM_EASEL,
-    // 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 easel_sleep_states {
-    EASEL_OFF = 0,
-    EASEL_ACTIVE,
-    EASEL_SUSPEND,
-
-    // Don't add any lines after this line
-    EASEL_SLEEP_STATE_COUNT
-};
-
-enum easel_stats {
-    CUMULATIVE_COUNT = 0,
-    CUMULATIVE_DURATION_MS,
-    LAST_ENTRY_TSTAMP_MS,
-
-    // Don't add any lines after this line
-    EASEL_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_easel_stats(uint64_t *list, size_t list_length);
-int extract_system_stats(uint64_t *list, size_t list_length);
-
-int get_easel_state(unsigned long *current_state);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__POWER_HELPER_H__
diff --git a/powerstats/service.cpp b/powerstats/service.cpp
index 518bb85..f3724e7 100644
--- a/powerstats/service.cpp
+++ b/powerstats/service.cpp
@@ -110,7 +110,8 @@
 
     // Add WLAN power entity
     uint32_t wlanId = service->addPowerEntity("WLAN", PowerEntityType::SUBSYSTEM);
-    auto wlanSdp = std::make_shared<WlanStateResidencyDataProvider>(wlanId);
+    auto wlanSdp =
+        std::make_shared<WlanStateResidencyDataProvider>(wlanId, "/d/wlan0/power_stats");
     service->addStateResidencyDataProvider(std::move(wlanSdp));
 
     // Add Easel power entity
diff --git a/self-extractors/extract-lists.txt b/self-extractors/extract-lists.txt
index 3ffb3d2..f4ba410 100644
--- a/self-extractors/extract-lists.txt
+++ b/self-extractors/extract-lists.txt
@@ -11,7 +11,6 @@
             system/etc/firmware/music_detector.sound_model \
             system/etc/init/init-persist.rc \
             system/etc/permissions/cneapiclient.xml \
-            system/etc/permissions/com.google.android.factoryota.xml \
             system/etc/permissions/com.qualcomm.qti.imscmservice.xml \
             system/etc/permissions/com.quicinc.cne.xml \
             system/etc/permissions/embms.xml \
@@ -63,7 +62,6 @@
             system/lib64/libsensorslog.so \
             system/lib64/libsns_low_lat_stream_stub.so \
             system/lib64/libOpenCL_system.so \
-            system/lib64/libprotobuf-cpp-full-rtti.so \
             system/lib64/libqcbor.so \
             system/lib64/libsmcinvokecred.so \
             system/lib64/libtzcom.so \
@@ -80,9 +78,7 @@
             system/lib/lib-imsvtutils.so \
             system/lib/liblistenjni.so \
             system/lib/liblistensoundmodel2.so \
-            system/lib/liblogwrap.so \
             system/lib/libmdsprpc_system.so \
-            system/lib/libprotobuf-cpp-full.so \
             system/lib/libqct_resampler.so \
             system/lib/libQTEEConnector_system.so \
             system/lib/librcc.so \
@@ -93,7 +89,6 @@
             system/lib/libsensorslog.so \
             system/lib/libsns_low_lat_stream_stub.so \
             system/lib/libOpenCL_system.so \
-            system/lib/libprotobuf-cpp-full-rtti.so \
             system/lib/libqcbor.so \
             system/lib/libsmcinvokecred.so \
             system/lib/libtzcom.so \
diff --git a/self-extractors/qcom/staging/device-partial.mk b/self-extractors/qcom/staging/device-partial.mk
index 8c3d214..35e07e0 100644
--- a/self-extractors/qcom/staging/device-partial.mk
+++ b/self-extractors/qcom/staging/device-partial.mk
@@ -12,10 +12,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# AOSP packages required by the blobs
+PRODUCT_PACKAGES := \
+    libprotobuf-cpp-full
+
 #  blob(s) necessary for crosshatch hardware
 PRODUCT_COPY_FILES := \
     vendor/qcom/crosshatch/proprietary/cneapiclient.xml:system/etc/permissions/cneapiclient.xml:qcom \
-    vendor/qcom/crosshatch/proprietary/com.google.android.factoryota.xml:system/etc/permissions/com.google.android.factoryota.xml:qcom \
     vendor/qcom/crosshatch/proprietary/com.qualcomm.qti.imscmservice.xml:system/etc/permissions/com.qualcomm.qti.imscmservice.xml:qcom \
     vendor/qcom/crosshatch/proprietary/com.qualcomm.qti.uceservice-V2.0-java.jar:system/framework/com.qualcomm.qti.uceservice-V2.0-java.jar:qcom \
     vendor/qcom/crosshatch/proprietary/com.quicinc.cne.xml:system/etc/permissions/com.quicinc.cne.xml:qcom \
@@ -48,7 +51,6 @@
     vendor/qcom/crosshatch/proprietary/lib64/libsensorslog.so:system/lib64/libsensorslog.so:qcom \
     vendor/qcom/crosshatch/proprietary/lib64/libsns_low_lat_stream_stub.so:system/lib64/libsns_low_lat_stream_stub.so:qcom \
     vendor/qcom/crosshatch/proprietary/lib64/libOpenCL_system.so:system/lib64/libOpenCL_system.so:qcom \
-    vendor/qcom/crosshatch/proprietary/lib64/libprotobuf-cpp-full-rtti.so:system/lib64/libprotobuf-cpp-full-rtti.so:qcom \
     vendor/qcom/crosshatch/proprietary/lib64/libqcbor.so:system/lib64/libqcbor.so:qcom \
     vendor/qcom/crosshatch/proprietary/lib64/libsmcinvokecred.so:system/lib64/libsmcinvokecred.so:qcom \
     vendor/qcom/crosshatch/proprietary/lib64/libtzcom.so:system/lib64/libtzcom.so:qcom \
@@ -65,9 +67,7 @@
     vendor/qcom/crosshatch/proprietary/lib-imsvtutils.so:system/lib/lib-imsvtutils.so:qcom \
     vendor/qcom/crosshatch/proprietary/liblistenjni.so:system/lib/liblistenjni.so:qcom \
     vendor/qcom/crosshatch/proprietary/liblistensoundmodel2.so:system/lib/liblistensoundmodel2.so:qcom \
-    vendor/qcom/crosshatch/proprietary/liblogwrap.so:system/lib/liblogwrap.so:qcom \
     vendor/qcom/crosshatch/proprietary/libmdsprpc_system.so:system/lib/libmdsprpc_system.so:qcom \
-    vendor/qcom/crosshatch/proprietary/libprotobuf-cpp-full.so:system/lib/libprotobuf-cpp-full.so:qcom \
     vendor/qcom/crosshatch/proprietary/libqct_resampler.so:system/lib/libqct_resampler.so:qcom \
     vendor/qcom/crosshatch/proprietary/libQTEEConnector_system.so:system/lib/libQTEEConnector_system.so:qcom \
     vendor/qcom/crosshatch/proprietary/librcc.so:system/lib/librcc.so:qcom \
@@ -79,7 +79,6 @@
     vendor/qcom/crosshatch/proprietary/libsns_low_lat_stream_skel.so:system/lib/rfsa/adsp/libsns_low_lat_stream_skel.so:qcom \
     vendor/qcom/crosshatch/proprietary/libsns_low_lat_stream_stub.so:system/lib/libsns_low_lat_stream_stub.so:qcom \
     vendor/qcom/crosshatch/proprietary/libOpenCL_system.so:system/lib/libOpenCL_system.so:qcom \
-    vendor/qcom/crosshatch/proprietary/libprotobuf-cpp-full-rtti.so:system/lib/libprotobuf-cpp-full-rtti.so:qcom \
     vendor/qcom/crosshatch/proprietary/libqcbor.so:system/lib/libqcbor.so:qcom \
     vendor/qcom/crosshatch/proprietary/libsmcinvokecred.so:system/lib/libsmcinvokecred.so:qcom \
     vendor/qcom/crosshatch/proprietary/libtzcom.so:system/lib/libtzcom.so:qcom \
diff --git a/self-extractors_blueline/extract-lists.txt b/self-extractors_blueline/extract-lists.txt
index 3ffb3d2..f4ba410 100644
--- a/self-extractors_blueline/extract-lists.txt
+++ b/self-extractors_blueline/extract-lists.txt
@@ -11,7 +11,6 @@
             system/etc/firmware/music_detector.sound_model \
             system/etc/init/init-persist.rc \
             system/etc/permissions/cneapiclient.xml \
-            system/etc/permissions/com.google.android.factoryota.xml \
             system/etc/permissions/com.qualcomm.qti.imscmservice.xml \
             system/etc/permissions/com.quicinc.cne.xml \
             system/etc/permissions/embms.xml \
@@ -63,7 +62,6 @@
             system/lib64/libsensorslog.so \
             system/lib64/libsns_low_lat_stream_stub.so \
             system/lib64/libOpenCL_system.so \
-            system/lib64/libprotobuf-cpp-full-rtti.so \
             system/lib64/libqcbor.so \
             system/lib64/libsmcinvokecred.so \
             system/lib64/libtzcom.so \
@@ -80,9 +78,7 @@
             system/lib/lib-imsvtutils.so \
             system/lib/liblistenjni.so \
             system/lib/liblistensoundmodel2.so \
-            system/lib/liblogwrap.so \
             system/lib/libmdsprpc_system.so \
-            system/lib/libprotobuf-cpp-full.so \
             system/lib/libqct_resampler.so \
             system/lib/libQTEEConnector_system.so \
             system/lib/librcc.so \
@@ -93,7 +89,6 @@
             system/lib/libsensorslog.so \
             system/lib/libsns_low_lat_stream_stub.so \
             system/lib/libOpenCL_system.so \
-            system/lib/libprotobuf-cpp-full-rtti.so \
             system/lib/libqcbor.so \
             system/lib/libsmcinvokecred.so \
             system/lib/libtzcom.so \
diff --git a/self-extractors_blueline/qcom/staging/device-partial.mk b/self-extractors_blueline/qcom/staging/device-partial.mk
index 886b994..94b0c9a 100644
--- a/self-extractors_blueline/qcom/staging/device-partial.mk
+++ b/self-extractors_blueline/qcom/staging/device-partial.mk
@@ -12,10 +12,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# AOSP packages required by the blobs
+PRODUCT_PACKAGES := \
+    libprotobuf-cpp-full
+
 #  blob(s) necessary for blueline hardware
 PRODUCT_COPY_FILES := \
     vendor/qcom/blueline/proprietary/cneapiclient.xml:system/etc/permissions/cneapiclient.xml:qcom \
-    vendor/qcom/blueline/proprietary/com.google.android.factoryota.xml:system/etc/permissions/com.google.android.factoryota.xml:qcom \
     vendor/qcom/blueline/proprietary/com.qualcomm.qti.imscmservice.xml:system/etc/permissions/com.qualcomm.qti.imscmservice.xml:qcom \
     vendor/qcom/blueline/proprietary/com.qualcomm.qti.uceservice-V2.0-java.jar:system/framework/com.qualcomm.qti.uceservice-V2.0-java.jar:qcom \
     vendor/qcom/blueline/proprietary/com.quicinc.cne.xml:system/etc/permissions/com.quicinc.cne.xml:qcom \
@@ -48,7 +51,6 @@
     vendor/qcom/blueline/proprietary/lib64/libsensorslog.so:system/lib64/libsensorslog.so:qcom \
     vendor/qcom/blueline/proprietary/lib64/libsns_low_lat_stream_stub.so:system/lib64/libsns_low_lat_stream_stub.so:qcom \
     vendor/qcom/blueline/proprietary/lib64/libOpenCL_system.so:system/lib64/libOpenCL_system.so:qcom \
-    vendor/qcom/blueline/proprietary/lib64/libprotobuf-cpp-full-rtti.so:system/lib64/libprotobuf-cpp-full-rtti.so:qcom \
     vendor/qcom/blueline/proprietary/lib64/libqcbor.so:system/lib64/libqcbor.so:qcom \
     vendor/qcom/blueline/proprietary/lib64/libsmcinvokecred.so:system/lib64/libsmcinvokecred.so:qcom \
     vendor/qcom/blueline/proprietary/lib64/libtzcom.so:system/lib64/libtzcom.so:qcom \
@@ -65,9 +67,7 @@
     vendor/qcom/blueline/proprietary/lib-imsvtutils.so:system/lib/lib-imsvtutils.so:qcom \
     vendor/qcom/blueline/proprietary/liblistenjni.so:system/lib/liblistenjni.so:qcom \
     vendor/qcom/blueline/proprietary/liblistensoundmodel2.so:system/lib/liblistensoundmodel2.so:qcom \
-    vendor/qcom/blueline/proprietary/liblogwrap.so:system/lib/liblogwrap.so:qcom \
     vendor/qcom/blueline/proprietary/libmdsprpc_system.so:system/lib/libmdsprpc_system.so:qcom \
-    vendor/qcom/blueline/proprietary/libprotobuf-cpp-full.so:system/lib/libprotobuf-cpp-full.so:qcom \
     vendor/qcom/blueline/proprietary/libqct_resampler.so:system/lib/libqct_resampler.so:qcom \
     vendor/qcom/blueline/proprietary/libQTEEConnector_system.so:system/lib/libQTEEConnector_system.so:qcom \
     vendor/qcom/blueline/proprietary/librcc.so:system/lib/librcc.so:qcom \
@@ -79,7 +79,6 @@
     vendor/qcom/blueline/proprietary/libsns_low_lat_stream_skel.so:system/lib/rfsa/adsp/libsns_low_lat_stream_skel.so:qcom \
     vendor/qcom/blueline/proprietary/libsns_low_lat_stream_stub.so:system/lib/libsns_low_lat_stream_stub.so:qcom \
     vendor/qcom/blueline/proprietary/libOpenCL_system.so:system/lib/libOpenCL_system.so:qcom \
-    vendor/qcom/blueline/proprietary/libprotobuf-cpp-full-rtti.so:system/lib/libprotobuf-cpp-full-rtti.so:qcom \
     vendor/qcom/blueline/proprietary/libqcbor.so:system/lib/libqcbor.so:qcom \
     vendor/qcom/blueline/proprietary/libsmcinvokecred.so:system/lib/libsmcinvokecred.so:qcom \
     vendor/qcom/blueline/proprietary/libtzcom.so:system/lib/libtzcom.so:qcom \
diff --git a/ueventd.hardware.rc b/ueventd.hardware.rc
index d680023..13057ab 100644
--- a/ueventd.hardware.rc
+++ b/ueventd.hardware.rc
@@ -66,6 +66,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
@@ -91,6 +92,7 @@
 /dev/ramdump_*            0640   system     system
 
 # BT
+/dev/ttyMSM0              0600   bluetooth  bluetooth
 /dev/ttyHS0               0660   bluetooth  net_bt
 /dev/btpower              0660   bluetooth  net_bt
 
@@ -116,4 +118,4 @@
 /dev/block/platform/soc/1d84000.ufshc/by-name/frp       0660   system     system
 
 # fuel gauge history
-/dev/maxfg_history        0644   system system
\ No newline at end of file
+/dev/maxfg_history        0644   system system
diff --git a/wpa_supplicant_overlay.conf b/wpa_supplicant_overlay.conf
index d8f5a21..a1b2b09 100644
--- a/wpa_supplicant_overlay.conf
+++ b/wpa_supplicant_overlay.conf
@@ -3,3 +3,7 @@
 tdls_external_control=1
 wowlan_triggers=magic_pkt
 bss_max_count=512
+interworking=1
+hs20=1
+auto_interworking=0
+bss_no_flush_when_down=1