dumpstate: Add tmu register dump am: 676247423b am: f71383eb96

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101/+/16569086

Change-Id: I8aa7ac9bb8f285f8f1f7bdb6a9873c3e278373b5
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index e87a889..b065cf7 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -32,7 +32,7 @@
 TARGET_CPU_VARIANT := cortex-a55
 TARGET_CPU_VARIANT_RUNTIME := cortex-a55
 
-ifeq (,$(filter %_64,$(TARGET_PRODUCT)))
+ifeq (,$(filter %tangor %_64,$(TARGET_PRODUCT)))
 TARGET_2ND_ARCH := arm
 TARGET_2ND_ARCH_VARIANT := armv8-a
 TARGET_2ND_CPU_ABI := armeabi-v7a
@@ -316,22 +316,6 @@
 # H/W align restriction of MM IPs
 BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64
 
-# WiFi
-BOARD_WLAN_DEVICE := bcmdhd
-BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
-BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
-WPA_SUPPLICANT_VERSION := VER_0_8_X
-BOARD_WPA_SUPPLICANT_DRIVER := NL80211
-BOARD_HOSTAPD_DRIVER := NL80211
-# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {1 STA + 1 P2P}
-# or {1 STA + 1 NAN} or {2 STA}
-WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}
-WIFI_FEATURE_WIFI_EXT_HAL := true
-WIFI_FEATURE_IMU_DETECTION := true
-# Avoid Wifi reset on MAC Address change
-WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true
-WIFI_FEATURE_HOSTAPD_11AX := true
-
 # NeuralNetworks
 GPU_SOURCE_PRESENT := $(wildcard vendor/arm/mali/valhall)
 GPU_PREBUILD_PRESENT := $(wildcard vendor/google_devices/gs101/prebuilts/gpu/libs)
@@ -394,4 +378,7 @@
 # Enable larger logbuf
 BOARD_KERNEL_CMDLINE += log_buf_len=1024K
 
+# Protected VM firmware
+BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000
+
 -include vendor/google_devices/gs101/proprietary/BoardConfigVendor.mk
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 12538be..8639586 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -83,3 +83,9 @@
 $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/init/android.hardware.keymaster@4.0-service.trusty.rc)
 $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.keymaster@4.0-service.trusty.xml)
 $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/bin/hw/wait_for_strongbox)
+
+# Health HAL to AIDL
+$(call add-clean-step, find $(PRODUCT_OUT)/system -type f -name "*charger*" -print0 | xargs -0 rm -f)
+$(call add-clean-step, find $(PRODUCT_OUT)/vendor -type f -name "*health@*" -print0 | xargs -0 rm -f)
+$(call add-clean-step, find $(PRODUCT_OUT)/recovery/root -type f -name "*charger*" -print0 | xargs -0 rm -f)
+$(call add-clean-step, find $(PRODUCT_OUT)/recovery/root -type f -name "*health@*" -print0 | xargs -0 rm -f)
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..4d9cf6e
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,2 @@
+per-file powerhint.json = wvw@google.com,joaodias@google.com,jenhaochen@google.com,rkganesh@google.com,jychen@google.com
+per-file powerhint.json = wvw@google.com,joaodias@google.com,jenhaochen@google.com,rkganesh@google.com,jychen@google.com
diff --git a/aosp_common.mk b/aosp_common.mk
index 1ad6eb7..e4e6863 100644
--- a/aosp_common.mk
+++ b/aosp_common.mk
@@ -17,11 +17,12 @@
 #
 # All components inherited here go to system image
 #
-ifeq (,$(filter %_64,$(TARGET_PRODUCT)))
+ifeq (,$(filter %tangor %_64,$(TARGET_PRODUCT)))
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
 else
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
 endif
+
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
 
 # Enable CSI checking
diff --git a/bluetooth/bluetooth.mk b/bluetooth/bluetooth.mk
new file mode 100644
index 0000000..f203610
--- /dev/null
+++ b/bluetooth/bluetooth.mk
@@ -0,0 +1,4 @@
+PRODUCT_PACKAGES += \
+	android.hardware.bluetooth@1.1-service.bcmbtlinux
+
+BOARD_SEPOLICY_DIRS += device/google/gs101-sepolicy/bluetooth
diff --git a/conf/Android.bp b/conf/Android.bp
index 5e58678..45e6b6f 100644
--- a/conf/Android.bp
+++ b/conf/Android.bp
@@ -24,6 +24,12 @@
 // identical with the exception of the encryption settings, so to keep them in
 // sync the rules below generate them from a template file.
 
+soong_namespace {
+    imports: [
+        "device/google/gs101",
+    ],
+}
+
 package {
     // See: http://go/android-license-faq
     // A large-scale-change added 'default_applicable_licenses' to import
@@ -33,6 +39,11 @@
     default_applicable_licenses: ["device_google_gs101_license"],
 }
 
+filegroup {
+    name: "gs101_srcs",
+    srcs: ["fstab.gs101.in"],
+}
+
 genrule {
     name: "gen_fstab.gs101",
     srcs: ["fstab.gs101.in"],
diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc
index 4b41614..979343f 100644
--- a/conf/init.gs101.rc
+++ b/conf/init.gs101.rc
@@ -3,17 +3,6 @@
 import init.exynos.sensorhub.rc
 import /vendor/etc/init/hw/init.aoc.rc
 
-service vendor.charger /system/bin/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_all /vendor/etc/fstab.persist --early
 
@@ -441,9 +430,6 @@
     setprop vendor.all.modules.ready 1
     setprop vendor.all.devices.ready 1
 
-    # Update dm-verity state and set partition.*.verified properties
-    verity_update_state
-
     # Permission for Health Storage HAL
     chown system system /dev/sys/block/bootdevice/manual_gc
 
@@ -548,27 +534,27 @@
     chown system system /sys/devices/platform/exynos-drm/primary-panel/min_vrefresh
     chown system system /sys/devices/platform/exynos-drm/primary-panel/idle_delay_ms
     chown system system /sys/module/drm/parameters/vblankoffdelay
-    chown system system /sys/class/dqe/atc/ambient_light
-    chown system system /sys/class/dqe/atc/st
-    chown system system /sys/class/dqe/atc/en
-    chown system system /sys/class/dqe/atc/lt
-    chown system system /sys/class/dqe/atc/ns
-    chown system system /sys/class/dqe/atc/dither
-    chown system system /sys/class/dqe/atc/pl_w1
-    chown system system /sys/class/dqe/atc/pl_w2
-    chown system system /sys/class/dqe/atc/ctmode
-    chown system system /sys/class/dqe/atc/pp_en
-    chown system system /sys/class/dqe/atc/upgrade_on
-    chown system system /sys/class/dqe/atc/tdr_max
-    chown system system /sys/class/dqe/atc/tdr_min
-    chown system system /sys/class/dqe/atc/back_light
-    chown system system /sys/class/dqe/atc/dstep
-    chown system system /sys/class/dqe/atc/scale_mode
-    chown system system /sys/class/dqe/atc/threshold_1
-    chown system system /sys/class/dqe/atc/threshold_2
-    chown system system /sys/class/dqe/atc/threshold_3
-    chown system system /sys/class/dqe/atc/gain_limit
-    chown system system /sys/class/dqe/atc/lt_calc_ab_shift
+    chown system system /sys/class/dqe0/atc/ambient_light
+    chown system system /sys/class/dqe0/atc/st
+    chown system system /sys/class/dqe0/atc/en
+    chown system system /sys/class/dqe0/atc/lt
+    chown system system /sys/class/dqe0/atc/ns
+    chown system system /sys/class/dqe0/atc/dither
+    chown system system /sys/class/dqe0/atc/pl_w1
+    chown system system /sys/class/dqe0/atc/pl_w2
+    chown system system /sys/class/dqe0/atc/ctmode
+    chown system system /sys/class/dqe0/atc/pp_en
+    chown system system /sys/class/dqe0/atc/upgrade_on
+    chown system system /sys/class/dqe0/atc/tdr_max
+    chown system system /sys/class/dqe0/atc/tdr_min
+    chown system system /sys/class/dqe0/atc/back_light
+    chown system system /sys/class/dqe0/atc/dstep
+    chown system system /sys/class/dqe0/atc/scale_mode
+    chown system system /sys/class/dqe0/atc/threshold_1
+    chown system system /sys/class/dqe0/atc/threshold_2
+    chown system system /sys/class/dqe0/atc/threshold_3
+    chown system system /sys/class/dqe0/atc/gain_limit
+    chown system system /sys/class/dqe0/atc/lt_calc_ab_shift
     chown system system /sys/devices/platform/1c300000.drmdecon/early_wakeup
     chmod 0220 /sys/devices/platform/1c300000.drmdecon/early_wakeup
     chown system system /sys/devices/platform/1c302000.drmdecon/early_wakeup
@@ -598,11 +584,7 @@
     -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1p2p_device=1 \
     -m/vendor/etc/wifi/p2p_supplicant.conf \
     -g@android:wpa_wlan0 -dd
-    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
-    interface android.hardware.wifi.supplicant@1.3::ISupplicant default
-    interface android.hardware.wifi.supplicant@1.4::ISupplicant default
+    interface aidl android.hardware.wifi.supplicant.ISupplicant/default
     socket wpa_wlan0 dgram 660 wifi wifi
     class main
     disabled
@@ -654,6 +636,8 @@
     chown system system /sys/devices/virtual/sec/tsp/cmd
     chown system system /sys/devices/virtual/sec/tsp/cmd_result
     chown system system /sys/devices/virtual/sec/tsp/status
+    chown system system /sys/devices/virtual/input/nvt_touch/force_touch_active
+    chown system system /sys/devices/virtual/input/nvt_touch/nvt_dttw_mode
     # Allow access to touch
     chown system input /dev/touch_offload
     chmod 660 /dev/touch_offload
@@ -733,6 +717,8 @@
     write /sys/kernel/vendor_sched/dex2oat_uclamp_max 615
     write /dev/cpuctl/dex2oat/cpu.uclamp.max 60
     write /sys/kernel/vendor_sched/dex2oat_group_throttle 615
+    write /sys/kernel/vendor_sched/ota_uclamp_max 410
+    write /sys/kernel/vendor_sched/ota_group_throttle 410
 
     # Setup groups for SF (RT used for SF RE, SF used for SF main)
     write /sys/kernel/vendor_sched/rt_uclamp_min 125
@@ -759,12 +745,6 @@
     chown root system /sys/devices/platform/19000000.aoc/reset
     chmod 0220 /sys/devices/platform/19000000.aoc/reset
 
-# charger driver exposes now finer grain control, map demo mode to those properties
-# NOTE: demo mode can only be exit wiping data (which reset the persist properties)
-on property:sys.retaildemo.enabled=1
-    setprop persist.vendor.charge.stop.level 35
-    setprop persist.vendor.charge.start.level 30
-
 # Test Harness Mode default battery profile.
 on  property:persist.sys.test_harness=1 && property:persist.vendor.testing_battery_profile=0
     setprop persist.vendor.charge.stop.level 70
diff --git a/conf/nomodem/Android.bp b/conf/nomodem/Android.bp
new file mode 100644
index 0000000..1b1ae24
--- /dev/null
+++ b/conf/nomodem/Android.bp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+// By default this device uses hardware-wrapped keys for storage encryption,
+// which is intended to offer increased security over the traditional method
+// (software keys).  However, hardware-wrapped keys aren't compatible with
+// FIPS-140 certification of the encryption hardware, and hence we have to
+// disable the use of them in FIPS mode.  This requires having two fstab files:
+// one for the default mode, and one for FIPS mode selectable via
+// androidboot.fstab_suffix on the kernel command line.  These fstabs should be
+// identical with the exception of the encryption settings, so to keep them in
+// sync the rules below generate them from a template file.
+
+soong_namespace {
+    imports: [
+        "device/google/gs101",
+        "device/google/gs101/conf",
+    ],
+}
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_google_gs101_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["device_google_gs101_license"],
+}
+
+genrule {
+    name: "gen_fstab.gs101",
+    srcs: [
+        "fstab.gs101.in*",
+        ":gs101_srcs",
+        ],
+    out: ["fstab.gs101"],
+    cmd: "sed -e s/@fileencryption@/::inlinecrypt_optimized+wrappedkey_v0/" +
+        " -e s/@metadata_encryption@/:wrappedkey_v0/" +
+        " -e /modem/d " +
+        " -e /efs/d $(in) > $(out)",
+}
+
+genrule {
+    name: "gen_fstab.gs101-fips",
+    srcs: [
+        "fstab.gs101.in*",
+        ":gs101_srcs",
+        ],
+    out: ["fstab.gs101-fips"],
+    cmd: "sed -e s/@fileencryption@/aes-256-xts/" +
+        " -e s/@metadata_encryption@/aes-256-xts/" +
+        " -e /modem/d " +
+        " -e /efs/d $(in) > $(out)",
+}
+
+prebuilt_etc {
+    name: "fstab.gs101",
+    src: ":gen_fstab.gs101",
+    vendor: true,
+    vendor_ramdisk_available: true,
+}
+
+prebuilt_etc {
+    name: "fstab.gs101-fips",
+    src: ":gen_fstab.gs101-fips",
+    vendor: true,
+    vendor_ramdisk_available: true,
+}
\ No newline at end of file
diff --git a/device-common.mk b/device-common.mk
index 250de1c..cdafd12 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+-include vendor/google_devices/gs101/proprietary/telephony/device-vendor.mk
 include device/google/gs101/device.mk
 
 # Telephony
