Add bootloader and radio images to the vendor blobs packages
am: bb02405f0a

Change-Id: Ied3150c8c40a58ae6d149e5db7874273b7139629
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index 342bbdf..004538d 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -72,15 +72,14 @@
     vbmeta \
     dtbo
 
-# Skip product partition for nodap build
+# Skip product and system_ext partition for nodap build
 ifeq ($(filter %_nodap,$(TARGET_PRODUCT)),)
 AB_OTA_PARTITIONS += \
-    product
+    product \
+    system_ext
 endif
 
 ifneq ($(filter %_mainline,$(TARGET_PRODUCT)),)
-# TODO (b/136154856) product_services partition is removed from
-# AB_OTA_PARTITIONS. Instead, we will add system_ext once it is ready.
 AB_OTA_PARTITIONS += \
     vbmeta_system
 endif
@@ -101,9 +100,7 @@
     libfstab
 
 ifneq ($(filter %_mainline,$(TARGET_PRODUCT)),)
-# TODO (b/136154856) product_services partition is removed from
-# BOARD_AVB_VBMETA_SYSTEM. Instead, we will add system_ext once it is ready.
-BOARD_AVB_VBMETA_SYSTEM := system
+BOARD_AVB_VBMETA_SYSTEM := system system_ext
 BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
 BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
 BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
@@ -145,12 +142,24 @@
 # boot.img
 BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
 
+# system_ext.img
+ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
+TARGET_COPY_OUT_SYSTEM_EXT := system/system_ext
+else
+BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
+endif
+ifeq ($(PRODUCT_NO_PRODUCT_PARTITION), true)
+# no system_ext partition as well
+TARGET_COPY_OUT_SYSTEM_EXT := system/system_ext
+endif
+
 ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
 BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
 BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
     system \
     vendor \
-    product
+    product \
+    system_ext
 
 ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS), true)
 # Normal Pixel 3 must retrofit dynamic partitions.
@@ -166,21 +175,11 @@
 else
 # Mainline Pixel 3 has an actual super partition.
 
-# TODO (b/136154856) product_services partition is removed.
-# Instead, we will add system_ext once it is ready.
-# BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE := ext4
-# TARGET_COPY_OUT_PRODUCT_SERVICES := product_services
-
 BOARD_SUPER_PARTITION_SIZE := 12884901888
 # Assume 1MB metadata size.
 # TODO(b/117997386): Use correct metadata size.
 BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 6441402368
 
-# TODO (b/136154856) product_services partition removed.
-# Instead, we will add system_ext once it is ready.
-# BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST += \
-#    product_services \
-
 endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
 endif # PRODUCT_USE_DYNAMIC_PARTITIONS
 
@@ -226,6 +225,8 @@
 # Sensors
 USE_SENSOR_MULTI_HAL := true
 TARGET_SUPPORT_DIRECT_REPORT := true
+# Enable sensor Version V_2
+USE_SENSOR_HAL_VER := 2.0
 
 # wlan
 BOARD_WLAN_DEVICE := qcwcn
@@ -237,6 +238,9 @@
 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
 WIFI_HIDL_FEATURE_AWARE := true
 WIFI_HIDL_FEATURE_DUAL_INTERFACE:= true
+WIFI_FEATURE_WIFI_EXT_HAL := true
+WIFI_FEATURE_IMU_DETECTION := false
+WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
 
 # Audio
 BOARD_USES_ALSA_AUDIO := true
diff --git a/audio_policy_volumes_b1.xml b/audio_policy_volumes_b1.xml
index 42e1d6a..32f3419 100644
--- a/audio_policy_volumes_b1.xml
+++ b/audio_policy_volumes_b1.xml
@@ -44,7 +44,7 @@
     <volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
                                              ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
     <volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
-                                             ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
+                                             ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
     <volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_HEADSET">
         <point>1,-3000</point>
         <point>33,-2600</point>
diff --git a/audio_policy_volumes_c1.xml b/audio_policy_volumes_c1.xml
index f2a4eab..c25b1dc 100644
--- a/audio_policy_volumes_c1.xml
+++ b/audio_policy_volumes_c1.xml
@@ -44,7 +44,7 @@
     <volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
                                              ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
     <volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
-                                             ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
+                                             ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
     <volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_HEADSET">
         <point>1,-3000</point>
         <point>33,-2600</point>
diff --git a/component-overrides.xml b/component-overrides.xml
new file mode 100644
index 0000000..bb3419d
--- /dev/null
+++ b/component-overrides.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     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.
+-->
+<config>
+    <component-override package="com.android.bluetooth" >
+        <component class=".sap.SapService" enabled="true" />
+    </component-override>
+</config>
\ No newline at end of file
diff --git a/device-blueline.mk b/device-blueline.mk
index f0f2f6d..77659fe 100644
--- a/device-blueline.mk
+++ b/device-blueline.mk
@@ -33,3 +33,7 @@
     device/google/crosshatch/nfc/libnfc-nxp.blueline.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nxp.conf
 
 PRODUCT_PRODUCT_PROPERTIES += ro.com.google.ime.height_ratio=1.2