diff --git a/device.mk b/device.mk
index d0b3194..b4d31b9 100644
--- a/device.mk
+++ b/device.mk
@@ -14,9 +14,11 @@
 # limitations under the License.
 #
 
+include device/google/gs-common/device.mk
+
 TARGET_BOARD_PLATFORM := gs101
 
-ifneq (,$(filter %_64,$(TARGET_PRODUCT)))
+ifneq (,$(filter %tangor %_64,$(TARGET_PRODUCT)))
 LOCAL_64ONLY := _64
 endif
 
@@ -32,6 +34,14 @@
 # Set boot SPL
 BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
 
+# TODO(b/207450311): Remove this flag once implemented
+USE_PIXEL_GRALLOC := false
+ifeq ($(USE_PIXEL_GRALLOC),true)
+	PRODUCT_SOONG_NAMESPACES += hardware/google/gchips/GrallocHAL
+else
+	PRODUCT_SOONG_NAMESPACES += hardware/google/gchips/gralloc4
+endif
+
 PRODUCT_SOONG_NAMESPACES += \
 	hardware/google/av \
 	hardware/google/gchips \
@@ -40,6 +50,7 @@
 	hardware/google/interfaces \
 	hardware/google/pixel \
 	device/google/gs101 \
+	device/google/gs101/powerstats \
 	vendor/google/whitechapel/tools \
 	vendor/broadcom/bluetooth \
 	vendor/google/camera \
@@ -54,6 +65,10 @@
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
 	ro.oem_unlock_supported=1
 
+# Include vendor telephony soong namespace
+PRODUCT_SOONG_NAMESPACES += \
+	vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)
+
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
 #Set IKE logs to verbose for WFC
 PRODUCT_PROPERTY_OVERRIDES += log.tag.IKE=VERBOSE
@@ -87,7 +102,6 @@
 
 # From system.property
 PRODUCT_PROPERTY_OVERRIDES += \
-	dev.usbsetting.embedded=on \
 	ro.telephony.default_network=27 \
 	persist.vendor.ril.use.iccid_to_plmn=1 \
 	persist.vendor.ril.emergencynumber.mode=5
@@ -243,6 +257,12 @@
 PRODUCT_COPY_FILES += \
 	device/google/gs101/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.gs101.rc
 
+ifneq ($(BOARD_WITHOUT_RADIO),true)
+PRODUCT_SOONG_NAMESPACES += device/google/gs101/conf
+else
+PRODUCT_SOONG_NAMESPACES += device/google/gs101/conf/nomodem
+endif
+
 # Fstab files
 PRODUCT_PACKAGES += \
 	fstab.gs101 \
@@ -271,7 +291,7 @@
 
 # Contexthub HAL
 PRODUCT_PACKAGES += \
-	android.hardware.contexthub@1.2-service.generic
+    android.hardware.contexthub-service.generic
 
 # CHRE tools
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
@@ -342,6 +362,15 @@
 	frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
 
 # Sensors
+ifneq (,$(findstring tangor, $(TARGET_PRODUCT)))
+PRODUCT_COPY_FILES += \
+        frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
+        frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
+        frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
+        frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml\
+        frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
+        frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml
+else
 PRODUCT_COPY_FILES += \
 	frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
 	frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
@@ -352,6 +381,7 @@
 	frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
 	frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
 	frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml
+endif
 
 # Add sensor HAL 2.1 product packages
 PRODUCT_PACKAGES += android.hardware.sensors@2.1-service.multihal
@@ -534,7 +564,7 @@
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk)
 
 # Titan-M
-ifeq (,$(filter true, $(BOARD_WITHOUT_DTLS)))
+ifneq (,$(BOARD_HAS_DTLS))
 include hardware/google/pixel/dauntless/dauntless.mk
 endif
 
@@ -554,8 +584,13 @@
 	frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
 	frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml
 
+# (See b/211840489)
+ifneq ($(DISABLE_CAMERA_FS_AF),true)
 PRODUCT_COPY_FILES += \
-	frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
+	frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml
+endif
+
+PRODUCT_COPY_FILES += \
 	frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
 	frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \
 	frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml\
@@ -743,7 +778,9 @@
 endif
 
 # GPS HAL
+ifeq (,$(filter tangor citron,$(subst _, ,$(TARGET_PRODUCT))))
 include device/google/gs101/gnss/device-gnss.mk
+endif
 
 # Trusty (KM, GK, Storage)
 $(call inherit-product, system/core/trusty/trusty-storage.mk)
@@ -764,10 +801,7 @@
 PRODUCT_PROPERTY_OVERRIDES += \
 	ro.frp.pst=/dev/block/by-name/frp
 
-# Bluetooth HAL
-PRODUCT_PACKAGES += \
-	android.hardware.bluetooth@1.1-service.bcmbtlinux \
-	bt_vendor.conf
+# Bluetooth
 PRODUCT_COPY_FILES += \
 	frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
 	frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml
@@ -832,12 +866,11 @@
 	vts.bin
 
 # This will be called only if IMSService is building with source code for dev branches.
-$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-ims/device-vendor.mk)
+$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/shannon-ims/device-vendor.mk)
 
 PRODUCT_PACKAGES += ShannonIms
 
-$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-iwlan/device-vendor.mk)
-include device/google/gs101/telephony/pktrouter.mk
+$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/shannon-iwlan/device-vendor.mk)
 
 #RCS Test Messaging App
 PRODUCT_PACKAGES_DEBUG += \
@@ -863,10 +896,10 @@
 #$(call inherit-product, vendor/google_devices/gs101/proprietary/device-vendor.mk)
 
 ifneq ($(BOARD_WITHOUT_RADIO),true)
-$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/common/device-vendor.mk)
+$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device-vendor.mk)
 endif
 
-ifeq (,$(filter %_64,$(TARGET_PRODUCT)))
+ifeq (,$(filter %tangor %_64,$(TARGET_PRODUCT)))
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
 else
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
@@ -904,8 +937,8 @@
 	$(NULL)
 
 PRODUCT_PACKAGES += \
-	android.hardware.health@2.1-impl-gs101 \
-	android.hardware.health@2.1-service
+	android.hardware.health-service.gs101 \
+	android.hardware.health-service.gs101_recovery \
 
 # Audio
 # Audio HAL Server & Default Implementations
@@ -966,6 +999,8 @@
 
 $(call soong_config_set,aoc_audio_board,platform,$(TARGET_BOARD_PLATFORM))
 
+$(call soong_config_set,android_hardware_audio,run_64bit,true)
+
 # Audio properties
 PRODUCT_PROPERTY_OVERRIDES += \
 	ro.config.vc_call_vol_steps=7 \
@@ -1032,8 +1067,13 @@
 	vendor.samsung_slsi.hardware.tetheroffload@1.1-service
 
 # pKVM
+$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk)
+PRODUCT_BUILD_PVMFW_IMAGE := true
 ifeq ($(TARGET_PKVM_ENABLED),true)
-    $(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk)
+    PRODUCT_PACKAGES += pkvm_enabler
+else
+    PRODUCT_COPY_FILES += \
+	    device/google/gs101/pkvm/pkvm_experiment.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/pkvm_experiment.rc
 endif
 
 # Enable watchdog timeout loop breaker.
@@ -1065,6 +1105,9 @@
 # Telephony
 include device/google/gs101/telephony/user.mk
 
+# Wifi ext
+include hardware/google/pixel/wifi_ext/device.mk
+
 # Battery Stats Viewer
 PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer
 
diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml
index ba34409..c1274b8 100644
--- a/device_framework_matrix_product.xml
+++ b/device_framework_matrix_product.xml
@@ -57,7 +57,15 @@
         </interface>
     </hal>
     <hal format="aidl" optional="true">
+      <name>com.google.face.debug</name>
+        <interface>
+            <name>IDebugHost</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="aidl" optional="true">
       <name>com.google.edgetpu</name>
+        <version>2</version>
         <interface>
             <name>IEdgeTpuVendorService</name>
             <instance>default</instance>
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index f5d5862..45dbe62 100644
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -214,6 +214,7 @@
     // sessions or starts a new session after the one with performance issues).
     dumpLogs(fd, kCameraLogDir, cameraDestDir, 10, "session-ended-");
     dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "high-drop-rate-");
+    dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "watchdog-");
 }
 
 timepoint_t startSection(int fd, const std::string &sectionName) {
@@ -249,6 +250,7 @@
 
 DumpstateDevice::DumpstateDevice()
   : mTextSections{
+        { "pre-touch", [this](int fd) { dumpPreTouchSection(fd); } },
         { "wlan", [this](int fd) { dumpWlanSection(fd); } },
         { "soc", [this](int fd) { dumpSocSection(fd); } },
         { "storage", [this](int fd) { dumpStorageSection(fd); } },
@@ -347,6 +349,9 @@
         DumpFileToFd(fd, "maxfg_base", "/dev/logbuffer_maxfg_base_monitor");
         DumpFileToFd(fd, "maxfg_flip", "/dev/logbuffer_maxfg_flip_monitor");
     }
+    if (!stat("/sys/class/power_supply/dock", &buffer)) {
+        DumpFileToFd(fd, "Power supply property dock", "/sys/class/power_supply/dock/uevent");
+    }
 
     if (!stat("/dev/logbuffer_tcpm", &buffer)) {
         DumpFileToFd(fd, "Logbuffer TCPM", "/dev/logbuffer_tcpm");
@@ -487,6 +492,10 @@
                    "for f in /sys/class/thermal/cooling* ; do "
                        "type=`cat $f/type` ; temp=`cat $f/cur_state` ; echo \"$type: $temp\" ; "
                        "done"});