+
+# Enable iorapd perfetto tracing for app starts
+PRODUCT_PRODUCT_PROPERTIES += \
+    iorapd.perfetto.enable=true
diff --git a/device-crosshatch.mk b/device-crosshatch.mk
index 502996c..1bbb978 100644
--- a/device-crosshatch.mk
+++ b/device-crosshatch.mk
@@ -34,3 +34,11 @@
 
 PRODUCT_PACKAGES += \
     NoCutoutOverlay
+
+# Enable iorapd prefetching by default for crosshatch targets
+PRODUCT_PRODUCT_PROPERTIES += \
+    iorapd.readahead.enable=true
+
+# Disable Camera Pinning by default for crosshatch targets
+PRODUCT_PRODUCT_PROPERTIES += \
+    pinner.pin_camera=false
diff --git a/device.mk b/device.mk
index aac3c9e..cbf68b6 100644
--- a/device.mk
+++ b/device.mk
@@ -38,6 +38,7 @@
 
 PRODUCT_COPY_FILES += \
     device/google/crosshatch/default-permissions.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default-permissions/default-permissions.xml \
+    device/google/crosshatch/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml \
     frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
     frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.software.verified_boot.xml
 
@@ -52,6 +53,10 @@
 PRODUCT_PACKAGES += \
     messaging
 
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+PRODUCT_PACKAGES += chre_test_client
+endif
+
 LOCAL_PATH := device/google/crosshatch
 SRC_MEDIA_HAL_DIR := hardware/qcom/media/sdm845
 SRC_DISPLAY_HAL_DIR := hardware/qcom/display/sdm845
@@ -81,7 +86,6 @@
 PRODUCT_COPY_FILES += \
     $(LOCAL_KERNEL):kernel \
     $(LOCAL_PATH)/init.recovery.hardware.rc:recovery/root/init.recovery.$(PRODUCT_PLATFORM).rc \
-    $(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).rc \
     $(LOCAL_PATH)/init.hardware.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).usb.rc \
     $(LOCAL_PATH)/ueventd.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
     $(LOCAL_PATH)/init.power.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).power.rc \
@@ -103,6 +107,18 @@
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/init.edge_sense.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.edge_sense.sh
 
+ifeq (,$(filter %_xr,$(TARGET_PRODUCT)))
+  PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).rc
+else
+  # XR variants for Pixel devices (e.g. blueline_xr and crosshatch_xr). Note
+  # that this is a nonintrusive way to add XR-specific init.rc entries, as the
+  # init.hardware.xr.rc file imports the original init.hardware.rc file.
+  PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).common.rc \
+    $(LOCAL_PATH)/init.hardware.xr.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).rc
+endif
+
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
   PRODUCT_COPY_FILES += \
       $(LOCAL_PATH)/init.hardware.diag.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).diag.rc
@@ -443,16 +459,23 @@
     camera.device@3.2-impl \
     camera.sdm845 \
     libgooglecamerahal \
-    libgoogle_camera_hal_tests \
     libqomx_core \
     libmmjpeg_interface \
     libmmcamera_interface \
     libcameradepthcalibrator
 
+# Google Camera HAL test libraries in debug builds
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+PRODUCT_PACKAGES += \
+    libgoogle_camera_hal_proprietary_tests \
+    libgoogle_camera_hal_tests
+endif
+
 PRODUCT_PACKAGES += \
     sensors.$(PRODUCT_HARDWARE) \
-    android.hardware.sensors@1.0-impl \
-    android.hardware.sensors@1.0-service
+    android.hardware.sensors@2.0-impl \
+    android.hardware.sensors@2.0-service \
+    android.hardware.sensors@2.0-service.rc
 
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/sensors/hals.conf:vendor/etc/sensors/hals.conf
@@ -486,7 +509,7 @@
 
 # Wireless Charger HAL
 PRODUCT_PACKAGES += \
-    vendor.google.wireless_charger@1.0
+    vendor.google.wireless_charger@1.1
 
 ENABLE_VENDOR_RIL_SERVICE := true
 
@@ -600,6 +623,13 @@
 PRODUCT_PROPERTY_OVERRIDES += \
     persist.vendor.sys.ssr.restart_level=modem,slpi,adsp
 
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+# Sensor debug flag
+PRODUCT_PROPERTY_OVERRIDES += \
+    persist.vendor.debug.ash.logger=0 \
+    persist.vendor.debug.ash.logger.time=0
+endif
+
 # setup dalvik vm configs
 $(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
 
@@ -842,3 +872,10 @@
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.has_HDR_display=true
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_color_management=true
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.protected_contents=true
+
+# Add iorap trace file for clock and calendar. This is for temporary test purpose and should be
+# removed after the test is done (b/139831359).
+CALENDAR_TRACE := com.android.calendar.compiled_trace.pb
+PRODUCT_COPY_FILES += system/iorap/traces/$(CALENDAR_TRACE):product/iorap-trace/$(CALENDAR_TRACE)
+CLOCK_TRACE := com.android.deskclock.compiled_trace.pb
+PRODUCT_COPY_FILES += system/iorap/traces/$(CLOCK_TRACE):product/iorap-trace/$(CLOCK_TRACE)
diff --git a/device_framework_matrix.xml b/device_framework_matrix.xml
index a41215a..8cb92e0 100644
--- a/device_framework_matrix.xml
+++ b/device_framework_matrix.xml
@@ -63,7 +63,7 @@
     </hal>
     <hal format="hidl" optional="true">
         <name>vendor.google.wireless_charger</name>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>IWirelessCharger</name>
             <instance>default</instance>
@@ -174,19 +174,10 @@
             <instance>default</instance>
         </interface>
       </hal>
-    <hal format="hidl">
-        <name>android.hardware.wifi.supplicant</name>
-        <transport>hwbinder</transport>
-        <version>1.2</version>
-        <interface>
-            <name>ISupplicant</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
     <hal format="hidl" optional="true">
         <name>vendor.google.wifi_ext</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>IWifiExt</name>
             <instance>default</instance>
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 802ac80..cb27cf3 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -145,6 +145,7 @@
             "/data/vendor/radio/qmi_fw_log_old",
             "/data/vendor/netmgr/netmgr_log",
             "/data/vendor/netmgr/netmgr_log_old",
+            "/data/vendor/radio/omadm_logs.txt",
             "/data/vendor/radio/power_anomaly_data.txt",
             "/data/vendor/radio/diag_logs/diag_trace.txt",
             "/data/vendor/radio/diag_logs/diag_trace_old.txt",
@@ -272,6 +273,18 @@
     }
 }
 