+    RunCommandToFd(fd, "Cooling Device Time in State", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; "
+                   "do type=`cat $f/type` ; temp=`cat $f/stats/time_in_state_ms` ; echo \"$type:\n$temp\" ; done"});
+    RunCommandToFd(fd, "Cooling Device Trans Table", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; "
+                   "do type=`cat $f/type` ; temp=`cat $f/stats/trans_table` ; echo \"$type:\n$temp\" ; done"});
     RunCommandToFd(fd, "Cooling Device State2Power Table", {"/vendor/bin/sh", "-c",
                    "for f in /sys/class/thermal/cooling* ; do "
                        "type=`cat $f/type` ; state2power_table=`cat $f/state2power_table` ; echo \"$type: $state2power_table\" ; "
@@ -500,6 +509,42 @@
 }
 
 // Dump items related to touch
+void DumpstateDevice::dumpPreTouchSection(int fd) {
+    const char nvt_spi_path[] = "/sys/devices/virtual/input/nvt_touch";
+    char cmd[256];
+
+    /* NVT touch */
+    if (!access(nvt_spi_path, R_OK)) {
+        snprintf(cmd, sizeof(cmd),
+                 "echo %s > %s/%s",
+                 "0x21",
+                 nvt_spi_path,
+                 "force_touch_active");
+        RunCommandToFd(fd, "Force Touch Active(Enable)", {"/vendor/bin/sh", "-c", cmd});
+
+        snprintf(cmd, sizeof(cmd), "/proc/nvt_fw_version");
+        if (!access(cmd, R_OK))
+            DumpFileToFd(fd, "FW version", cmd);
+
+#if 0	/* b/193467774: remove this temporarily */
+        snprintf(cmd, sizeof(cmd), "/proc/nvt_diff");
+        if (!access(cmd, R_OK))
+            DumpFileToFd(fd, "Diff", cmd);
+
+        snprintf(cmd, sizeof(cmd), "%s/nvt_fw_history", nvt_spi_path);
+        if (!access(nvt_spi_path, R_OK))
+            DumpFileToFd(fd, "FW History", cmd);
+#endif
+
+        snprintf(cmd, sizeof(cmd),
+                 "echo %s > %s/%s",
+                 "0x20",
+                 nvt_spi_path,
+                 "force_touch_active");
+        RunCommandToFd(fd, "Force Touch Active(Disable)", {"/vendor/bin/sh", "-c", cmd});
+    }
+}
+
 void DumpstateDevice::dumpTouchSection(int fd) {
     const char stm_cmd_path[4][50] = {"/sys/class/spi_master/spi11/spi11.0",
                                       "/proc/fts/driver_test",
@@ -978,6 +1023,7 @@
 void DumpstateDevice::dumpGscSection(int fd) {
     RunCommandToFd(fd, "Citadel VERSION", {"vendor/bin/hw/citadel_updater", "-lv"});
     RunCommandToFd(fd, "Citadel STATS", {"vendor/bin/hw/citadel_updater", "--stats"});
+    RunCommandToFd(fd, "GSC DEBUG DUMP", {"vendor/bin/hw/citadel_updater", "-D"});
 }
 
 // Dump essential camera debugging logs
diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h
index 74d0ce1..5cc3249 100644
--- a/dumpstate/DumpstateDevice.h
+++ b/dumpstate/DumpstateDevice.h
@@ -64,6 +64,7 @@
     void dumpWlanSection(int fd);
     void dumpPowerSection(int fd);
     void dumpThermalSection(int fd);
+    void dumpPreTouchSection(int fd);
     void dumpTouchSection(int fd);
     void dumpSocSection(int fd);
     void dumpCpuSection(int fd);
diff --git a/edgetpu/OWNERS b/edgetpu/OWNERS
new file mode 100644
index 0000000..9eb92a9
--- /dev/null
+++ b/edgetpu/OWNERS
@@ -0,0 +1,6 @@
+# Devs who work on EdgeTPU on Android.
+hsuy@google.com
+yuchicheng@google.com
+iayara@google.com
+qinyiyan@google.com
+macwang@google.com
\ No newline at end of file
diff --git a/health/Android.bp b/health/Android.bp
index 41a0e12..2bac61b 100644
--- a/health/Android.bp
+++ b/health/Android.bp
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package {
     // See: http://go/android-license-faq
     // A large-scale-change added 'default_applicable_licenses' to import
@@ -24,36 +23,39 @@
         "//device/google/gs101:device_google_gs101_license",
     ],
 }
-
-cc_library_shared {
-    name: "android.hardware.health@2.1-impl-gs101",
-    stem: "android.hardware.health@2.0-impl-2.1-gs101",
-
-    proprietary: true,
+cc_defaults {
+    name: "android.hardware.health-service.gs101-defaults",
+    defaults: [
+        "libhealth_aidl_impl_user",
+        "libhealth_aidl_charger_defaults",
+    ],
     relative_install_path: "hw",
+    vintf_fragments: ["android.hardware.health-service.gs101.xml"],
     srcs: [
         "Health.cpp",
     ],
-
     cflags: [
         "-Wall",
         "-Werror",
     ],
-
     static_libs: [
-        "android.hardware.health@1.0-convert",
-        "libbatterymonitor",
-        "libhealth2impl",
-        "libhealthloop",
+        "libhealth_aidl_impl",
     ],
-
+}
+cc_binary {
+    name: "android.hardware.health-service.gs101",
+    defaults: ["android.hardware.health-service.gs101-defaults"],
+    proprietary: true,
+    init_rc: ["android.hardware.health-service.gs101.rc"],
+    overrides: ["charger"],
     shared_libs: [
-        "libbase",
-        "libcutils",
-        "libhidlbase",
         "libpixelhealth",
-        "libutils",
-        "android.hardware.health@2.0",
-        "android.hardware.health@2.1",
     ],
 }
+cc_binary {
+    name: "android.hardware.health-service.gs101_recovery",
+    defaults: ["android.hardware.health-service.gs101-defaults"],
+    recovery: true,
+    init_rc: ["android.hardware.health-service.gs101_recovery.rc"],
+    overrides: ["charger.recovery"],
+}
diff --git a/health/Health.cpp b/health/Health.cpp
index fe8ad84..a50cc8b 100644
--- a/health/Health.cpp
+++ b/health/Health.cpp
@@ -19,17 +19,20 @@
 #include <android-base/file.h>
 #include <android-base/parseint.h>
 #include <android-base/strings.h>
-#include <android/hardware/health/2.0/types.h>
-#include <health2impl/Health.h>
+#include <android/hardware/health/translate-ndk.h>
+#include <health-impl/Health.h>
 #include <health/utils.h>
-#include <hal_conversion.h>
 
+// Recovery doesn't have libpixelhealth and charger mode
+#ifndef __ANDROID_RECOVERY__
+#include <health-impl/ChargerUtils.h>
 #include <pixelhealth/BatteryDefender.h>
 #include <pixelhealth/BatteryMetricsLogger.h>
 #include <pixelhealth/BatteryThermalControl.h>
 #include <pixelhealth/ChargerDetect.h>
 #include <pixelhealth/DeviceHealth.h>
 #include <pixelhealth/LowBatteryShutdownMetrics.h>
+#endif // !__ANDROID_RECOVERY__
 
 #include <chrono>
 #include <fstream>
@@ -41,15 +44,15 @@
 
 using namespace std::literals;
 
-using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo;
-using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo;
-using android::hardware::health::V2_0::DiskStats;
-using android::hardware::health::V2_0::StorageAttribute;
-using android::hardware::health::V2_0::StorageInfo;
-using android::hardware::health::V2_0::Result;
-using ::android::hardware::health::V2_1::IHealth;
+using aidl::android::hardware::health::DiskStats;
+using aidl::android::hardware::health::HalHealthLoop;
+using aidl::android::hardware::health::HealthInfo;
+using aidl::android::hardware::health::StorageInfo;
 using android::hardware::health::InitHealthdConfig;
 
+#ifndef __ANDROID_RECOVERY__
+using aidl::android::hardware::health::charger::ChargerCallback;
+using aidl::android::hardware::health::charger::ChargerModeMain;
 using hardware::google::pixel::health::BatteryDefender;
 using hardware::google::pixel::health::BatteryMetricsLogger;
 using hardware::google::pixel::health::BatteryThermalControl;
@@ -72,6 +75,7 @@
 static BatteryMetricsLogger battMetricsLogger(kBatteryResistance, kBatteryOCV);
 static LowBatteryShutdownMetrics shutdownMetrics(kVoltageAvg);
 static DeviceHealth deviceHealth;
+#endif // !__ANDROID_RECOVERY__
 
 #define UFS_DIR "/dev/sys/block/bootdevice"
 constexpr char kUfsHealthEol[]{UFS_DIR "/health_descriptor/eol_info"};
@@ -79,7 +83,6 @@
 constexpr char kUfsHealthLifetimeB[]{UFS_DIR "/health_descriptor/life_time_estimation_b"};
 constexpr char kUfsVersion[]{UFS_DIR "/device_descriptor/specification_version"};
 constexpr char kDiskStatsFile[]{"/sys/block/sda/stat"};
-constexpr char kUFSName[]{"UFS0"};
 
 static std::string ufs_version;
 static uint16_t eol;
@@ -88,8 +91,10 @@
 static std::chrono::system_clock::time_point ufs_last_query_time;
 constexpr auto kUfsQueryIntervalHours = std::chrono::hours{24};
 
+#ifndef __ANDROID_RECOVERY__
 static bool needs_wlc_updates = false;
 constexpr char kWlcCapacity[]{WLC_DIR "/capacity"};
+#endif // !__ANDROID_RECOVERY__
 
 std::ifstream assert_open(const std::string &path) {
   std::ifstream stream(path);
@@ -118,12 +123,10 @@
   info->version = ufs_version;
 }
 
-void fill_ufs_storage_attribute(StorageAttribute *attr) {
-  attr->isInternal = true;
-  attr->isBootDevice = true;
-  attr->name = kUFSName;
-}
-
+#ifdef __ANDROID_RECOVERY__
+void private_healthd_board_init(struct healthd_config *) {}
+int private_healthd_board_battery_update(HealthInfo *) { return 0; }
+#else // !__ANDROID__RECOVERY__
 static bool FileExists(const std::string &filename) {
   struct stat buffer;
 
@@ -140,26 +143,26 @@
   }
 }
 
-int private_healthd_board_battery_update(struct android::BatteryProperties *props) {
-  deviceHealth.update(props);
-  battThermalControl.updateThermalState(props);
-  battMetricsLogger.logBatteryProperties(props);
-  shutdownMetrics.logShutdownVoltage(props);
+int private_healthd_board_battery_update(HealthInfo *health_info) {
+  deviceHealth.update(health_info);
+  battThermalControl.updateThermalState(*health_info);
+  battMetricsLogger.logBatteryProperties(*health_info);
+  shutdownMetrics.logShutdownVoltage(*health_info);
   // Allow BatteryDefender to override online properties
-  ChargerDetect::onlineUpdate(props);
-  battDefender.update(props);
+  ChargerDetect::onlineUpdate(health_info);
+  battDefender.update(health_info);
 
   if (needs_wlc_updates &&
-      !android::base::WriteStringToFile(std::to_string(props->batteryLevel), kWlcCapacity))
+      !android::base::WriteStringToFile(std::to_string(health_info->batteryLevel), kWlcCapacity))
       LOG(INFO) << "Unable to write battery level to wireless capacity";
 
   return 0;
 }
+#endif // __ANDROID_RECOVERY__
 
-void private_get_storage_info(std::vector<StorageInfo> &vec_storage_info) {
-  vec_storage_info.resize(1);
-  StorageInfo *storage_info = &vec_storage_info[0];
-  fill_ufs_storage_attribute(&storage_info->attr);
+void private_get_storage_info(std::vector<StorageInfo> *vec_storage_info) {
+  vec_storage_info->resize(1);
+  StorageInfo *storage_info = &vec_storage_info->at(0);
 
   read_ufs_version(storage_info);
 
@@ -180,10 +183,9 @@
   return;
 }
 
-void private_get_disk_stats(std::vector<DiskStats> &vec_stats) {
-  vec_stats.resize(1);
-  DiskStats *stats = &vec_stats[0];
-  fill_ufs_storage_attribute(&stats->attr);
+void private_get_disk_stats(std::vector<DiskStats> *vec_stats) {
+  vec_stats->resize(1);
+  DiskStats *stats = &vec_stats->at(0);
 
   auto stream = assert_open(kDiskStatsFile);
   // Regular diskstats entries
@@ -195,18 +197,14 @@
 }
 }  // anonymous namespace
 
-namespace android {
-namespace hardware {
-namespace health {
-namespace V2_1 {
-namespace implementation {
+namespace aidl::android::hardware::health::implementation {
 class HealthImpl : public Health {
  public:
-  HealthImpl(std::unique_ptr<healthd_config>&& config)
-    : Health(std::move(config)) {}
+  HealthImpl(std::string_view instance_name, std::unique_ptr<healthd_config>&& config)
+    : Health(std::move(instance_name), std::move(config)) {}
 
-  Return<void> getStorageInfo(getStorageInfo_cb _hidl_cb) override;
-  Return<void> getDiskStats(getDiskStats_cb _hidl_cb) override;
+    ndk::ScopedAStatus getDiskStats(std::vector<DiskStats>* out) override;
+    ndk::ScopedAStatus getStorageInfo(std::vector<StorageInfo>* out) override;
 
  protected:
   void UpdateHealthInfo(HealthInfo* health_info) override;
@@ -214,53 +212,57 @@
 };
 
 void HealthImpl::UpdateHealthInfo(HealthInfo* health_info) {
-  struct BatteryProperties props;
-  convertFromHealthInfo(health_info->legacy.legacy, &props);
-  private_healthd_board_battery_update(&props);
-  convertToHealthInfo(&props, health_info->legacy.legacy);
+  private_healthd_board_battery_update(health_info);
 }
 
-Return<void> HealthImpl::getStorageInfo(getStorageInfo_cb _hidl_cb)
+ndk::ScopedAStatus HealthImpl::getStorageInfo(std::vector<StorageInfo>* out)
 {
-  std::vector<struct StorageInfo> info;
-  private_get_storage_info(info);
-  hidl_vec<struct StorageInfo> info_vec(info);
-  if (!info.size()) {
-      _hidl_cb(Result::NOT_SUPPORTED, info_vec);
-  } else {
-      _hidl_cb(Result::SUCCESS, info_vec);
+  private_get_storage_info(out);
+  if (out->empty()) {
+    return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
   }
-  return Void();
+  return ndk::ScopedAStatus::ok();
 }
 
-Return<void> HealthImpl::getDiskStats(getDiskStats_cb _hidl_cb)
+ndk::ScopedAStatus HealthImpl::getDiskStats(std::vector<DiskStats>* out)
 {
-  std::vector<struct DiskStats> stats;
-  private_get_disk_stats(stats);
-  hidl_vec<struct DiskStats> stats_vec(stats);
-  if (!stats.size()) {
-      _hidl_cb(Result::NOT_SUPPORTED, stats_vec);
-  } else {
-      _hidl_cb(Result::SUCCESS, stats_vec);
+  private_get_disk_stats(out);
+  if (out->empty()) {
+    return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
   }
-  return Void();
+  return ndk::ScopedAStatus::ok();
 }
 
-}  // namespace implementation
-}  // namespace V2_1
-}  // namespace health
-}  // namespace hardware
-}  // namespace android
+}  // namespace aidl::android::hardware::health::implementation
 
-extern "C" IHealth* HIDL_FETCH_IHealth(const char* instance) {
-  using ::android::hardware::health::V2_1::implementation::HealthImpl;
-  if (instance != "default"sv) {
-      return nullptr;
-  }
+int main(int argc, char **argv) {
+  using ::aidl::android::hardware::health::implementation::HealthImpl;
+
+  // Use kernel logging in recovery
+#ifdef __ANDROID_RECOVERY__
+  android::base::InitLogging(argv, android::base::KernelLogger);
+#endif
+
   auto config = std::make_unique<healthd_config>();
   InitHealthdConfig(config.get());
 
   private_healthd_board_init(config.get());
 
-  return new HealthImpl(std::move(config));
+  auto binder =
+      ndk::SharedRefBase::make<HealthImpl>("default"sv, std::move(config));
+
+  if (argc >= 2 && argv[1] == "--charger"sv) {
+    // In regular mode, start charger UI.
+#ifndef __ANDROID_RECOVERY__
+    LOG(INFO) << "Starting charger mode with UI.";
+    return ChargerModeMain(binder, std::make_shared<ChargerCallback>(binder));
+#endif
+    // In recovery, ignore --charger arg.
+    LOG(INFO) << "Starting charger mode without UI.";
+  } else {
+    LOG(INFO) << "Starting health HAL.";
+  }
+
+  auto hal_health_loop = std::make_shared<HalHealthLoop>(binder, binder);
+  return hal_health_loop->StartLoop();
 }
diff --git a/health/android.hardware.health-service.gs101.rc b/health/android.hardware.health-service.gs101.rc
new file mode 100644
index 0000000..b738b5c
--- /dev/null
+++ b/health/android.hardware.health-service.gs101.rc
@@ -0,0 +1,16 @@
+service vendor.health-gs101 /vendor/bin/hw/android.hardware.health-service.gs101
+    class hal
+    user system
+    group system
+    capabilities WAKE_ALARM BLOCK_SUSPEND
+    file /dev/kmsg w
+service vendor.charger-gs101 /vendor/bin/hw/android.hardware.health-service.gs101 --charger
+    class charger
+    seclabel u:r:charger_vendor: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
diff --git a/health/android.hardware.health-service.gs101.xml b/health/android.hardware.health-service.gs101.xml
new file mode 100644
index 0000000..98026cb
--- /dev/null
+++ b/health/android.hardware.health-service.gs101.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+    <hal format="aidl">
+        <name>android.hardware.health</name>
+        <version>1</version>
+        <fqname>IHealth/default</fqname>
+    </hal>
+</manifest>
diff --git a/health/android.hardware.health-service.gs101_recovery.rc b/health/android.hardware.health-service.gs101_recovery.rc
new file mode 100644
index 0000000..d1e3504
--- /dev/null
+++ b/health/android.hardware.health-service.gs101_recovery.rc
@@ -0,0 +1,7 @@
+service vendor.health-gs101 /system/bin/hw/android.hardware.health-service.gs101_recovery
+    class hal
+    seclabel u:r:hal_health_default:s0
+    user system
+    group system
+    capabilities WAKE_ALARM BLOCK_SUSPEND
+    file /dev/kmsg w
diff --git a/manifest-gralloc3.xml b/manifest-gralloc3.xml
deleted file mode 100644
index ca284df..0000000
--- a/manifest-gralloc3.xml
+++ /dev/null
@@ -1,231 +0,0 @@
-<manifest version="1.0" type="device" target-level="5">
-   <hal format="hidl">
-        <name>android.hardware.audio</name>
-        <transport>hwbinder</transport>
-        <version>7.0</version>
-        <interface>
-            <name>IDevicesFactory</name>
-            <instance>default</instance>
-        </interface>
-   </hal>
-   <hal format="hidl">
-        <name>android.hardware.audio.effect</name>
-        <transport>hwbinder</transport>
-        <version>7.0</version>
-        <interface>
-            <name>IEffectsFactory</name>
-            <instance>default</instance>
-        </interface>
-   </hal>
-   <hal format="hidl">
-        <name>android.hardware.soundtrigger</name>
-        <transport>hwbinder</transport>
-        <version>2.3</version>
-        <interface>
-            <name>ISoundTriggerHw</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.media.omx</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IOmx</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IOmxStore</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-	<hal format="hidl">
-		<name>android.hardware.graphics.allocator</name>
-		<transport>hwbinder</transport>
-		<version>2.0</version>
-		<interface>
-			<name>IAllocator</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-	<hal format="hidl">
-		<name>android.hardware.graphics.mapper</name>
-		<transport arch="32+64">passthrough</transport>
-		<version>2.0</version>
-		<interface>
-			<name>IMapper</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-	<hal format="hidl">
-		<name>android.hardware.graphics.composer</name>
-		<transport>hwbinder</transport>
-		<version>2.4</version>
-		<interface>
-			<name>IComposer</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-    <hal format="hidl">
-        <name>android.hardware.memtrack</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IMemtrack</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-	<hal format="hidl">
-		<name>android.hardware.renderscript</name>
-		<transport arch="32+64">passthrough</transport>
-		<version>1.0</version>
-		<interface>
-			<name>IDevice</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-    <hal format="hidl">
-        <name>android.hardware.drm</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ICryptoFactory</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IDrmFactory</name>
-            <instance>default</instance>
-        </interface>
-	<fqname>@1.3::ICryptoFactory/clearkey</fqname>
-        <fqname>@1.3::IDrmFactory/clearkey</fqname>
-        <fqname>@1.3::ICryptoFactory/widevine</fqname>
-        <fqname>@1.3::IDrmFactory/widevine</fqname>
-    </hal>
-    <hal format = "hidl">
-        <name>android.hardware.dumpstate</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IDumpstateDevice</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.bluetooth</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IBluetoothHci</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.bluetooth.audio</name>
-        <transport>hwbinder</transport>
-        <version>2.1</version>
-        <interface>
-            <name>IBluetoothAudioProvidersFactory</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.boot</name>
-        <transport>hwbinder</transport>
-        <fqname>@1.2::IBootControl/default</fqname>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.sensors</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ISensors</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.neuralnetworks</name>
-        <transport>hwbinder</transport>
-        <version>1.2</version>
-        <interface>
-            <name>IDevice</name>
-            <instance>armnn</instance>
-        </interface>
-        <fqname>@1.2::IDevice/armnn</fqname>
-    </hal>
-    <hal format="hidl">
-       <name>android.hardware.neuralnetworks</name>
-       <transport>hwbinder</transport>
-       <fqname>@1.3::IDevice/google-edgetpu</fqname>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.health</name>
-        <transport>hwbinder</transport>
-        <version>2.1</version>
-        <interface>
-            <name>IHealth</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="aidl">
-        <name>com.google.input</name>
-        <interface>
-            <name>ITouchContextService</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>hardware.google.bluetooth.bt_channel_avoidance</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IBTChannelAvoidance</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>hardware.google.bluetooth.sar</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IBluetoothSar</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>hardware.google.bluetooth.ccc</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IBluetoothCcc</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-      <name>vendor.google.google_battery</name>
-      <transport>hwbinder</transport>
-      <version>1.1</version>
-      <interface>
-        <name>IGoogleBattery</name>
-        <instance>default</instance>
-      </interface>
-    </hal>
-    <hal format="hidl">
-       <name>vendor.google.whitechapel.audio.audioext</name>
-       <transport>hwbinder</transport>
-       <version>2.0</version>
-       <interface>
-           <name>IAudioExt</name>
-           <instance>default</instance>
-       </interface>
-    </hal>
-    <hal format="hidl">
-       <name>vendor.google.audiometricext</name>
-       <transport>hwbinder</transport>
-       <version>1.0</version>
-       <interface>
-           <name>IAudioMetricExt</name>
-           <instance>default</instance>
-       </interface>
-    </hal>
-    <kernel target-level="6"/>
-</manifest>
diff --git a/manifest_64-gralloc3.xml b/manifest_64-gralloc3.xml
deleted file mode 100644
index 9dc7924..0000000
--- a/manifest_64-gralloc3.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-<manifest version="1.0" type="device" target-level="5">
-   <hal format="hidl">
-        <name>android.hardware.audio</name>
-        <transport>hwbinder</transport>
-        <version>7.0</version>
-        <interface>
-            <name>IDevicesFactory</name>
-            <instance>default</instance>
-        </interface>
-   </hal>
-   <hal format="hidl">
-        <name>android.hardware.audio.effect</name>
-        <transport>hwbinder</transport>
-        <version>7.0</version>
-        <interface>
-            <name>IEffectsFactory</name>
-            <instance>default</instance>
-        </interface>
-   </hal>
-   <hal format="hidl">
-        <name>android.hardware.soundtrigger</name>
-        <transport>hwbinder</transport>
-        <version>2.3</version>
-        <interface>
-            <name>ISoundTriggerHw</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-	<hal format="hidl">
-		<name>android.hardware.graphics.allocator</name>
-		<transport>hwbinder</transport>
-		<version>2.0</version>
-		<interface>
-			<name>IAllocator</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-	<hal format="hidl">
-		<name>android.hardware.graphics.mapper</name>
-		<transport arch="32+64">passthrough</transport>
-		<version>2.1</version>
-		<interface>
-			<name>IMapper</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-	<hal format="hidl">
-		<name>android.hardware.graphics.composer</name>
-		<transport>hwbinder</transport>
-		<version>2.4</version>
-		<interface>
-			<name>IComposer</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-    <hal format="hidl">
-        <name>android.hardware.memtrack</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IMemtrack</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-	<hal format="hidl">
-		<name>android.hardware.renderscript</name>
-		<transport arch="32+64">passthrough</transport>
-		<version>1.0</version>
-		<interface>
-			<name>IDevice</name>
-			<instance>default</instance>
-		</interface>
-	</hal>
-    <hal format="hidl">
-        <name>android.hardware.drm</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ICryptoFactory</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IDrmFactory</name>
-            <instance>default</instance>
-        </interface>
-	<fqname>@1.3::ICryptoFactory/clearkey</fqname>
-        <fqname>@1.3::IDrmFactory/clearkey</fqname>
-        <fqname>@1.3::ICryptoFactory/widevine</fqname>
-        <fqname>@1.3::IDrmFactory/widevine</fqname>
-    </hal>
-    <hal format = "hidl">
-        <name>android.hardware.dumpstate</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IDumpstateDevice</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.bluetooth</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IBluetoothHci</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.bluetooth.audio</name>
-        <transport>hwbinder</transport>
-        <version>2.1</version>
-        <interface>
-            <name>IBluetoothAudioProvidersFactory</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.boot</name>
-        <transport>hwbinder</transport>
-        <fqname>@1.2::IBootControl/default</fqname>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.sensors</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ISensors</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-<!--
-    <hal format="hidl">
-        <name>android.hardware.neuralnetworks</name>
-        <transport>hwbinder</transport>
-        <version>1.2</version>
-        <interface>
-            <name>IDevice</name>
-            <instance>armnn</instance>
-        </interface>
-        <fqname>@1.2::IDevice/armnn</fqname>
-    </hal>
--->
-    <hal format="hidl">
-       <name>android.hardware.neuralnetworks</name>
-       <transport>hwbinder</transport>
-       <fqname>@1.3::IDevice/google-edgetpu</fqname>
-    </hal>
-    <hal format="hidl">
-        <name>android.hardware.health</name>
-        <transport>hwbinder</transport>
-        <version>2.1</version>
-        <interface>
-            <name>IHealth</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="aidl">
-        <name>com.google.input</name>
-        <interface>
-            <name>ITouchContextService</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>hardware.google.bluetooth.bt_channel_avoidance</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IBTChannelAvoidance</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>hardware.google.bluetooth.sar</name>
-        <transport>hwbinder</transport>
-        <version>1.1</version>
-        <interface>
-            <name>IBluetoothSar</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-   <hal format="hidl">
-        <name>hardware.google.bluetooth.ccc</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>IBluetoothCcc</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-      <name>vendor.google.google_battery</name>
-      <transport>hwbinder</transport>
-      <version>1.1</version>
-      <interface>
-        <name>IGoogleBattery</name>
-        <instance>default</instance>
-      </interface>
-    </hal>
-    <hal format="hidl">
-       <name>vendor.google.whitechapel.audio.audioext</name>
-       <transport>hwbinder</transport>
-       <version>2.0</version>
-       <interface>
-           <name>IAudioExt</name>
-           <instance>default</instance>
-       </interface>
-    </hal>
-    <hal format="hidl">
-       <name>vendor.google.audiometricext</name>
-       <transport>hwbinder</transport>
-       <version>1.0</version>
-       <interface>
-           <name>IAudioMetricExt</name>
-           <instance>default</instance>
-       </interface>
-    </hal>
-    <kernel target-level="6"/>
-</manifest>
diff --git a/modem/user.mk b/modem/user.mk
index 81f3773..fb01f2c 100644
--- a/modem/user.mk
+++ b/modem/user.mk
@@ -1,2 +1,4 @@
-PRODUCT_PACKAGES += dmd
+ifneq ($(BOARD_WITHOUT_RADIO),true)
+  PRODUCT_PACKAGES += dmd
+endif
 BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/modem/user
diff --git a/modem/userdebug.mk b/modem/userdebug.mk
index 87697a7..4fcab64 100644
--- a/modem/userdebug.mk
+++ b/modem/userdebug.mk
@@ -1,2 +1,4 @@
-PRODUCT_PACKAGES += vcd
+ifneq ($(BOARD_WITHOUT_RADIO),true)
+  PRODUCT_PACKAGES += vcd
+endif
 BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/modem/userdebug/
diff --git a/pixelstats/pixelstats-vendor.gs101.rc b/pixelstats/pixelstats-vendor.gs101.rc
index 98af5fc..d324b6a 100644
--- a/pixelstats/pixelstats-vendor.gs101.rc
+++ b/pixelstats/pixelstats-vendor.gs101.rc
@@ -1,5 +1,5 @@
 on property:sys.boot_completed=1
-    start vendor.pixelstats_vendor
+	start vendor.pixelstats_vendor
 
 service vendor.pixelstats_vendor /vendor/bin/pixelstats-vendor
     class hal
diff --git a/pkvm/Android.bp b/pkvm/Android.bp
new file mode 100644
index 0000000..dba9601
--- /dev/null
+++ b/pkvm/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: [
+        "//device/google/gs101:device_google_gs101_license",
+    ],
+}
+
+cc_binary {
+    name: "pkvm_enabler",
+    vendor: true,
+    init_rc: ["pkvm_enabler.gs101.rc"],
+    srcs: ["pkvm_enabler.c"],
+    shared_libs: ["liblog"],
+}
diff --git a/pkvm/pkvm_enabler.c b/pkvm/pkvm_enabler.c
new file mode 100644
index 0000000..cb14ba6
--- /dev/null
+++ b/pkvm/pkvm_enabler.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2021 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     "pkvm_enabler"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <log/log.h>
+
+#define KVM_DEVICE  "/dev/kvm"
+#define MISC_WRITER "/vendor/bin/misc_writer"
+
+int main() {
+    char *newargv[] = { MISC_WRITER, "--set-enable-pkvm", NULL };
+    char *newenvp[] = { NULL };
+    pid_t pid;
+    int ret, wstatus;
+
+    /* Check whether KVM device exists. */
+    ret = access(KVM_DEVICE, F_OK);
+
+    /* If KVM device exists, return SUCCESS to continue booting. */
+    if (ret == 0) {
+        exit(EXIT_SUCCESS);
+    }
+
+    if (ret != -ENOENT) {
+        ALOGW("Unexpected error from access(): %d", ret);
+    }
+
+    /*
+     * If KVM device does not exist, run misc_writer and return FAILURE
+     * to force a reboot.
+     */
+    pid = fork();
+    if (pid == -1) {
+        ALOGE("Could not fork: %d", errno);
+        exit(EXIT_FAILURE);
+    }
+
+    if (pid == 0) {
+        execve(MISC_WRITER, newargv, newenvp);
+        ALOGE("Could not execute " MISC_WRITER ": %d", errno);
+        _exit(EXIT_FAILURE);
+    }
+
+    waitpid(pid, &wstatus, 0);
+    if (WIFEXITED(wstatus)) {
+        ret = WEXITSTATUS(wstatus);
+        if (ret) {
+            ALOGE(MISC_WRITER " exit status: %d", ret);
+        }
+    } else {
+        ALOGE(MISC_WRITER " terminated unexpectedly: %d", wstatus);
+    }
+
+    exit(EXIT_FAILURE);
+}
diff --git a/pkvm/pkvm_enabler.gs101.rc b/pkvm/pkvm_enabler.gs101.rc
new file mode 100644
index 0000000..6f329d3
--- /dev/null
+++ b/pkvm/pkvm_enabler.gs101.rc
@@ -0,0 +1,5 @@
+service pkvm_enabler /vendor/bin/pkvm_enabler
+    reboot_on_failure reboot,pkvm-not-enabled
+
+on early-init
+    exec_start pkvm_enabler
\ No newline at end of file
diff --git a/pkvm/pkvm_experiment.rc b/pkvm/pkvm_experiment.rc
new file mode 100644
index 0000000..148f084
--- /dev/null
+++ b/pkvm/pkvm_experiment.rc
@@ -0,0 +1,13 @@
+service vendor.pkvm_enable /vendor/bin/misc_writer --set-enable-pkvm
+    disabled
+    oneshot
+
+service vendor.pkvm_disable /vendor/bin/misc_writer --set-disable-pkvm
+    disabled
+    oneshot
+
+on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=true
+    start vendor.pkvm_enable
+
+on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=false
+    start vendor.pkvm_disable
diff --git a/powerhint.json b/powerhint.json
index 54f62b3..d390d61 100644
--- a/powerhint.json
+++ b/powerhint.json
@@ -26,7 +26,11 @@
         "9999999",
         "1098000",
         "1401000",
-        "1197000"
+        "930000",
+        "1197000",
+        "1328000",
+        "1598000",
+        "1803000"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
@@ -48,8 +52,12 @@
         "9999999",
         "1024000",
         "1197000",
-        "1999000",
-        "1491000"
+        "1491000",
+        "910000",
+        "1328000",
+        "1663000",
+        "1836000",
+        "1999000"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
@@ -71,7 +79,12 @@
         "9999999",
         "984000",
         "1426000",
-        "1826000"
+        "1826000",
+        "1277000",
+        "1582000",
+        "1745000",
+        "2048000",
+        "2401000"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
@@ -1033,6 +1046,96 @@
       "Value": "9999999"
     },
     {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_50",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "930000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_60",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1197000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_70",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1328000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_80",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1598000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_90",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1803000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_50",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "910000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_60",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1328000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_70",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1663000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_80",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1836000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_90",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1999000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_50",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1277000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_60",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1582000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_70",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1745000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_80",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "2048000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_90",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "2401000"
+    },
+    {
       "PowerHint": "REFRESH_120FPS",
       "Node": "TAUClampBoost",
       "Duration": 0,
diff --git a/powerstats/Android.bp b/powerstats/Android.bp
index 10ecbed..74b7242 100644
--- a/powerstats/Android.bp
+++ b/powerstats/Android.bp
@@ -11,6 +11,14 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
+
+soong_namespace {
+    imports: [
+        "hardware/google/pixel",
+        "device/google/gs-common/powerstats",
+    ],
+}
+
 package {
     // See: http://go/android-license-faq
     // A large-scale-change added 'default_applicable_licenses' to import
@@ -33,6 +41,7 @@
     ],
 
     shared_libs: [
+        "android.hardware.power.stats-impl.gs-common",
         "android.hardware.power.stats-impl.pixel",
     ],
 }
diff --git a/powerstats/AocStateResidencyDataProvider.cpp b/powerstats/AocStateResidencyDataProvider.cpp
deleted file mode 100644
index c64496d..0000000
--- a/powerstats/AocStateResidencyDataProvider.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "AocStateResidencyDataProvider.h"
-
-#include <android-base/logging.h>
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector<std::pair<std::string,
-        std::string>> ids, std::vector<std::pair<std::string, std::string>> states) {
-    // AoC stats are reported in ticks of 244.140625ns. The transform
-    // function converts ticks to milliseconds.
-    // 1000000 / 244.140625 = 4096.
-    static const uint64_t AOC_CLK = 4096;
-    std::function<uint64_t(uint64_t)> aocTickToMs = [](uint64_t a) { return a / AOC_CLK; };
-    GenericStateResidencyDataProvider::StateResidencyConfig config = {
-            .entryCountSupported = true,
-            .entryCountPrefix = "Counter:",
-            .totalTimeSupported = true,
-            .totalTimePrefix = "Cumulative time:",
-            .totalTimeTransform = aocTickToMs,
-            .lastEntrySupported = true,
-            .lastEntryPrefix = "Time last entered:",
-            .lastEntryTransform = aocTickToMs,
-    };
-    for (const auto &id : ids) {
-        for (const auto &state : states) {
-            std::vector<std::pair<std::string, std::string>> aocStateHeaders = {
-                std::make_pair(state.first, ""),
-            };
-            std::vector<GenericStateResidencyDataProvider::PowerEntityConfig> cfgs;
-            cfgs.emplace_back(generateGenericStateResidencyConfigs(config, aocStateHeaders),
-                    id.first, "");
-            std::unique_ptr<GenericStateResidencyDataProvider> sdp(
-                    new GenericStateResidencyDataProvider(id.second + state.second, cfgs));
-            mProviders[id.first].push_back(std::move(sdp));
-        }
-    }
-}
-
-bool AocStateResidencyDataProvider::getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) {
-    // States from the same power entity are merged.
-    bool ret = true;
-    for (const auto &providerList : mProviders) {
-        int32_t stateId = 0;
-        std::string curEntity = providerList.first;
-        std::vector<StateResidency> stateResidencies;
-
-        // Iterate over each provider in the providerList, appending each of the states
-        for (const auto &provider : providerList.second) {
-            std::unordered_map<std::string, std::vector<StateResidency>> residency;
-            ret &= provider->getStateResidencies(&residency);
-
-            // Each provider should only return data for curEntity but checking anyway
-            if (residency.find(curEntity) != residency.end()) {
-                for (auto &r : residency.at(curEntity)) {
-                    /*
-                     * Modifying stateId here because we are stitching together infos from
-                     * multiple GenericStateResidencyDataProviders. stateId must be modified
-                     * to maintain uniqueness for a given entity
-                     */
-                    r.id = stateId++;
-                    stateResidencies.push_back(r);
-                }
-            }
-        }
-
-        residencies->emplace(curEntity, stateResidencies);
-    }
-    return ret;
-}
-
-std::unordered_map<std::string, std::vector<State>> AocStateResidencyDataProvider::getInfo() {
-    // States from the same power entity are merged
-    std::unordered_map<std::string, std::vector<State>> infos;
-    for (const auto &providerList : mProviders) {
-        int32_t stateId = 0;
-        std::string curEntity = providerList.first;
-        std::vector<State> stateInfos;
-
-        // Iterate over each provider in the providerList, appending each of the states
-        for (const auto &provider : providerList.second) {
-            std::unordered_map<std::string, std::vector<State>> info = provider->getInfo();
-
-            // Each provider should only return data for curEntity but checking anyway
-            if (info.find(curEntity) != info.end()) {
-                for (auto &i : info.at(curEntity)) {
-                    /*
-                     * Modifying stateId because we are stitching together infos from
-                     * multiple GenericStateResidencyDataProviders. stateId must be modified
-                     * to maintain uniqueness for a given entity
-                     */
-                    i.id = stateId++;
-                    stateInfos.push_back(i);
-                }
-            }
-        }
-
-        infos.emplace(curEntity, stateInfos);
-    }
-
-    return infos;
-}
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/powerstats/AocStateResidencyDataProvider.h b/powerstats/AocStateResidencyDataProvider.h
deleted file mode 100644
index 5008912..0000000
--- a/powerstats/AocStateResidencyDataProvider.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <dataproviders/GenericStateResidencyDataProvider.h>
-#include <PowerStatsAidl.h>
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-class AocStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
-  public:
-    AocStateResidencyDataProvider(std::vector<std::pair<std::string, std::string>> ids,
-                                  std::vector<std::pair<std::string, std::string>> states);
-    ~AocStateResidencyDataProvider() = default;
-    bool getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
-    std::unordered_map<std::string, std::vector<State>> getInfo() override;
-
-  private:
-    std::unordered_map<std::string /* entity name */,
-        std::vector<std::unique_ptr<GenericStateResidencyDataProvider>> /* providers */> mProviders;
-};
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
\ No newline at end of file
diff --git a/powerstats/DevfreqStateResidencyDataProvider.cpp b/powerstats/DevfreqStateResidencyDataProvider.cpp
deleted file mode 100644
index d59e1e5..0000000
--- a/powerstats/DevfreqStateResidencyDataProvider.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2021 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 "DevfreqStateResidencyDataProvider.h"
-
-#include <android-base/logging.h>
-
-static const std::string nameSuffix = "-DVFS";
-static const std::string pathSuffix = "/time_in_state";
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-DevfreqStateResidencyDataProvider::DevfreqStateResidencyDataProvider(const std::string& name,
-        const std::string& path) : mName(name + nameSuffix), mPath(path + pathSuffix) {}
-
-bool DevfreqStateResidencyDataProvider::extractNum(const char *str, char **str_end, int base,
-        int64_t* num) {
-    // errno can be set to any non-zero value by a library function call
-    // regardless of whether there was an error, so it needs to be cleared
-    // in order to check the error set by strtoll
-    errno = 0;
-    *num = std::strtoll(str, str_end, base);
-    return (errno != ERANGE);
-}
-
-std::vector<std::pair<int64_t, int64_t>> DevfreqStateResidencyDataProvider::parseTimeInState() {
-    // Using FILE* instead of std::ifstream for performance reasons
-    std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(mPath.c_str(), "r"), fclose);
-    if (!fp) {
-        PLOG(ERROR) << "Failed to open file " << mPath;
-        return {};
-    }
-
-    std::vector<std::pair<int64_t, int64_t>> timeInState;
-
-    char *line = nullptr;
-    size_t len = 0;
-    while (getline(&line, &len, fp.get()) != -1) {
-        char* pEnd;
-        int64_t frequencyHz, totalTimeMs;
-        if (!extractNum(line, &pEnd, 10, &frequencyHz) ||
-            !extractNum(pEnd, &pEnd, 10, &totalTimeMs)) {
-            PLOG(ERROR) << "Failed to parse " << mPath;
-            free(line);
-            return {};
-        }
-
-        timeInState.push_back({frequencyHz, totalTimeMs});
-    }
-
-    free(line);
-    return timeInState;
-}
-
-bool DevfreqStateResidencyDataProvider::getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) {
-    std::vector<std::pair<int64_t, int64_t>> timeInState = parseTimeInState();
-
-    if (timeInState.empty()) {
-        return false;
-    }
-
-    int32_t id = 0;
-    std::vector<StateResidency> stateResidencies;
-    for (const auto[frequencyHz, totalTimeMs] : timeInState) {
-        StateResidency s = {.id = id++, .totalTimeInStateMs = totalTimeMs};
-        stateResidencies.push_back(s);
-    }
-
-    residencies->emplace(mName, stateResidencies);
-    return true;
-}
-
-std::unordered_map<std::string, std::vector<State>> DevfreqStateResidencyDataProvider::getInfo() {
-    std::vector<std::pair<int64_t, int64_t>> timeInState = parseTimeInState();
-
-    if (timeInState.empty()) {
-        return {};
-    }
-
-    int32_t id = 0;
-    std::vector<State> states;
-    for (const auto[frequencyHz, totalTimeMs] : timeInState) {
-        State s = {.id = id++, .name = std::to_string(frequencyHz / 1000) + "MHz"};
-        states.push_back(s);
-    }
-
-    return {{mName, states}};
-}
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/powerstats/DevfreqStateResidencyDataProvider.h b/powerstats/DevfreqStateResidencyDataProvider.h
deleted file mode 100644
index 8341b43..0000000
--- a/powerstats/DevfreqStateResidencyDataProvider.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <PowerStatsAidl.h>
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-class DevfreqStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
-  public:
-    DevfreqStateResidencyDataProvider(const std::string& name, const std::string& path);
-    ~DevfreqStateResidencyDataProvider() = default;
-
-    /*
-     * See IStateResidencyDataProvider::getStateResidencies
-     */
-    bool getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
-
-    /*
-     * See IStateResidencyDataProvider::getInfo
-     */
-    std::unordered_map<std::string, std::vector<State>> getInfo() override;
-
-  private:
-    bool extractNum(const char *str, char **str_end, int base, int64_t* num);
-    std::vector<std::pair<int64_t, int64_t>> parseTimeInState();
-    const std::string mName;
-    const std::string mPath;
-};
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/powerstats/DvfsStateResidencyDataProvider.cpp b/powerstats/DvfsStateResidencyDataProvider.cpp
deleted file mode 100644
index 511159e..0000000
--- a/powerstats/DvfsStateResidencyDataProvider.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "DvfsStateResidencyDataProvider.h"
-
-#include <android-base/logging.h>
-#include <android-base/parseint.h>
-#include <android-base/strings.h>
-
-#include <string>
-#include <utility>
-
-using android::base::ParseUint;
-using android::base::Split;
-using android::base::StartsWith;
-using android::base::Trim;
-
-static const std::string nameSuffix = "-DVFS";
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-DvfsStateResidencyDataProvider::DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate,
-        std::vector<Config> cfgs)
-    : mPath(std::move(path)), mClockRate(clockRate), mPowerEntities(std::move(cfgs)) {}
-
-int32_t DvfsStateResidencyDataProvider::matchEntity(char const *line) {
-    for (int32_t i = 0; i < mPowerEntities.size(); i++) {
-        if (mPowerEntities[i].powerEntityName == Trim(std::string(line))) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-int32_t DvfsStateResidencyDataProvider::matchState(char const *line, const Config& powerEntity) {
-    for (int32_t i = 0; i < powerEntity.states.size(); i++) {
-        if (StartsWith(Trim(std::string(line)), powerEntity.states[i].second)) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-bool DvfsStateResidencyDataProvider::parseState(char const *line, uint64_t *duration,
-        uint64_t *count) {
-    std::vector<std::string> parts = Split(line, " ");
-    if (parts.size() != 7) {
-        return false;
-    }
-    if (!ParseUint(Trim(parts[3]), count)) {
-        return false;
-    }
-    if (!ParseUint(Trim(parts[6]), duration)) {
-        return false;
-    }
-    return true;
-}
-
-bool DvfsStateResidencyDataProvider::getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) {
-    std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(mPath.c_str(), "r"), fclose);
-    if (!fp) {
-        PLOG(ERROR) << __func__ << ":Failed to open file " << mPath;
-        return false;
-    }
-
-    for (const Config &powerEntity : mPowerEntities) {
-        std::vector<StateResidency> stateResidency(powerEntity.states.size());
-        for (int32_t i = 0; i < stateResidency.size(); i++) {
-            stateResidency[i].id = i;
-        }
-        residencies->emplace(powerEntity.powerEntityName + nameSuffix, stateResidency);
-    }
-
-    size_t len = 0;
-    char *line = nullptr;
-
-    int32_t temp, powerEntityIndex, stateId = -1;
-    uint64_t duration, count;
-    auto it = residencies->end();
-
-    while (getline(&line, &len, fp.get()) != -1) {
-        temp = matchEntity(line);
-        // Assign new index only when a new valid entity is encountered.
-        if (temp >= 0) {
-            powerEntityIndex = temp;
-            it = residencies->find(mPowerEntities[powerEntityIndex].powerEntityName + nameSuffix);
-        }
-
-        if (it != residencies->end()) {
-            stateId = matchState(line, mPowerEntities[powerEntityIndex]);
-
-            if (stateId >= 0) {
-                if (parseState(line, &duration, &count)) {
-                    it->second[stateId].totalTimeInStateMs =
-                            duration / mClockRate;
-                    it->second[stateId].totalStateEntryCount = count;
-                } else {
-                    LOG(ERROR) << "Failed to parse duration and count from [" << std::string(line)
-                               << "]";
-                    return false;
-                }
-            }
-        }
-    }
-
-    free(line);
-
-    return true;
-}
-
-std::unordered_map<std::string, std::vector<State>> DvfsStateResidencyDataProvider::getInfo() {
-    std::unordered_map<std::string, std::vector<State>> info;
-    for (auto const &entity : mPowerEntities) {
-        std::vector<State> stateInfo(entity.states.size());
-        int32_t stateId = 0;
-        for (auto const &state : entity.states) {
-            stateInfo[stateId] = State{
-                .id = stateId,
-                .name = state.first
-            };
-            stateId++;
-        }
-        info.emplace(entity.powerEntityName + nameSuffix, stateInfo);
-    }
-    return info;
-}
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/powerstats/DvfsStateResidencyDataProvider.h b/powerstats/DvfsStateResidencyDataProvider.h
deleted file mode 100644
index ca8ab22..0000000
--- a/powerstats/DvfsStateResidencyDataProvider.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <PowerStatsAidl.h>
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-class DvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
-  public:
-    class Config {
-      public:
-        // Power entity name to parse.
-        std::string powerEntityName;
-
-        // List of state pairs (name to display, name to parse).
-        std::vector<std::pair<std::string, std::string>> states;
-    };
-    /*
-     * path - path to dvfs sysfs node.
-     * clockRate - clock rate in KHz.
-     */
-    DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, std::vector<Config> cfgs);
-    ~DvfsStateResidencyDataProvider() = default;
-
-    /*
-     * See IStateResidencyDataProvider::getStateResidencies
-     */
-    bool getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
-
-    /*
-     * See IStateResidencyDataProvider::getInfo
-     */
-    std::unordered_map<std::string, std::vector<State>> getInfo() override;
-
-  private:
-    int32_t matchEntity(char const *line);
-    int32_t matchState(char const *line, const Config& powerEntity);
-    bool parseState(char const *line, uint64_t *duration, uint64_t *count);
-
-    const std::string mPath;
-    const uint64_t mClockRate;
-    std::vector<Config> mPowerEntities;
-};
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/powerstats/Gs101CommonDataProviders.cpp b/powerstats/Gs101CommonDataProviders.cpp
index e156b7b..98cdb85 100644
--- a/powerstats/Gs101CommonDataProviders.cpp
+++ b/powerstats/Gs101CommonDataProviders.cpp
@@ -613,7 +613,7 @@
 
     p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndAttrConsumer(p,
             EnergyConsumerType::OTHER, "TPU", {"S10M_VDD_TPU"},
-            {{UID_TIME_IN_STATE, "/sys/class/edgetpu/abrolhos/device/tpu_usage"}},
+            {{UID_TIME_IN_STATE, "/sys/class/edgetpu/edgetpu-soc/device/tpu_usage"}},
             stateCoeffs));
 }
 
diff --git a/powerstats/UfsStateResidencyDataProvider.cpp b/powerstats/UfsStateResidencyDataProvider.cpp
deleted file mode 100644
index aec7724..0000000
--- a/powerstats/UfsStateResidencyDataProvider.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2021 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 "UfsStateResidencyDataProvider.h"
-
-#include <android-base/logging.h>
-#include <android-base/parseint.h>
-#include <android-base/strings.h>
-
-#include <string>
-#include <utility>
-
-using android::base::ParseInt;
-using android::base::Split;
-using android::base::StartsWith;
-using android::base::Trim;
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-const int32_t HIBERNATE_STATE_ID = 0;
-const std::string UFS_NAME = "UFS";
-
-UfsStateResidencyDataProvider::UfsStateResidencyDataProvider(std::string prefix) : kPrefix(prefix) {}
-
-bool UfsStateResidencyDataProvider::getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) {
-    StateResidency residency;
-    residency.id = HIBERNATE_STATE_ID;
-
-        // The transform function converts microseconds to milliseconds.
-    std::function<uint64_t(uint64_t)> usecToMs = [](uint64_t a) { return a / 1000; };
-
-    residency.totalTimeInStateMs = usecToMs(readStat(kPrefix + "hibern8_total_us"));
-    residency.totalStateEntryCount = readStat(kPrefix + "hibern8_exit_cnt");
-    residency.lastEntryTimestampMs = usecToMs(readStat(kPrefix + "last_hibern8_enter_time"));
-
-    residencies->emplace(UFS_NAME, std::vector<StateResidency>{residency});
-    return true;
-}
-
-std::unordered_map<std::string, std::vector<State>> UfsStateResidencyDataProvider::getInfo() {
-    return {{UFS_NAME, std::vector<State>{{HIBERNATE_STATE_ID, "HIBERN8"}} }};
-}
-
-int64_t UfsStateResidencyDataProvider::readStat(std::string path) {
-    std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(path.c_str(), "r"), fclose);
-    if (!fp) {
-        PLOG(ERROR) << __func__ << ":Failed to open file " << path
-                    << " Error = " << strerror(errno);
-        return 0;
-    }
-    const size_t size = 20;
-    char buf[size];
-    (void)fread(&buf, sizeof(char), size, fp.get());
-    int64_t ret;
-    if (!ParseInt(Trim(std::string(buf)), &ret)) {
-        LOG(ERROR) << "Failed to parse int64 from [" << std::string(buf) << "]";
-    }
-    return ret;
-}
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/powerstats/UfsStateResidencyDataProvider.h b/powerstats/UfsStateResidencyDataProvider.h
deleted file mode 100644
index f4ef268..0000000
--- a/powerstats/UfsStateResidencyDataProvider.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <PowerStatsAidl.h>
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace power {
-namespace stats {
-
-class UfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
-  public:
-    UfsStateResidencyDataProvider(std::string prefix);
-    ~UfsStateResidencyDataProvider() = default;
-
-    /*
-     * See IStateResidencyDataProvider::getStateResidencies
-     */
-    bool getStateResidencies(
-        std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
-
-    /*
-     * See IStateResidencyDataProvider::getInfo
-     */
-    std::unordered_map<std::string, std::vector<State>> getInfo() override;
-
-  private:
-    int64_t readStat(std::string path);
-
-    const std::string kPrefix;
-};
-
-}  // namespace stats
-}  // namespace power
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/rro_overlays/WifiOverlay/res/values/config.xml b/rro_overlays/WifiOverlay/res/values/config.xml
index 4e5d4bf..1a7681e 100644
--- a/rro_overlays/WifiOverlay/res/values/config.xml
+++ b/rro_overlays/WifiOverlay/res/values/config.xml
@@ -132,4 +132,13 @@
     <bool translatable="false" name="config_wifiDefaultCoexAlgorithmEnabled">true</bool>
     <!-- Whether to use the explicit vendor HAL API: IWifiStaIface.setRoamingState for disabling fw roaming. -->
     <bool translatable="false" name="config_wifiUseHalApiToDisableFwRoaming">true</bool>