+static void DumpSensorLog(int fd) {
+    const std::string logPath = "/data/vendor/sensors/log/sensor_log.txt";
+    const std::string lastlogPath = "/data/vendor/sensors/log/sensor_lastlog.txt";
+
+    if (!access(logPath.c_str(), R_OK)) {
+        DumpFileToFd(fd, "sensor log", logPath);
+    }
+    if (!access(lastlogPath.c_str(), R_OK)) {
+        DumpFileToFd(fd, "sensor lastlog", lastlogPath);
+    }
+}
+
 static void DumpF2FS(int fd) {
     DumpFileToFd(fd, "F2FS", "/sys/kernel/debug/f2fs/status");
     DumpFileToFd(fd, "F2FS - fragmentation", "/proc/fs/f2fs/dm-6/segment_info");
@@ -358,6 +371,8 @@
     DumpF2FS(fd);
     DumpUFS(fd);
 
+    DumpSensorLog(fd);
+
     DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts");
 
     DumpPower(fd);
diff --git a/fstab.hardware b/fstab.hardware
index 4c0b3e0..c224001 100644
--- a/fstab.hardware
+++ b/fstab.hardware
@@ -2,6 +2,7 @@
 
 #<src>                                              <mnt_point>        <type>      <mnt_flags and options>                               <fs_mgr_flags>
 system                                              /system            ext4        ro,barrier=1                                          wait,slotselect,avb=vbmeta,logical,first_stage_mount
+system_ext                                          /system_ext        ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
 vendor                                              /vendor            ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
 product                                             /product           ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
 /dev/block/by-name/metadata                         /metadata          ext4        noatime,nosuid,nodev,discard,sync                     wait,formattable,first_stage_mount
diff --git a/fstab.mainline.hardware b/fstab.mainline.hardware
index 28548aa..61d3fd2 100644
--- a/fstab.mainline.hardware
+++ b/fstab.mainline.hardware
@@ -2,10 +2,9 @@
 
 #<src>                                              <mnt_point>        <type>      <mnt_flags and options>                               <fs_mgr_flags>
 system                                              /system            ext4        ro,barrier=1                                          wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
+system_ext                                          /system_ext        ext4        ro,barrier=1                                          wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
 vendor                                              /vendor            ext4        ro,barrier=1                                          wait,slotselect,avb=vbmeta,logical,first_stage_mount
 product                                             /product           ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
-# TODO(b/136154856) product_services will be renamed to system_ext
-#product_services                                    /product_services  ext4        ro,barrier=1                                          wait,slotselect,avb,logical,first_stage_mount
 /dev/block/by-name/metadata                         /metadata          ext4        noatime,nosuid,nodev,discard                          wait,formattable,first_stage_mount
 /dev/block/bootdevice/by-name/userdata              /data              f2fs        noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier       latemount,wait,check,fileencryption=ice,keydirectory=/metadata/vold/metadata_encryption,quota,formattable,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,reservedsize=128M
 /dev/block/bootdevice/by-name/misc                  /misc              emmc        defaults                                              defaults
diff --git a/health/HealthService.cpp b/health/HealthService.cpp
index fec8692..70416b0 100644
--- a/health/HealthService.cpp
+++ b/health/HealthService.cpp
@@ -14,9 +14,8 @@
  * limitations under the License.
  */
 #define LOG_TAG "android.hardware.health@2.0-service.crosshatch"
-#include <android-base/logging.h>
-
 #include <android-base/file.h>
+#include <android-base/logging.h>
 #include <android-base/parseint.h>
 #include <android-base/strings.h>
 #include <health2/Health.h>
@@ -24,6 +23,7 @@
 #include <healthd/healthd.h>
 #include <hidl/HidlTransportSupport.h>
 #include <pixelhealth/BatteryMetricsLogger.h>
+#include <pixelhealth/BatteryThermalControl.h>
 #include <pixelhealth/CycleCountBackupRestore.h>
 #include <pixelhealth/DeviceHealth.h>
 #include <pixelhealth/LowBatteryShutdownMetrics.h>
@@ -40,17 +40,19 @@
 using android::hardware::health::V2_0::DiskStats;
 using android::hardware::health::V2_0::StorageAttribute;
 using android::hardware::health::V2_0::StorageInfo;
+using ::device::google::crosshatch::health::BatteryRechargingControl;
 using hardware::google::pixel::health::BatteryMetricsLogger;
+using hardware::google::pixel::health::BatteryThermalControl;
 using hardware::google::pixel::health::CycleCountBackupRestore;
 using hardware::google::pixel::health::DeviceHealth;
 using hardware::google::pixel::health::LowBatteryShutdownMetrics;
-using ::device::google::crosshatch::health::BatteryRechargingControl;
 
 constexpr char kBatteryResistance[] = "/sys/class/power_supply/maxfg/resistance";
 constexpr char kBatteryOCV[] = "/sys/class/power_supply/maxfg/voltage_ocv";
 constexpr char kVoltageAvg[] = "/sys/class/power_supply/maxfg/voltage_avg";
 
 static BatteryRechargingControl battRechargingControl;
+static BatteryThermalControl battThermalControl("sys/devices/virtual/thermal/tz-by-name/soc/mode");
 static BatteryMetricsLogger battMetricsLogger(kBatteryResistance, kBatteryOCV);
 static LowBatteryShutdownMetrics shutdownMetrics(kVoltageAvg);
 static CycleCountBackupRestore ccBackupRestoreBMS(
@@ -112,6 +114,7 @@
 int healthd_board_battery_update(struct android::BatteryProperties *props) {
     battRechargingControl.updateBatteryProperties(props);
     deviceHealth.update(props);
+    battThermalControl.updateThermalState(props);
     battMetricsLogger.logBatteryProperties(props);
     shutdownMetrics.logShutdownVoltage(props);
     ccBackupRestoreBMS.Backup(props->batteryLevel);
diff --git a/init.hardware.rc b/init.hardware.rc
index 820c6be..4a9fa7b 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -137,15 +137,6 @@
     write /dev/stune/top-app/schedtune.boost 10
     write /dev/stune/top-app/schedtune.prefer_idle 1
 
-    # Setup cpusets used by the VR services.
-    mkdir /dev/cpuset/kernel 0750 root system
-    write /dev/cpuset/kernel/cpus 0
-    write /dev/cpuset/kernel/mems 0
-    chown system system /dev/cpuset/kernel/tasks
-    chown system system /dev/cpuset/kernel/cpus
-    chmod 0660 /dev/cpuset/kernel/tasks
-    chmod 0660 /dev/cpuset/kernel/cpus
-
     mkdir /dev/cpuset/camera-daemon
     write /dev/cpuset/camera-daemon/cpus 0-7
     write /dev/cpuset/camera-daemon/mems 0
@@ -153,52 +144,6 @@
     chown system system /dev/cpuset/camera-daemon/tasks
     chmod 0664 /dev/cpuset/camera-daemon/tasks
 
-    mkdir /dev/cpuset/system 0750 root system
-    write /dev/cpuset/system/cpus 0
-    write /dev/cpuset/system/mems 0
-    chown system system /dev/cpuset/system/tasks
-    chmod 0660 /dev/cpuset/system/tasks
-
-    mkdir /dev/cpuset/system/performance 0750 root system
-    write /dev/cpuset/system/performance/cpus 0
-    write /dev/cpuset/system/performance/mems 0
-    chown system system /dev/cpuset/system/performance/tasks
-    chmod 0660 /dev/cpuset/system/performance/tasks
-
-    mkdir /dev/cpuset/system/background 0750 root system
-    write /dev/cpuset/system/background/cpus 0
-    write /dev/cpuset/system/background/mems 0
-    chown system system /dev/cpuset/system/background/tasks
-    chmod 0660 /dev/cpuset/system/background/tasks
-
-    mkdir /dev/cpuset/application 0750 root system
-    write /dev/cpuset/application/cpus 0
-    write /dev/cpuset/application/mems 0
-    chown system system /dev/cpuset/application/tasks
-    chmod 0660 /dev/cpuset/application/tasks
-
-    mkdir /dev/cpuset/application/performance 0750 root system
-    write /dev/cpuset/application/performance/cpus 0
-    write /dev/cpuset/application/performance/mems 0
-    chown system system /dev/cpuset/application/performance/tasks
-    chmod 0660 /dev/cpuset/application/performance/tasks
-
-    mkdir /dev/cpuset/application/background 0750 root system
-    write /dev/cpuset/application/background/cpus 0
-    write /dev/cpuset/application/background/mems 0
-    chown system system /dev/cpuset/application/background/tasks
-    chmod 0660 /dev/cpuset/application/background/tasks
-
-    # Create UDS structure for base VR services.
-    mkdir /dev/socket/pdx 0775 system system
-    mkdir /dev/socket/pdx/system 0775 system system
-    mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
-    mkdir /dev/socket/pdx/system/performance 0775 system system
-    mkdir /dev/socket/pdx/system/vr 0775 system system
-    mkdir /dev/socket/pdx/system/vr/display 0775 system system
-    mkdir /dev/socket/pdx/system/vr/pose 0775 system system
-    mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
-
     # b/37682684 Enable suspend clock reporting
     write /sys/kernel/debug/clk/debug_suspend 1
 
@@ -226,6 +171,7 @@
     chown system system /sys/devices/virtual/thermal/tz-by-name/fps-therm-monitor/trip_point_0_hyst
     chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_temp
     chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_hyst
+    chown system system /sys/devices/virtual/thermal/tz-by-name/soc/mode
 
 on fs
     mount_all /vendor/etc/fstab.${ro.boot.hardware.platform} --early
@@ -384,6 +330,8 @@
 
     mkdir /data/vendor/sensors 0770
     chown system system /data/vendor/sensors
+    mkdir /data/vendor/sensors/log 0770
+    chown system system /data/vendor/sensors/log
 
     chmod 770 /persist/audio
     chmod 660 /persist/audio/audio.cal
@@ -517,17 +465,6 @@
     write /proc/sys/net/core/rmem_max  8388608
     write /proc/sys/net/core/wmem_max  8388608
 
-    # Update DVR cpusets to boot-time values.
-    write /dev/cpuset/kernel/cpus 0-7
-    write /dev/cpuset/system/cpus 0-7
-    write /dev/cpuset/system/performance/cpus 0-7
-    write /dev/cpuset/system/background/cpus 0-7
-    write /dev/cpuset/system/cpus 0-7
-    write /dev/cpuset/application/cpus 0-7
-    write /dev/cpuset/application/performance/cpus 0-7
-    write /dev/cpuset/application/background/cpus 0-7
-    write /dev/cpuset/application/cpus 0-7
-
     # Bluetooth
     chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
     chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
@@ -615,15 +552,6 @@
     write /dev/cpuset/system-background/cpus 0-3
     write /dev/cpuset/restricted/cpus 0-3
 
-    # Update DVR cpusets to runtime values.
-    # Kernel cpuset will be apply on PowerHAL
-    write /dev/cpuset/system/performance/cpus 6-7
-    write /dev/cpuset/system/background/cpus 0-1
-    write /dev/cpuset/system/cpus 0-1,6-7
-    write /dev/cpuset/application/performance/cpus 4-5
-    write /dev/cpuset/application/background/cpus 0-1
-    write /dev/cpuset/application/cpus 0-1,4-5
-
     # Runtime fs tuning: as we have init boottime setting and kernel patch setting
     # default readahead to 2048KB. We should adjust the setting upon boot_complete
     # for runtime performance
@@ -751,21 +679,6 @@
    group system
    capabilities NET_BIND_SERVICE
 
-service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
-    -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -dd \
-    -g@android:wpa_wlan0
-    #   we will start as root and wpa_supplicant will switch to user wifi
-    #   after setting up the capabilities required for WEXT
-    #   user wifi
-    #   group wifi inet keystore
-    interface android.hardware.wifi.supplicant@1.0::ISupplicant default
-    interface android.hardware.wifi.supplicant@1.1::ISupplicant default
-    interface android.hardware.wifi.supplicant@1.2::ISupplicant default
-    class main
-    socket wpa_wlan0 dgram 660 wifi wifi
-    disabled
-    oneshot
-
 service cnss-daemon /vendor/bin/cnss-daemon -n -l
    class late_start
    user system
@@ -845,8 +758,7 @@
     write /d/tracing/instances/pixel-trace/tracing_on 1
 
 # bugreport is triggered by holding down volume down, volume up and power
-service bugreport /system/bin/dumpstate -d -p -B -z \
-        -o /data/user_de/0/com.android.shell/files/bugreports/bugreport
+service bugreport /system/bin/dumpstate -d -p -z
     class main
     disabled
     oneshot
diff --git a/init.hardware.xr.rc b/init.hardware.xr.rc
new file mode 100644
index 0000000..983f13e
--- /dev/null
+++ b/init.hardware.xr.rc
@@ -0,0 +1,104 @@
+#
+# Copyright (C) 2019 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# This file inherits from init.${ro.boot.hardware.platform}.rc plus additional
+# configs only used by XR targets.
+#
+import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.common.rc
+
+on init
+    # Temporarily stop booting into VR directly due to battery drain.
+    # TODO(b/131327495): Re-enable this once VrHeadsetPowerPolicyService or its
+    #                    equivalent lands in Android master.
+    setprop ro.boot.vr 0
+
+    # Setup cpusets used by the VR services.
+    mkdir /dev/cpuset/kernel 0750 root system
+    write /dev/cpuset/kernel/cpus 0
+    write /dev/cpuset/kernel/mems 0
+    chown system system /dev/cpuset/kernel/tasks
+    chown system system /dev/cpuset/kernel/cpus
+    chmod 0660 /dev/cpuset/kernel/tasks
+    chmod 0660 /dev/cpuset/kernel/cpus
+
+    mkdir /dev/cpuset/system 0750 root system
+    write /dev/cpuset/system/cpus 0
+    write /dev/cpuset/system/mems 0
+    chown system system /dev/cpuset/system/tasks
+    chmod 0660 /dev/cpuset/system/tasks
+
+    mkdir /dev/cpuset/system/performance 0750 root system
+    write /dev/cpuset/system/performance/cpus 0
+    write /dev/cpuset/system/performance/mems 0
+    chown system system /dev/cpuset/system/performance/tasks
+    chmod 0660 /dev/cpuset/system/performance/tasks
+
+    mkdir /dev/cpuset/system/background 0750 root system
+    write /dev/cpuset/system/background/cpus 0
+    write /dev/cpuset/system/background/mems 0
+    chown system system /dev/cpuset/system/background/tasks
+    chmod 0660 /dev/cpuset/system/background/tasks
+
+    mkdir /dev/cpuset/application 0750 root system
+    write /dev/cpuset/application/cpus 0
+    write /dev/cpuset/application/mems 0
+    chown system system /dev/cpuset/application/tasks
+    chmod 0660 /dev/cpuset/application/tasks
+
+    mkdir /dev/cpuset/application/performance 0750 root system
+    write /dev/cpuset/application/performance/cpus 0
+    write /dev/cpuset/application/performance/mems 0
+    chown system system /dev/cpuset/application/performance/tasks
+    chmod 0660 /dev/cpuset/application/performance/tasks
+
+    mkdir /dev/cpuset/application/background 0750 root system
+    write /dev/cpuset/application/background/cpus 0
+    write /dev/cpuset/application/background/mems 0
+    chown system system /dev/cpuset/application/background/tasks
+    chmod 0660 /dev/cpuset/application/background/tasks
+
+    # Create UDS structure for base VR services.
+    mkdir /dev/socket/pdx 0775 system system
+    mkdir /dev/socket/pdx/system 0775 system system
+    mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
+    mkdir /dev/socket/pdx/system/performance 0775 system system
+    mkdir /dev/socket/pdx/system/vr 0775 system system
+    mkdir /dev/socket/pdx/system/vr/display 0775 system system
+    mkdir /dev/socket/pdx/system/vr/pose 0775 system system
+    mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
+
+on boot
+    # Update DVR cpusets to boot-time values.
+    write /dev/cpuset/kernel/cpus 0-7
+    write /dev/cpuset/system/cpus 0-7
+    write /dev/cpuset/system/performance/cpus 0-7
+    write /dev/cpuset/system/background/cpus 0-7
+    write /dev/cpuset/system/cpus 0-7
+    write /dev/cpuset/application/cpus 0-7
+    write /dev/cpuset/application/performance/cpus 0-7
+    write /dev/cpuset/application/background/cpus 0-7
+    write /dev/cpuset/application/cpus 0-7
+
+on property:sys.boot_completed=1
+    # Update DVR cpusets to runtime values.
+    # Kernel cpuset will be apply on PowerHAL
+    write /dev/cpuset/system/performance/cpus 6-7
+    write /dev/cpuset/system/background/cpus 0-1
+    write /dev/cpuset/system/cpus 0-1,6-7
+    write /dev/cpuset/application/performance/cpus 4-5
+    write /dev/cpuset/application/background/cpus 0-1
+    write /dev/cpuset/application/cpus 0-1,4-5
diff --git a/keymaster/Android.bp b/keymaster/Android.bp
index 02d52a9..7a8a164 100644
--- a/keymaster/Android.bp
+++ b/keymaster/Android.bp
@@ -22,6 +22,7 @@
         "android.hardware.keymaster@4.0",
         "libbase",
         "libkeymaster4support",
+        "libutils",
     ],
     proprietary: true,
 }
diff --git a/manifest.xml b/manifest.xml
index 3d34edf..e2af5d4 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -112,8 +112,6 @@
         </interface>
         <fqname>@1.2::ICryptoFactory/clearkey</fqname>
         <fqname>@1.2::IDrmFactory/clearkey</fqname>
-        <fqname>@1.2::ICryptoFactory/widevine</fqname>
-        <fqname>@1.2::IDrmFactory/widevine</fqname>
     </hal>
     <hal format="hidl">
         <name>android.hardware.dumpstate</name>
@@ -284,7 +282,7 @@
     <hal format="hidl">
         <name>vendor.google.wireless_charger</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
+        <version>1.1</version>
         <interface>
             <name>IWirelessCharger</name>
             <instance>default</instance>
@@ -317,7 +315,7 @@
     <hal format="hidl">
         <name>android.hardware.sensors</name>
         <transport>hwbinder</transport>
-        <version>1.0</version>
+        <version>2.0</version>
         <interface>
             <name>ISensors</name>
             <instance>default</instance>
@@ -378,15 +376,6 @@
         </interface>
     </hal>
     <hal format="hidl">
-        <name>android.hardware.wifi</name>
-        <transport>hwbinder</transport>
-        <version>1.3</version>
-        <interface>
-            <name>IWifi</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>android.hardware.wifi.hostapd</name>
         <transport>hwbinder</transport>
         <version>1.1</version>
@@ -396,15 +385,6 @@
         </interface>
     </hal>
     <hal format="hidl">
-        <name>android.hardware.wifi.supplicant</name>
-        <transport>hwbinder</transport>
-        <version>1.2</version>
-        <interface>
-            <name>ISupplicant</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>vendor.qti.hardware.radio.ims</name>
         <transport>hwbinder</transport>
         <version>1.2</version>
diff --git a/mixer_paths_tavil_b1.xml b/mixer_paths_tavil_b1.xml
index 8463887..59eb60a 100644
--- a/mixer_paths_tavil_b1.xml
+++ b/mixer_paths_tavil_b1.xml
@@ -1376,6 +1376,11 @@
         <ctl name="VoiceMMode2_Tx Mixer SLIM_0_TX_MMode2" value="1"/>
     </path>
 
+    <path name="voicemmode2-call hearing-aid">
+        <ctl name="AFE_PCM_RX_Voice Mixer VoiceMMode2" value="1"/>
+        <ctl name="VoiceMMode2_Tx Mixer SLIM_0_TX_MMode2" value="1"/>
+    </path>
+
     <path name="voicemmode2-call handset">
         <ctl name="VOC_EXT_EC MUX" value="QUAT_TDM_RX_0" />
         <ctl name="QUAT_TDM_RX_0_Voice Mixer VoiceMMode2" value="1"/>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 1301dd6..468925c 100755
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -129,6 +129,13 @@
     </string-array>
 
     <!-- List of regexpressions describing the interface (if any) that represent tetherable
+         Wifi P2P interfaces.  If the device doesn't want to support tethering over Wifi P2p this
+         should be empty.  An example would be "p2p-p2p.*" -->
+    <string-array translatable="false" name="config_tether_wifi_p2p_regexs">
+        <item>"p2p-p2p\\d-.*"</item>
+    </string-array>
+
+    <!-- List of regexpressions describing the interface (if any) that represent tetherable
          bluetooth interfaces.  If the device doesn't want to support tethering over bluetooth this
          should be empty. -->
     <string-array translatable="false" name="config_tether_bluetooth_regexs">
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
deleted file mode 100644
index 378e34b..0000000
--- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/**
- * Copyright (c) 2018, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
-    <!-- Default for Settings.System.VIBRATE_WHEN_RINGING -->
-    <bool name="def_vibrate_when_ringing">true</bool>
-    <!-- Default for Settings.Global.APPLY_RAMPING_RINGER -->
-    <bool name="def_apply_ramping_ringer">false</bool>
-</resources>
diff --git a/overlay/packages/apps/Bluetooth/res/values/config.xml b/overlay/packages/apps/Bluetooth/res/values/config.xml
deleted file mode 100644
index e403105..0000000
--- a/overlay/packages/apps/Bluetooth/res/values/config.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Copyright (c) 2017, The Linux Foundation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials provided
-      with the distribution.
-    * Neither the name of The Linux Foundation nor the names of its
-      contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-<resources>
-    <bool name="profile_supported_sap">true</bool>
-    <bool name="profile_supported_hearing_aid">true</bool>
-</resources>
diff --git a/powerhint.json b/powerhint.json
index 3d397f6..2ec6979 100644
--- a/powerhint.json
+++ b/powerhint.json
@@ -219,15 +219,6 @@
       "HoldFd": true
     },
     {
-      "Name": "VRKernelCpuSet",
-      "Path": "/dev/cpuset/kernel/cpus",
-      "Values": [
-        "2,3",
-        "0-7"
-      ],
-      "ResetOnInit": true
-    },
-    {
       "Name": "SchedBoost",
       "Path": "/proc/sys/kernel/sched_boost",
       "Values": [
@@ -357,12 +348,6 @@
       "Value": "5931"
     },
     {
-      "PowerHint": "VR_MODE",
-      "Node": "VRKernelCpuSet",
-      "Duration": 0,
-      "Value": "2,3"
-    },
-    {
       "PowerHint": "VR_SUSTAINED_PERFORMANCE",
       "Node": "PowerHALMainState",
       "Duration": 0,
@@ -417,12 +402,6 @@
       "Value": "3879"
     },
     {
-      "PowerHint": "VR_SUSTAINED_PERFORMANCE",
-      "Node": "VRKernelCpuSet",
-      "Duration": 0,
-      "Value": "2,3"
-    },
-    {
       "PowerHint": "INTERACTION",
       "Node": "CPUBigClusterMinFreq",
       "Duration": 0,
diff --git a/usb/UsbGadget.cpp b/usb/UsbGadget.cpp
index d7456ce..0aa45e8 100644
--- a/usb/UsbGadget.cpp
+++ b/usb/UsbGadget.cpp
@@ -336,18 +336,24 @@
       if (vendorFunctions == "diag") {
         ret = setVidPid("0x05C6", "0x901B");
       } else {
-        if (!(vendorFunctions == "user" || vendorFunctions == ""))
-          ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-        ret = setVidPid("0x18d1", "0x4ee1");
+          if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+              ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+              ret = Status::CONFIGURATION_NOT_SUPPORTED;
+          } else {
+              ret = setVidPid("0x18d1", "0x4ee1");
+          }
       }
       break;
     case GadgetFunction::ADB | GadgetFunction::MTP:
       if (vendorFunctions == "diag") {
         ret = setVidPid("0x05C6", "0x903A");
       } else {
-        if (!(vendorFunctions == "user" || vendorFunctions == ""))
-          ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-        ret = setVidPid("0x18d1", "0x4ee2");
+          if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+              ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+              ret = Status::CONFIGURATION_NOT_SUPPORTED;
+          } else {
+              ret = setVidPid("0x18d1", "0x4ee2");
+          }
       }
       break;
     case static_cast<uint64_t>(GadgetFunction::RNDIS):
@@ -356,9 +362,12 @@
       } else if (vendorFunctions == "serial_cdev,diag") {
         ret = setVidPid("0x05C6", "0x90B5");
       } else {
-        if (!(vendorFunctions == "user" || vendorFunctions == ""))
-          ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-        ret = setVidPid("0x18d1", "0x4ee3");
+          if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+              ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+              ret = Status::CONFIGURATION_NOT_SUPPORTED;
+          } else {
+              ret = setVidPid("0x18d1", "0x4ee3");
+          }
       }
       break;
     case GadgetFunction::ADB | GadgetFunction::RNDIS:
@@ -367,21 +376,30 @@
       } else if (vendorFunctions == "serial_cdev,diag") {
         ret = setVidPid("0x05C6", "0x90B6");
       } else {
-        if (!(vendorFunctions == "user" || vendorFunctions == ""))
-          ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-        ret = setVidPid("0x18d1", "0x4ee4");
+          if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+              ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+              ret = Status::CONFIGURATION_NOT_SUPPORTED;
+          } else {
+              ret = setVidPid("0x18d1", "0x4ee4");
+          }
       }
       break;
     case static_cast<uint64_t>(GadgetFunction::PTP):
-      if (!(vendorFunctions == "user" || vendorFunctions == ""))
-        ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-      ret = setVidPid("0x18d1", "0x4ee5");
-      break;
+        if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+            ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+            ret = Status::CONFIGURATION_NOT_SUPPORTED;
+        } else {
+            ret = setVidPid("0x18d1", "0x4ee5");
+        }
+        break;
     case GadgetFunction::ADB | GadgetFunction::PTP:
-      if (!(vendorFunctions == "user" || vendorFunctions == ""))
-        ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-      ret = setVidPid("0x18d1", "0x4ee6");
-      break;
+        if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+            ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+            ret = Status::CONFIGURATION_NOT_SUPPORTED;
+        } else {
+            ret = setVidPid("0x18d1", "0x4ee6");
+        }
+        break;
     case static_cast<uint64_t>(GadgetFunction::ADB):
       if (vendorFunctions == "diag") {
         ret = setVidPid("0x05C6", "0x901D");
@@ -390,21 +408,30 @@
       } else if (vendorFunctions == "diag,serial_cdev") {
         ret = setVidPid("0x05C6", "0x901F");
       } else {
-        if (!(vendorFunctions == "user" || vendorFunctions == ""))
-          ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-        ret = setVidPid("0x18d1", "0x4ee7");
+          if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+              ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+              ret = Status::CONFIGURATION_NOT_SUPPORTED;
+          } else {
+              ret = setVidPid("0x18d1", "0x4ee7");
+          }
       }
       break;
     case static_cast<uint64_t>(GadgetFunction::MIDI):
-      if (!(vendorFunctions == "user" || vendorFunctions == ""))
-        ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-      ret = setVidPid("0x18d1", "0x4ee8");
-      break;
+        if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+            ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+            ret = Status::CONFIGURATION_NOT_SUPPORTED;
+        } else {
+            ret = setVidPid("0x18d1", "0x4ee8");
+        }
+        break;
     case GadgetFunction::ADB | GadgetFunction::MIDI:
-      if (!(vendorFunctions == "user" || vendorFunctions == ""))
-        ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
-      ret = setVidPid("0x18d1", "0x4ee9");
-      break;
+        if (!(vendorFunctions == "user" || vendorFunctions == "")) {
+            ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+            ret = Status::CONFIGURATION_NOT_SUPPORTED;
+        } else {
+            ret = setVidPid("0x18d1", "0x4ee9");
+        }
+        break;
     case static_cast<uint64_t>(GadgetFunction::ACCESSORY):
       if (!(vendorFunctions == "user" || vendorFunctions == ""))
         ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
diff --git a/wpa_supplicant_overlay.conf b/wpa_supplicant_overlay.conf
index a1b2b09..f15cd15 100644
--- a/wpa_supplicant_overlay.conf
+++ b/wpa_supplicant_overlay.conf
@@ -7,3 +7,4 @@
 hs20=1
 auto_interworking=0
 bss_no_flush_when_down=1
+driver_param=use_p2p_group_interface=1