+
+    <!-- Indicate the driver doesn't support NL80211 Reg changed event -->
+    <bool translatable="false" name="config_wifiDriverSupportedNl80211RegChangedEvent">false</bool>
+
+    <!-- Indicate whether the verbose logging is always on -->
+    <!-- 0: verbose logging controlled by user
+         1: verbose logging on by default for userdebug
+         2: verbose logging on by default for all builds -->
+    <integer translatable="false" name="config_wifiVerboseLoggingAlwaysOnLevel">1</integer>
 </resources>
diff --git a/task_profiles.json b/task_profiles.json
index fca5a07..b6f54c9 100644
--- a/task_profiles.json
+++ b/task_profiles.json
@@ -74,7 +74,7 @@
           "Params":
           {
             "Controller": "cpu",
-            "Path": "system"
+            "Path": "dex2oat"
           }
         },
         {
@@ -89,6 +89,28 @@
       ]
     },
     {
+      "Name": "OtaPerformance",
+      "Actions": [
+        {
+          "Name": "JoinCgroup",
+          "Params":
+          {
+            "Controller": "cpu",
+            "Path": "dex2oat"
+          }
+        },
+        {
+          "Name": "WriteFile",
+          "Params":
+          {
+            "FilePath": "/sys/kernel/vendor_sched/set_task_group_ota",
+            "Value": "<pid>",
+            "LogFailures": "false"
+          }
+        }
+      ]
+    },
+    {
       "Name": "CameraServiceHighCapacity",
       "Actions": [
         {
@@ -135,7 +157,7 @@
           "Params":
           {
             "Controller": "cpu",
-            "Path": "system"
+            "Path": "background"
           }
         },
         {
@@ -245,7 +267,7 @@
           "Params":
           {
             "Controller": "cpu",
-            "Path": "system"
+            "Path": "system-background"
           }
         },
         {
@@ -337,6 +359,10 @@
     {
       "Name": "Dex2OatBootComplete",
       "Profiles": [ "Dex2oatPerformance", "ProcessCapacityNormal", "LowIoPriority", "TimerSlackHigh" ]
+    },
+    {
+      "Name": "OtaProfiles",
+      "Profiles": [ "OtaPerformance", "ProcessCapacityNormal", "LowIoPriority", "TimerSlackHigh" ]
     }
   ]
 }
diff --git a/telephony/user.mk b/telephony/user.mk
index 983a19a..f75596f 100644
--- a/telephony/user.mk
+++ b/telephony/user.mk
@@ -1,2 +1,2 @@
-PRODUCT_COPY_FILES += vendor/samsung_slsi/telephony/common/device/samsung/init.radio.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.radio.sh
+PRODUCT_COPY_FILES += vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device/samsung/init.radio.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.radio.sh
 BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs101-sepolicy/telephony/user/
diff --git a/vendor_dlkm.blocklist b/vendor_dlkm.blocklist
index b259ab6..4f7b6fd 100644
--- a/vendor_dlkm.blocklist
+++ b/vendor_dlkm.blocklist
@@ -1,4 +1,5 @@
 blocklist bcmdhd43752
+blocklist synadhd43752
 blocklist bcmdhd4389
 blocklist cl_dsp
 blocklist drv2624
diff --git a/wifi/BoardConfig-wifi.mk b/wifi/BoardConfig-wifi.mk
new file mode 100644
index 0000000..da50209
--- /dev/null
+++ b/wifi/BoardConfig-wifi.mk
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2021 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.
+#
+
+# WiFi
+BOARD_WLAN_DEVICE := bcmdhd
+BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+WPA_SUPPLICANT_VERSION := VER_0_8_X
+BOARD_WPA_SUPPLICANT_DRIVER := NL80211
+BOARD_HOSTAPD_DRIVER := NL80211
+# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {1 STA + 1 P2P}
+# or {1 STA + 1 NAN} or {2 STA}
+WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}
+WIFI_FEATURE_WIFI_EXT_HAL := true
+WIFI_FEATURE_IMU_DETECTION := true
+# Avoid Wifi reset on MAC Address change
+WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true
+WIFI_FEATURE_HOSTAPD_11AX := true
+