Merge "Add nfc aidl service"
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index bf9a22a..8931d02 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -16,18 +16,18 @@
 
 PRODUCT_MAKEFILES := \
 	aosp_cf_arm_only_phone:$(LOCAL_DIR)/vsoc_arm_only/phone/aosp_cf.mk \
-	aosp_cf_arm64_auto:$(LOCAL_DIR)/vsoc_arm64/auto/aosp_cf.mk \
+	aosp_cf_arm64_auto:$(LOCAL_DIR)/vsoc_arm64_only/auto/aosp_cf.mk \
 	aosp_cf_arm64_phone:$(LOCAL_DIR)/vsoc_arm64/phone/aosp_cf.mk \
 	aosp_cf_arm64_phone_hwasan:$(LOCAL_DIR)/vsoc_arm64/phone/aosp_cf_hwasan.mk \
 	aosp_cf_arm64_only_phone:$(LOCAL_DIR)/vsoc_arm64_only/phone/aosp_cf.mk \
 	aosp_cf_arm64_only_phone_hwasan:$(LOCAL_DIR)/vsoc_arm64_only/phone/aosp_cf_hwasan.mk \
-	aosp_cf_x86_64_auto:$(LOCAL_DIR)/vsoc_x86_64/auto/device.mk \
+	aosp_cf_x86_64_auto:$(LOCAL_DIR)/vsoc_x86_64/auto/aosp_cf.mk \
 	aosp_cf_x86_64_pc:$(LOCAL_DIR)/vsoc_x86_64/pc/aosp_cf.mk \
 	aosp_cf_x86_64_phone:$(LOCAL_DIR)/vsoc_x86_64/phone/aosp_cf.mk \
 	aosp_cf_x86_64_tv:$(LOCAL_DIR)/vsoc_x86_64/tv/aosp_cf.mk \
 	aosp_cf_x86_64_foldable:$(LOCAL_DIR)/vsoc_x86_64/phone/aosp_cf_foldable.mk \
 	aosp_cf_x86_64_only_phone:$(LOCAL_DIR)/vsoc_x86_64_only/phone/aosp_cf.mk \
-	aosp_cf_x86_auto:$(LOCAL_DIR)/vsoc_x86/auto/device.mk \
+	aosp_cf_x86_auto:$(LOCAL_DIR)/vsoc_x86/auto/aosp_cf.mk \
 	aosp_cf_x86_pasan:$(LOCAL_DIR)/vsoc_x86/pasan/aosp_cf.mk \
 	aosp_cf_x86_phone:$(LOCAL_DIR)/vsoc_x86/phone/aosp_cf.mk \
 	aosp_cf_x86_phone_noapex:$(LOCAL_DIR)/vsoc_x86_noapex/aosp_cf_noapex.mk \
diff --git a/apex/com.google.cf.wifi_hwsim/Android.bp b/apex/com.google.cf.wifi_hwsim/Android.bp
index 49eec46..6b8b9ce 100644
--- a/apex/com.google.cf.wifi_hwsim/Android.bp
+++ b/apex/com.google.cf.wifi_hwsim/Android.bp
@@ -68,9 +68,11 @@
     ],
     sh_binaries: ["init.wifi.sh_apex"],
     prebuilts: [
+        "android.hardware.wifi.direct.prebuilt.xml",
         "android.hardware.wifi.passpoint.prebuilt.xml",
         "android.hardware.wifi.prebuilt.xml",
         "com.google.cf.wifi_hwsim.rc",
+        "p2p_supplicant.conf.cf",
         "wpa_supplicant.conf.cf",
         "wpa_supplicant_overlay.conf.cf",
     ],
diff --git a/apex/com.google.cf.wifi_hwsim/com.google.cf.wifi_hwsim.rc b/apex/com.google.cf.wifi_hwsim/com.google.cf.wifi_hwsim.rc
index 1926ceb..f0cc8fc 100644
--- a/apex/com.google.cf.wifi_hwsim/com.google.cf.wifi_hwsim.rc
+++ b/apex/com.google.cf.wifi_hwsim/com.google.cf.wifi_hwsim.rc
@@ -9,7 +9,10 @@
     oneshot
     disabled    # Started on post-fs-data
 
-service wpa_supplicant /apex/com.android.wifi.hal/bin/hw/wpa_supplicant_cf -g@android:wpa_wlan0
+service wpa_supplicant /apex/com.android.wifi.hal/bin/hw/wpa_supplicant_cf \
+        -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1p2p_device=1 \
+        -m/apex/com.android.wifi.hal/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
diff --git a/build/Android.bp b/build/Android.bp
index b70b050..d9001bc 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -191,6 +191,17 @@
     "bootloader_qemu_arm",
 ]
 
+prebuilt_etc_host {
+    name: "cvd_avb_testkey",
+    filename: "cvd_avb_testkey.pem",
+    src: ":avb_testkey_rsa4096",
+}
+
+cvd_host_avb_testkey = [
+    "cvd_avb_pubkey",
+    "cvd_avb_testkey",
+]
+
 cvd_host_package_customization {
     name: "cvd-host_package",
     deps: cvd_host_tools +
@@ -198,6 +209,7 @@
     multilib: {
         common: {
             deps: cvd_host_webrtc_assets +
+                cvd_host_avb_testkey +
                 cvd_host_model_simulator_files +
                 cvd_host_qemu_bootloader +
                 cvd_bluetooth_config_files +
diff --git a/host/commands/assemble_cvd/disk_flags.cc b/host/commands/assemble_cvd/disk_flags.cc
index b046339..e01929e 100644
--- a/host/commands/assemble_cvd/disk_flags.cc
+++ b/host/commands/assemble_cvd/disk_flags.cc
@@ -39,6 +39,8 @@
 
 // Taken from external/avb/libavb/avb_slot_verify.c; this define is not in the headers
 #define VBMETA_MAX_SIZE 65536ul
+// Taken from external/avb/avbtool.py; this define is not in the headers
+#define MAX_AVB_METADATA_SIZE 69632ul
 
 DECLARE_string(system_image_dir);
 
@@ -266,6 +268,10 @@
       .label = "bootconfig",
       .image_file_path = instance.persistent_bootconfig_path(),
   });
+  partitions.push_back(ImagePartition{
+      .label = "vbmeta",
+      .image_file_path = instance.vbmeta_path(),
+  });
   return partitions;
 }
 
@@ -491,15 +497,17 @@
   const CuttlefishConfig& config_;
 };
 
-class GeneratePersistentBootconfig : public Feature {
+class GeneratePersistentBootconfigAndVbmeta : public Feature {
  public:
-  INJECT(GeneratePersistentBootconfig(
+  INJECT(GeneratePersistentBootconfigAndVbmeta(
       const CuttlefishConfig& config,
       const CuttlefishConfig::InstanceSpecific& instance))
       : config_(config), instance_(instance) {}
 
   // Feature
-  std::string Name() const override { return "GeneratePersistentBootconfig"; }
+  std::string Name() const override {
+    return "GeneratePersistentBootconfigAndVbmeta";
+  }
   bool Enabled() const override { return !config_.protected_vm(); }
 
  private:
@@ -534,6 +542,7 @@
                             "\n") +
         "\n";
     ssize_t bytesWritten = WriteAll(bootconfig_fd, bootconfig);
+    LOG(DEBUG) << "bootconfig size is " << bytesWritten;
     if (bytesWritten != bootconfig.size()) {
       LOG(ERROR) << "Failed to write contents of bootconfig to \""
                  << bootconfig_path << "\"";
@@ -542,13 +551,72 @@
     LOG(DEBUG) << "Bootconfig parameters from vendor boot image and config are "
                << ReadFile(bootconfig_path);
 
-    const off_t bootconfig_size_bytes =
-        AlignToPowerOf2(bootconfig.size(), PARTITION_SIZE_SHIFT);
-    if (bootconfig_fd->Truncate(bootconfig_size_bytes) != 0) {
-      LOG(ERROR) << "`truncate --size=" << bootconfig_size_bytes << " bytes "
+    if (bootconfig_fd->Truncate(bytesWritten) != 0) {
+      LOG(ERROR) << "`truncate --size=" << bytesWritten << " bytes "
                  << bootconfig_path << "` failed:" << bootconfig_fd->StrError();
       return false;
     }
+    bootconfig_fd->Close();
+
+    const off_t bootconfig_size_bytes = AlignToPowerOf2(
+        MAX_AVB_METADATA_SIZE + bytesWritten, PARTITION_SIZE_SHIFT);
+
+    auto avbtool_path = HostBinaryPath("avbtool");
+    Command bootconfig_hash_footer_cmd(avbtool_path);
+    bootconfig_hash_footer_cmd.AddParameter("add_hash_footer");
+    bootconfig_hash_footer_cmd.AddParameter("--image");
+    bootconfig_hash_footer_cmd.AddParameter(bootconfig_path);
+    bootconfig_hash_footer_cmd.AddParameter("--partition_size");
+    bootconfig_hash_footer_cmd.AddParameter(bootconfig_size_bytes);
+    bootconfig_hash_footer_cmd.AddParameter("--partition_name");
+    bootconfig_hash_footer_cmd.AddParameter("bootconfig");
+    bootconfig_hash_footer_cmd.AddParameter("--key");
+    bootconfig_hash_footer_cmd.AddParameter(
+        DefaultHostArtifactsPath("etc/cvd_avb_testkey.pem"));
+    bootconfig_hash_footer_cmd.AddParameter("--algorithm");
+    bootconfig_hash_footer_cmd.AddParameter("SHA256_RSA4096");
+    int success = bootconfig_hash_footer_cmd.Start().Wait();
+    if (success != 0) {
+      LOG(ERROR) << "Unable to run append hash footer. Exited with status "
+                 << success;
+      return false;
+    }
+
+    Command vbmeta_cmd(avbtool_path);
+    vbmeta_cmd.AddParameter("make_vbmeta_image");
+    vbmeta_cmd.AddParameter("--output");
+    vbmeta_cmd.AddParameter(instance_.vbmeta_path());
+    vbmeta_cmd.AddParameter("--algorithm");
+    vbmeta_cmd.AddParameter("SHA256_RSA4096");
+    vbmeta_cmd.AddParameter("--key");
+    vbmeta_cmd.AddParameter(
+        DefaultHostArtifactsPath("etc/cvd_avb_testkey.pem"));
+    vbmeta_cmd.AddParameter("--chain_partition");
+    vbmeta_cmd.AddParameter("bootconfig:1:" +
+                            DefaultHostArtifactsPath("etc/cvd.avbpubkey"));
+
+    success = vbmeta_cmd.Start().Wait();
+    if (success != 0) {
+      LOG(ERROR) << "Unable to create persistent vbmeta. Exited with status "
+                 << success;
+      return false;
+    }
+
+    if (FileSize(instance_.vbmeta_path()) > VBMETA_MAX_SIZE) {
+      LOG(ERROR) << "Generated vbmeta - " << instance_.vbmeta_path()
+                 << " is larger than the expected " << VBMETA_MAX_SIZE
+                 << ". Stopping.";
+      return false;
+    }
+    if (FileSize(instance_.vbmeta_path()) != VBMETA_MAX_SIZE) {
+      auto fd = SharedFD::Open(instance_.vbmeta_path(), O_RDWR);
+      if (!fd->IsOpen() || fd->Truncate(VBMETA_MAX_SIZE) != 0) {
+        LOG(ERROR) << "`truncate --size=" << VBMETA_MAX_SIZE << " "
+                   << instance_.vbmeta_path() << "` "
+                   << "failed: " << fd->StrError();
+        return false;
+      }
+    }
     return true;
   }
 
@@ -732,7 +800,7 @@
       .addMultibinding<Feature, InitializePstore>()
       .addMultibinding<Feature, InitializeSdCard>()
       .addMultibinding<Feature, InitializeFactoryResetProtected>()
-      .addMultibinding<Feature, GeneratePersistentBootconfig>()
+      .addMultibinding<Feature, GeneratePersistentBootconfigAndVbmeta>()
       .install(InitBootloaderEnvPartitionComponent);
 }
 
diff --git a/host/commands/assemble_cvd/flags.cc b/host/commands/assemble_cvd/flags.cc
index eb08d93..5c0b6f7 100644
--- a/host/commands/assemble_cvd/flags.cc
+++ b/host/commands/assemble_cvd/flags.cc
@@ -109,6 +109,10 @@
             false,
             "Use the udmabuf driver for zero-copy virtio-gpu");
 
+DEFINE_bool(enable_gpu_angle,
+            false,
+            "Use ANGLE to provide GLES implementation (always true for"
+            " guest_swiftshader");
 DEFINE_bool(deprecated_boot_completed, false, "Log boot completed message to"
             " host kernel. This is only used during transition of our clients."
             " Will be deprecated soon.");
@@ -583,13 +587,14 @@
 
   if (tmp_config_obj.hwcomposer() == kHwComposerAuto) {
       if (tmp_config_obj.gpu_mode() == kGpuModeDrmVirgl) {
-        tmp_config_obj.set_hwcomposer(kHwComposerDrmMinigbm);
+        tmp_config_obj.set_hwcomposer(kHwComposerDrm);
       } else {
         tmp_config_obj.set_hwcomposer(kHwComposerRanchu);
       }
   }
 
   tmp_config_obj.set_enable_gpu_udmabuf(FLAGS_enable_gpu_udmabuf);
+  tmp_config_obj.set_enable_gpu_angle(FLAGS_enable_gpu_angle);
 
   // Sepolicy rules need to be updated to support gpu mode. Temporarily disable
   // auto-enabling sandbox when gpu is enabled (b/152323505).
@@ -597,8 +602,7 @@
     SetCommandLineOptionWithMode("enable_sandbox", "false", SET_FLAGS_DEFAULT);
   }
 
-  if (vmm->ConfigureGraphics(tmp_config_obj.gpu_mode(),
-         tmp_config_obj.hwcomposer()).empty()) {
+  if (vmm->ConfigureGraphics(tmp_config_obj).empty()) {
     LOG(FATAL) << "Invalid (gpu_mode=," << FLAGS_gpu_mode <<
                " hwcomposer= " << FLAGS_hwcomposer <<
                ") does not work with vm_manager=" << FLAGS_vm_manager;
@@ -703,6 +707,14 @@
 
   tmp_config_obj.set_wmediumd_config(FLAGS_wmediumd_config);
 
+  tmp_config_obj.set_rootcanal_hci_port(7300);
+  tmp_config_obj.set_rootcanal_link_port(7400);
+  tmp_config_obj.set_rootcanal_test_port(7500);
+  tmp_config_obj.set_rootcanal_config_file(
+      FLAGS_bluetooth_controller_properties_file);
+  tmp_config_obj.set_rootcanal_default_commands_file(
+      FLAGS_bluetooth_default_commands_file);
+
   tmp_config_obj.set_record_screen(FLAGS_record_screen);
 
   tmp_config_obj.set_enable_host_bluetooth(FLAGS_enable_host_bluetooth);
@@ -781,14 +793,6 @@
       instance.set_gnss_file_path(gnss_file_paths[num-1]);
     }
 
-    instance.set_rootcanal_hci_port(7300 + num - 1);
-    instance.set_rootcanal_link_port(7400 + num - 1);
-    instance.set_rootcanal_test_port(7500 + num - 1);
-    instance.set_rootcanal_config_file(
-        FLAGS_bluetooth_controller_properties_file);
-    instance.set_rootcanal_default_commands_file(
-        FLAGS_bluetooth_default_commands_file);
-
     instance.set_camera_server_port(FLAGS_camera_server_port);
 
     if (FLAGS_protected_vm) {
@@ -857,6 +861,8 @@
       instance.set_start_wmediumd(false);
     }
 
+    instance.set_start_rootcanal(is_first_instance);
+
     instance.set_start_ap(!FLAGS_ap_rootfs_image.empty() &&
                           !FLAGS_ap_kernel_image.empty() && is_first_instance);
 
diff --git a/host/commands/run_cvd/launch.cc b/host/commands/run_cvd/launch.cc
index af48064..ab5085d 100644
--- a/host/commands/run_cvd/launch.cc
+++ b/host/commands/run_cvd/launch.cc
@@ -178,17 +178,17 @@
     Command command(RootCanalBinary());
 
     // Test port
-    command.AddParameter(instance_.rootcanal_test_port());
+    command.AddParameter(config_.rootcanal_test_port());
     // HCI server port
-    command.AddParameter(instance_.rootcanal_hci_port());
+    command.AddParameter(config_.rootcanal_hci_port());
     // Link server port
-    command.AddParameter(instance_.rootcanal_link_port());
+    command.AddParameter(config_.rootcanal_link_port());
     // Bluetooth controller properties file
     command.AddParameter("--controller_properties_file=",
-                         instance_.rootcanal_config_file());
+                         config_.rootcanal_config_file());
     // Default commands file
     command.AddParameter("--default_commands_file=",
-                         instance_.rootcanal_default_commands_file());
+                         config_.rootcanal_default_commands_file());
 
     std::vector<Command> commands;
     commands.emplace_back(log_tee_.CreateLogTee(command, "rootcanal"));
@@ -198,7 +198,9 @@
 
   // Feature
   std::string Name() const override { return "RootCanal"; }
-  bool Enabled() const override { return config_.enable_host_bluetooth(); }
+  bool Enabled() const override {
+    return config_.enable_host_bluetooth() && instance_.start_rootcanal();
+  }
 
  private:
   std::unordered_set<Feature*> Dependencies() const override { return {}; }
@@ -433,9 +435,9 @@
     Command command(DefaultHostArtifactsPath("bin/bt_connector"));
     command.AddParameter("-bt_out=", fifos_[0]);
     command.AddParameter("-bt_in=", fifos_[1]);
-    command.AddParameter("-hci_port=", instance_.rootcanal_hci_port());
-    command.AddParameter("-link_port=", instance_.rootcanal_link_port());
-    command.AddParameter("-test_port=", instance_.rootcanal_test_port());
+    command.AddParameter("-hci_port=", config_.rootcanal_hci_port());
+    command.AddParameter("-link_port=", config_.rootcanal_link_port());
+    command.AddParameter("-test_port=", config_.rootcanal_test_port());
     return single_element_emplace(std::move(command));
   }
 
diff --git a/host/commands/status/main.cc b/host/commands/status/main.cc
index 1f4090e..d50aaff 100644
--- a/host/commands/status/main.cc
+++ b/host/commands/status/main.cc
@@ -14,17 +14,17 @@
  * limitations under the License.
  */
 
+#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <unistd.h>
 #include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
 
 #include <algorithm>
 #include <cstdlib>
@@ -65,6 +65,7 @@
   std::vector<Flag> flags;
 
   std::int32_t wait_for_launcher;
+  Json::Value device_info;
   flags.emplace_back(
       GflagsCompatFlag("wait_for_launcher", wait_for_launcher)
           .Help("How many seconds to wait for the launcher to respond to the "
@@ -92,24 +93,6 @@
                       ? config->ForDefaultInstance()
                       : config->ForInstanceName(instance_name);
 
-  if (print) {
-    std::cout << "    " << instance.instance_name() << std::endl;
-    std::cout << "      Dir: " << instance.instance_dir() << std::endl;
-    std::cout << "      Web access: https://" << config->sig_server_address()
-              << ":" << std::to_string(config->sig_server_port())
-              << "/client.html?deviceId=" << instance.instance_name()
-              << std::endl;
-    std::cout << "      Adb serial: " << instance.adb_ip_and_port()
-              << std::endl;
-    std::cout << "      Webrtc port: "
-              << std::to_string(config->sig_server_port()) << std::endl;
-    for (int i = 0; i < config->display_configs().size(); i++) {
-      std::cout << "      Display: " << config->display_configs()[i].width
-                << " x " << config->display_configs()[i].height << " ("
-                << config->display_configs()[i].height << ") " << std::endl;
-    }
-  }
-
   auto monitor_path = instance.launcher_monitor_socket_path();
   CHECK_PRINT(print, !monitor_path.empty(),
               "No path to launcher monitor found");
@@ -148,7 +131,23 @@
                   "' response from launcher monitor");
 
   if (print) {
-    std::cout << "      Status: Running" << std::endl;
+    Json::Value device_info;
+    device_info["instance_name"] = instance.instance_name();
+    device_info["instance_dir"] = instance.instance_dir();
+    device_info["web_access"] =
+        "https://" + config->sig_server_address() + ":" +
+        std::to_string(config->sig_server_port()) +
+        "/client.html?deviceId=" + instance.instance_name();
+    device_info["adb_serial"] = instance.adb_ip_and_port();
+    device_info["webrtc_port"] = std::to_string(config->sig_server_port());
+    for (int i = 0; i < config->display_configs().size(); i++) {
+      device_info["displays"][i] =
+          std::to_string(config->display_configs()[i].width) + " x " +
+          std::to_string(config->display_configs()[i].height) + " ( " +
+          std::to_string(config->display_configs()[i].dpi) + " )";
+    }
+    device_info["status"] = "Running";
+    std::cout << device_info.toStyledString() << std::endl;
   } else {
     LOG(INFO) << "run_cvd is active.";
   }
diff --git a/host/commands/stop/main.cc b/host/commands/stop/main.cc
index feeca9e..650c2f0 100644
--- a/host/commands/stop/main.cc
+++ b/host/commands/stop/main.cc
@@ -214,7 +214,7 @@
 
   std::vector<Flag> flags;
 
-  std::int32_t wait_for_launcher;
+  std::int32_t wait_for_launcher = 5;
   flags.emplace_back(
       GflagsCompatFlag("wait_for_launcher", wait_for_launcher)
           .Help("How many seconds to wait for the launcher to respond to the "
diff --git a/host/frontend/webrtc/connection_observer.cpp b/host/frontend/webrtc/connection_observer.cpp
index d51f3c1..d2158d8 100644
--- a/host/frontend/webrtc/connection_observer.cpp
+++ b/host/frontend/webrtc/connection_observer.cpp
@@ -345,11 +345,10 @@
   void OnBluetoothChannelOpen(std::function<bool(const uint8_t *, size_t)>
                                   bluetooth_message_sender) override {
     LOG(VERBOSE) << "Bluetooth channel open";
+    auto config = cuttlefish::CuttlefishConfig::Get();
+    CHECK(config) << "Failed to get config";
     bluetooth_handler_.reset(new cuttlefish::webrtc_streaming::BluetoothHandler(
-        cuttlefish::CuttlefishConfig::Get()
-            ->ForDefaultInstance()
-            .rootcanal_test_port(),
-        bluetooth_message_sender));
+        config->rootcanal_test_port(), bluetooth_message_sender));
   }
 
   void OnBluetoothMessage(const uint8_t *msg, size_t size) override {
diff --git a/host/libs/config/bootconfig_args.cpp b/host/libs/config/bootconfig_args.cpp
index 0c1a026..e5e3230 100644
--- a/host/libs/config/bootconfig_args.cpp
+++ b/host/libs/config/bootconfig_args.cpp
@@ -78,8 +78,7 @@
   auto vmm = vm_manager::GetVmManager(config.vm_manager(), config.target_arch());
   bootconfig_args.push_back(
       vmm->ConfigureBootDevices(instance.virtual_disk_paths().size()));
-  AppendVector(&bootconfig_args, vmm->ConfigureGraphics(config.gpu_mode(),
-      config.hwcomposer()));
+  AppendVector(&bootconfig_args, vmm->ConfigureGraphics(config));
 
   bootconfig_args.push_back(
       concat("androidboot.serialno=", instance.serial_number()));
diff --git a/host/libs/config/cuttlefish_config.cpp b/host/libs/config/cuttlefish_config.cpp
index 0b0022f..b32f047 100644
--- a/host/libs/config/cuttlefish_config.cpp
+++ b/host/libs/config/cuttlefish_config.cpp
@@ -92,7 +92,7 @@
 const char* const kGpuModeGfxStream = "gfxstream";
 
 const char* const kHwComposerAuto = "auto";
-const char* const kHwComposerDrmMinigbm = "drm_minigbm";
+const char* const kHwComposerDrm = "drm";
 const char* const kHwComposerRanchu = "ranchu";
 
 std::string DefaultEnvironmentPath(const char* environment_key,
@@ -174,6 +174,14 @@
   return (*dictionary_)[kEnableGpuUdmabuf].asBool();
 }
 
+static constexpr char kEnableGpuAngle[] = "enable_gpu_angle";
+void CuttlefishConfig::set_enable_gpu_angle(const bool enable_gpu_angle) {
+  (*dictionary_)[kEnableGpuAngle] = enable_gpu_angle;
+}
+bool CuttlefishConfig::enable_gpu_angle() const {
+  return (*dictionary_)[kEnableGpuAngle].asBool();
+}
+
 static constexpr char kCpus[] = "cpus";
 int CuttlefishConfig::cpus() const { return (*dictionary_)[kCpus].asInt(); }
 void CuttlefishConfig::set_cpus(int cpus) { (*dictionary_)[kCpus] = cpus; }
@@ -742,6 +750,51 @@
   return (*dictionary_)[kWmediumdConfig].asString();
 }
 
+static constexpr char kRootcanalHciPort[] = "rootcanal_hci_port";
+int CuttlefishConfig::rootcanal_hci_port() const {
+  return (*dictionary_)[kRootcanalHciPort].asInt();
+}
+void CuttlefishConfig::set_rootcanal_hci_port(int rootcanal_hci_port) {
+  (*dictionary_)[kRootcanalHciPort] = rootcanal_hci_port;
+}
+
+static constexpr char kRootcanalLinkPort[] = "rootcanal_link_port";
+int CuttlefishConfig::rootcanal_link_port() const {
+  return (*dictionary_)[kRootcanalLinkPort].asInt();
+}
+void CuttlefishConfig::set_rootcanal_link_port(int rootcanal_link_port) {
+  (*dictionary_)[kRootcanalLinkPort] = rootcanal_link_port;
+}
+
+static constexpr char kRootcanalTestPort[] = "rootcanal_test_port";
+int CuttlefishConfig::rootcanal_test_port() const {
+  return (*dictionary_)[kRootcanalTestPort].asInt();
+}
+void CuttlefishConfig::set_rootcanal_test_port(int rootcanal_test_port) {
+  (*dictionary_)[kRootcanalTestPort] = rootcanal_test_port;
+}
+
+static constexpr char kRootcanalConfigFile[] = "rootcanal_config_file";
+std::string CuttlefishConfig::rootcanal_config_file() const {
+  return (*dictionary_)[kRootcanalConfigFile].asString();
+}
+void CuttlefishConfig::set_rootcanal_config_file(
+    const std::string& rootcanal_config_file) {
+  (*dictionary_)[kRootcanalConfigFile] =
+      DefaultHostArtifactsPath(rootcanal_config_file);
+}
+
+static constexpr char kRootcanalDefaultCommandsFile[] =
+    "rootcanal_default_commands_file";
+std::string CuttlefishConfig::rootcanal_default_commands_file() const {
+  return (*dictionary_)[kRootcanalDefaultCommandsFile].asString();
+}
+void CuttlefishConfig::set_rootcanal_default_commands_file(
+    const std::string& rootcanal_default_commands_file) {
+  (*dictionary_)[kRootcanalDefaultCommandsFile] =
+      DefaultHostArtifactsPath(rootcanal_default_commands_file);
+}
+
 static constexpr char kRecordScreen[] = "record_screen";
 void CuttlefishConfig::set_record_screen(bool record_screen) {
   (*dictionary_)[kRecordScreen] = record_screen;
diff --git a/host/libs/config/cuttlefish_config.h b/host/libs/config/cuttlefish_config.h
index fc38be8..e312e97 100644
--- a/host/libs/config/cuttlefish_config.h
+++ b/host/libs/config/cuttlefish_config.h
@@ -110,6 +110,9 @@
   void set_enable_gpu_udmabuf(const bool enable_gpu_udmabuf);
   bool enable_gpu_udmabuf() const;
 
+  void set_enable_gpu_angle(const bool enable_gpu_angle);
+  bool enable_gpu_angle() const;
+
   int cpus() const;
   void set_cpus(int cpus);
 
@@ -310,6 +313,22 @@
   void set_wmediumd_config(const std::string& path);
   std::string wmediumd_config() const;
 
+  void set_rootcanal_hci_port(int rootcanal_hci_port);
+  int rootcanal_hci_port() const;
+
+  void set_rootcanal_link_port(int rootcanal_link_port);
+  int rootcanal_link_port() const;
+
+  void set_rootcanal_test_port(int rootcanal_test_port);
+  int rootcanal_test_port() const;
+
+  void set_rootcanal_config_file(const std::string& rootcanal_config_file);
+  std::string rootcanal_config_file() const;
+
+  void set_rootcanal_default_commands_file(
+      const std::string& rootcanal_default_commands_file);
+  std::string rootcanal_default_commands_file() const;
+
   void set_record_screen(bool record_screen);
   bool record_screen() const;
 
@@ -389,14 +408,8 @@
     // Port number to connect to the gnss grpc proxy server on the host
     int gnss_grpc_proxy_server_port() const;
     std::string adb_ip_and_port() const;
-    // Port number to connect to the root-canal on the host
-    int rootcanal_hci_port() const;
-    int rootcanal_link_port() const;
-    int rootcanal_test_port() const;
     // Port number to connect to the camera hal on the guest
     int camera_server_port() const;
-    std::string rootcanal_config_file() const;
-    std::string rootcanal_default_commands_file() const;
 
     std::string adb_device_name() const;
     std::string gnss_file_path() const;
@@ -477,6 +490,9 @@
     // Whether this instance should start the wmediumd process
     bool start_wmediumd() const;
 
+    // Whether this instance should start a rootcanal instance
+    bool start_rootcanal() const;
+
     // Whether this instance should start an ap instance
     bool start_ap() const;
 
@@ -487,6 +503,8 @@
 
     std::string persistent_bootconfig_path() const;
 
+    std::string vbmeta_path() const;
+
     std::string id() const;
   };
 
@@ -515,13 +533,7 @@
     void set_modem_simulator_host_id(int modem_simulator_id);
     void set_adb_ip_and_port(const std::string& ip_port);
     void set_confui_host_vsock_port(int confui_host_port);
-    void set_rootcanal_hci_port(int rootcanal_hci_port);
-    void set_rootcanal_link_port(int rootcanal_link_port);
-    void set_rootcanal_test_port(int rootcanal_test_port);
     void set_camera_server_port(int camera_server_port);
-    void set_rootcanal_config_file(const std::string& rootcanal_config_file);
-    void set_rootcanal_default_commands_file(
-        const std::string& rootcanal_default_commands_file);
     void set_mobile_bridge_name(const std::string& mobile_bridge_name);
     void set_mobile_tap_name(const std::string& mobile_tap_name);
     void set_wifi_tap_name(const std::string& wifi_tap_name);
@@ -537,6 +549,7 @@
     void set_start_webrtc_signaling_server(bool start);
     void set_start_webrtc_sig_server_proxy(bool start);
     void set_start_wmediumd(bool start);
+    void set_start_rootcanal(bool start);
     void set_start_ap(bool start);
     // Wifi MAC address inside the guest
     void set_wifi_mac_prefix(const int wifi_mac_prefix);
@@ -601,6 +614,6 @@
 
 // HwComposer modes
 extern const char* const kHwComposerAuto;
-extern const char* const kHwComposerDrmMinigbm;
+extern const char* const kHwComposerDrm;
 extern const char* const kHwComposerRanchu;
 }  // namespace cuttlefish
diff --git a/host/libs/config/cuttlefish_config_instance.cpp b/host/libs/config/cuttlefish_config_instance.cpp
index 518a6e1..91a4bd6 100644
--- a/host/libs/config/cuttlefish_config_instance.cpp
+++ b/host/libs/config/cuttlefish_config_instance.cpp
@@ -175,6 +175,10 @@
   return AbsolutePath(PerInstancePath("persistent_composite.img"));
 }
 
+std::string CuttlefishConfig::InstanceSpecific::vbmeta_path() const {
+  return AbsolutePath(PerInstancePath("vbmeta.img"));
+}
+
 std::string CuttlefishConfig::InstanceSpecific::uboot_env_image_path() const {
   return AbsolutePath(PerInstancePath("uboot_env.img"));
 }
@@ -357,33 +361,6 @@
   (*Dictionary())[kConfigServerPort] = config_server_port;
 }
 
-static constexpr char kRootcanalHciPort[] = "rootcanal_hci_port";
-int CuttlefishConfig::InstanceSpecific::rootcanal_hci_port() const {
-  return (*Dictionary())[kRootcanalHciPort].asInt();
-}
-void CuttlefishConfig::MutableInstanceSpecific::set_rootcanal_hci_port(
-    int rootcanal_hci_port) {
-  (*Dictionary())[kRootcanalHciPort] = rootcanal_hci_port;
-}
-
-static constexpr char kRootcanalLinkPort[] = "rootcanal_link_port";
-int CuttlefishConfig::InstanceSpecific::rootcanal_link_port() const {
-  return (*Dictionary())[kRootcanalLinkPort].asInt();
-}
-void CuttlefishConfig::MutableInstanceSpecific::set_rootcanal_link_port(
-    int rootcanal_link_port) {
-  (*Dictionary())[kRootcanalLinkPort] = rootcanal_link_port;
-}
-
-static constexpr char kRootcanalTestPort[] = "rootcanal_test_port";
-int CuttlefishConfig::InstanceSpecific::rootcanal_test_port() const {
-  return (*Dictionary())[kRootcanalTestPort].asInt();
-}
-void CuttlefishConfig::MutableInstanceSpecific::set_rootcanal_test_port(
-    int rootcanal_test_port) {
-  (*Dictionary())[kRootcanalTestPort] = rootcanal_test_port;
-}
-
 static constexpr char kCameraServerPort[] = "camera_server_port";
 int CuttlefishConfig::InstanceSpecific::camera_server_port() const {
   return (*Dictionary())[kCameraServerPort].asInt();
@@ -393,29 +370,6 @@
   (*Dictionary())[kCameraServerPort] = camera_server_port;
 }
 
-static constexpr char kRootcanalConfigFile[] = "rootcanal_config_file";
-std::string CuttlefishConfig::InstanceSpecific::rootcanal_config_file() const {
-  return (*Dictionary())[kRootcanalConfigFile].asString();
-}
-void CuttlefishConfig::MutableInstanceSpecific::set_rootcanal_config_file(
-    const std::string& rootcanal_config_file) {
-  (*Dictionary())[kRootcanalConfigFile] =
-      DefaultHostArtifactsPath(rootcanal_config_file);
-}
-
-static constexpr char kRootcanalDefaultCommandsFile[] =
-    "rootcanal_default_commands_file";
-std::string
-CuttlefishConfig::InstanceSpecific::rootcanal_default_commands_file() const {
-  return (*Dictionary())[kRootcanalDefaultCommandsFile].asString();
-}
-void CuttlefishConfig::MutableInstanceSpecific::
-    set_rootcanal_default_commands_file(
-        const std::string& rootcanal_default_commands_file) {
-  (*Dictionary())[kRootcanalDefaultCommandsFile] =
-      DefaultHostArtifactsPath(rootcanal_default_commands_file);
-}
-
 static constexpr char kWebrtcDeviceId[] = "webrtc_device_id";
 void CuttlefishConfig::MutableInstanceSpecific::set_webrtc_device_id(
     const std::string& id) {
@@ -450,6 +404,15 @@
   return (*Dictionary())[kStartWmediumd].asBool();
 }
 
+static constexpr char kStartRootcanal[] = "start_rootcanal";
+void CuttlefishConfig::MutableInstanceSpecific::set_start_rootcanal(
+    bool start) {
+  (*Dictionary())[kStartRootcanal] = start;
+}
+bool CuttlefishConfig::InstanceSpecific::start_rootcanal() const {
+  return (*Dictionary())[kStartRootcanal].asBool();
+}
+
 static constexpr char kStartAp[] = "start_ap";
 void CuttlefishConfig::MutableInstanceSpecific::set_start_ap(bool start) {
   (*Dictionary())[kStartAp] = start;
diff --git a/host/libs/vm_manager/crosvm_manager.cpp b/host/libs/vm_manager/crosvm_manager.cpp
index 2b729f5..9e146a5 100644
--- a/host/libs/vm_manager/crosvm_manager.cpp
+++ b/host/libs/vm_manager/crosvm_manager.cpp
@@ -58,34 +58,35 @@
 }
 
 std::vector<std::string> CrosvmManager::ConfigureGraphics(
-    const std::string& gpu_mode, const std::string& hwcomposer) {
+    const CuttlefishConfig& config) {
   // Override the default HAL search paths in all cases. We do this because
   // the HAL search path allows for fallbacks, and fallbacks in conjunction
   // with properities lead to non-deterministic behavior while loading the
   // HALs.
-  if (gpu_mode == kGpuModeGuestSwiftshader) {
+  if (config.gpu_mode() == kGpuModeGuestSwiftshader) {
     return {
         "androidboot.cpuvulkan.version=" + std::to_string(VK_API_VERSION_1_2),
         "androidboot.hardware.gralloc=minigbm",
-        "androidboot.hardware.hwcomposer="+ hwcomposer,
+        "androidboot.hardware.hwcomposer="+ config.hwcomposer(),
         "androidboot.hardware.egl=angle",
         "androidboot.hardware.vulkan=pastel",
         "androidboot.opengles.version=196609"};  // OpenGL ES 3.1
   }
 
-  if (gpu_mode == kGpuModeDrmVirgl) {
+  if (config.gpu_mode() == kGpuModeDrmVirgl) {
     return {
       "androidboot.cpuvulkan.version=0",
       "androidboot.hardware.gralloc=minigbm",
-      "androidboot.hardware.hwcomposer=drm_minigbm",
+      "androidboot.hardware.hwcomposer=drm",
       "androidboot.hardware.egl=mesa",
     };
   }
-  if (gpu_mode == kGpuModeGfxStream) {
+  if (config.gpu_mode() == kGpuModeGfxStream) {
+    std::string gles_impl = config.enable_gpu_angle() ? "angle" : "emulation";
     return {"androidboot.cpuvulkan.version=0",
             "androidboot.hardware.gralloc=minigbm",
-            "androidboot.hardware.hwcomposer=" + hwcomposer,
-            "androidboot.hardware.egl=emulation",
+            "androidboot.hardware.hwcomposer=" + config.hwcomposer(),
+            "androidboot.hardware.egl=" + gles_impl,
             "androidboot.hardware.vulkan=ranchu",
             "androidboot.hardware.gltransport=virtio-gpu-asg",
             "androidboot.opengles.version=196608"};  // OpenGL ES 3.0
@@ -141,12 +142,14 @@
   auto gpu_capture_enabled = !config.gpu_capture_binary().empty();
   auto gpu_mode = config.gpu_mode();
   auto udmabuf_string = config.enable_gpu_udmabuf() ? "true" : "false";
+  auto angle_string = config.enable_gpu_angle() ? "true" : "false";
   if (gpu_mode == kGpuModeGuestSwiftshader) {
     crosvm_cmd.Cmd().AddParameter("--gpu=2D,udmabuf=", udmabuf_string);
   } else if (gpu_mode == kGpuModeDrmVirgl || gpu_mode == kGpuModeGfxStream) {
     crosvm_cmd.Cmd().AddParameter(
         gpu_mode == kGpuModeGfxStream ? "--gpu=gfxstream," : "--gpu=",
-        "egl=true,surfaceless=true,glx=false,gles=true,udmabuf=", udmabuf_string);
+        "egl=true,surfaceless=true,glx=false,gles=true,udmabuf=", udmabuf_string,
+        ",angle=", angle_string);
   }
 
   for (const auto& display_config : config.display_configs()) {
diff --git a/host/libs/vm_manager/crosvm_manager.h b/host/libs/vm_manager/crosvm_manager.h
index 0c14da8..bfd5b79 100644
--- a/host/libs/vm_manager/crosvm_manager.h
+++ b/host/libs/vm_manager/crosvm_manager.h
@@ -34,8 +34,8 @@
   virtual ~CrosvmManager() = default;
 
   bool IsSupported() override;
-  std::vector<std::string> ConfigureGraphics(const std::string&,
-      const std::string&) override;
+  std::vector<std::string> ConfigureGraphics(
+      const CuttlefishConfig& config) override;
   std::string ConfigureBootDevices(int num_disks) override;
 
   std::vector<cuttlefish::Command> StartCommands(
diff --git a/host/libs/vm_manager/qemu_manager.cpp b/host/libs/vm_manager/qemu_manager.cpp
index c8bce99..1f38502 100644
--- a/host/libs/vm_manager/qemu_manager.cpp
+++ b/host/libs/vm_manager/qemu_manager.cpp
@@ -124,8 +124,8 @@
 }
 
 std::vector<std::string> QemuManager::ConfigureGraphics(
-    const std::string& gpu_mode, const std::string& hwcomposer) {
-  if (gpu_mode == kGpuModeGuestSwiftshader) {
+    const CuttlefishConfig& config) {
+  if (config.gpu_mode() == kGpuModeGuestSwiftshader) {
     // Override the default HAL search paths in all cases. We do this because
     // the HAL search path allows for fallbacks, and fallbacks in conjunction
     // with properities lead to non-deterministic behavior while loading the
@@ -133,17 +133,17 @@
     return {
         "androidboot.cpuvulkan.version=" + std::to_string(VK_API_VERSION_1_1),
         "androidboot.hardware.gralloc=minigbm",
-        "androidboot.hardware.hwcomposer=" + hwcomposer,
+        "androidboot.hardware.hwcomposer=" + config.hwcomposer(),
         "androidboot.hardware.egl=angle",
         "androidboot.hardware.vulkan=pastel",
     };
   }
 
-  if (gpu_mode == kGpuModeDrmVirgl) {
+  if (config.gpu_mode() == kGpuModeDrmVirgl) {
     return {
       "androidboot.cpuvulkan.version=0",
       "androidboot.hardware.gralloc=minigbm",
-      "androidboot.hardware.hwcomposer=drm_minigbm",
+      "androidboot.hardware.hwcomposer=drm",
       "androidboot.hardware.egl=mesa",
     };
   }
diff --git a/host/libs/vm_manager/qemu_manager.h b/host/libs/vm_manager/qemu_manager.h
index 21ff3d0..f213ca2 100644
--- a/host/libs/vm_manager/qemu_manager.h
+++ b/host/libs/vm_manager/qemu_manager.h
@@ -35,8 +35,8 @@
   virtual ~QemuManager() = default;
 
   bool IsSupported() override;
-  std::vector<std::string> ConfigureGraphics(const std::string&,
-      const std::string&) override;
+  std::vector<std::string> ConfigureGraphics(
+      const CuttlefishConfig& config) override;
   std::string ConfigureBootDevices(int num_disks) override;
 
   std::vector<cuttlefish::Command> StartCommands(
diff --git a/host/libs/vm_manager/vm_manager.h b/host/libs/vm_manager/vm_manager.h
index f829b6b..4944f69 100644
--- a/host/libs/vm_manager/vm_manager.h
+++ b/host/libs/vm_manager/vm_manager.h
@@ -58,8 +58,8 @@
   virtual ~VmManager() = default;
 
   virtual bool IsSupported() = 0;
-  virtual std::vector<std::string> ConfigureGraphics(const std::string&,
-      const std::string&) = 0;
+  virtual std::vector<std::string> ConfigureGraphics(
+      const CuttlefishConfig& config) = 0;
   virtual std::string ConfigureBootDevices(int num_disks) = 0;
 
   // Starts the VMM. It will usually build a command and pass it to the
diff --git a/shared/BoardConfig.mk b/shared/BoardConfig.mk
index 8fc1629..c8802bb 100644
--- a/shared/BoardConfig.mk
+++ b/shared/BoardConfig.mk
@@ -158,6 +158,7 @@
 BOARD_WLAN_DEVICE           := emulator
 BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_simulated_cf
 WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
+WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{AP}, 1}, {{P2P}, 1}}
 else
 BOARD_WLAN_DEVICE           := wlan0
 endif
diff --git a/shared/auto/device.mk b/shared/auto/device_vendor.mk
similarity index 89%
rename from shared/auto/device.mk
rename to shared/auto/device_vendor.mk
index 383e270..07698a9 100644
--- a/shared/auto/device.mk
+++ b/shared/auto/device_vendor.mk
@@ -14,13 +14,33 @@
 # limitations under the License.
 #
 
-################################################
-# Begin GCE specific configurations
-
 DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/auto/manifest.xml
+PRODUCT_MANIFEST_FILES += device/google/cuttlefish/shared/config/product_manifest.xml
+SYSTEM_EXT_MANIFEST_FILES += device/google/cuttlefish/shared/config/system_ext_manifest.xml
 
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
+$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
+$(call inherit-product, packages/services/Car/car_product/build/car.mk)
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
 
+PRODUCT_VENDOR_PROPERTIES += \
+    keyguard.no_require_sim=true \
+    ro.cdma.home.operator.alpha=Android \
+    ro.cdma.home.operator.numeric=302780 \
+    ro.com.android.dataroaming=true \
+    ro.telephony.default_network=9 \
+
+# Cuttlefish RIL support
+TARGET_USES_CF_RILD ?= true
+ifeq ($(TARGET_USES_CF_RILD),true)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
+PRODUCT_PACKAGES += \
+    libcuttlefish-ril-2 \
+    libcuttlefish-rild
+else
+TARGET_NO_TELEPHONY := true
+endif
+
 # Extend cuttlefish common sepolicy with auto-specific functionality
 BOARD_SEPOLICY_DIRS += device/google/cuttlefish/shared/auto/sepolicy/vendor
 
@@ -28,8 +48,8 @@
 # Begin general Android Auto Embedded configurations
 
 PRODUCT_COPY_FILES += \
-    packages/services/Car/car_product/init/init.bootstat.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw//init.bootstat.rc \
-    packages/services/Car/car_product/init/init.car.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw//init.car.rc
+    packages/services/Car/car_product/init/init.bootstat.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.bootstat.rc \
+    packages/services/Car/car_product/init/init.car.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.car.rc
 
 ifneq ($(LOCAL_SENSOR_FILE_OVERRIDES),true)
     PRODUCT_COPY_FILES += \
@@ -38,12 +58,12 @@
 endif
 
 PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/car_core_hardware.xml:system/etc/permissions/car_core_hardware.xml \
     frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
     frameworks/native/data/etc/android.hardware.broadcastradio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.broadcastradio.xml \
     frameworks/native/data/etc/android.hardware.faketouch.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.faketouch.xml \
     frameworks/native/data/etc/android.hardware.screen.landscape.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.landscape.xml \
     frameworks/native/data/etc/android.software.activities_on_secondary_displays.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.activities_on_secondary_displays.xml \
-    frameworks/native/data/etc/car_core_hardware.xml:system/etc/permissions/car_core_hardware.xml \
 
 # Preinstalled packages per user type
 PRODUCT_COPY_FILES += \
@@ -55,12 +75,6 @@
     frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
     frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \
 
-PRODUCT_VENDOR_PROPERTIES += \
-    keyguard.no_require_sim=true \
-    ro.cdma.home.operator.alpha=Android \
-    ro.cdma.home.operator.numeric=302780 \
-    ro.com.android.dataroaming=true \
-
 # vehicle HAL
 ifeq ($(LOCAL_VHAL_PRODUCT_PACKAGE),)
     LOCAL_VHAL_PRODUCT_PACKAGE := android.hardware.automotive.vehicle@2.0-service
@@ -83,31 +97,8 @@
     canhaldump \
     canhalsend
 
-# Cuttlefish RIL support
-TARGET_USES_CF_RILD ?= true
-ifeq ($(TARGET_USES_CF_RILD),true)
-    PRODUCT_PACKAGES += \
-        libcuttlefish-ril-2 \
-        libcuttlefish-rild
-endif
-
-# system_other support
-PRODUCT_PACKAGES += \
-    cppreopts.sh \
-
 BOARD_IS_AUTOMOTIVE := true
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
-$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
-$(call inherit-product, packages/services/Car/car_product/build/car.mk)
-
-# Placed here due to b/110784510
-PRODUCT_BRAND := generic
-
 DEVICE_PACKAGE_OVERLAYS += device/google/cuttlefish/shared/auto/overlay
 
 TARGET_BOARD_INFO_FILE ?= device/google/cuttlefish/shared/auto/android-info.txt
-
-PRODUCT_ENFORCE_RRO_TARGETS := framework-res
-
-TARGET_NO_TELEPHONY := true
diff --git a/shared/auto/preinstalled-packages-product-car-cuttlefish.xml b/shared/auto/preinstalled-packages-product-car-cuttlefish.xml
index 3c455f2..521f300 100644
--- a/shared/auto/preinstalled-packages-product-car-cuttlefish.xml
+++ b/shared/auto/preinstalled-packages-product-car-cuttlefish.xml
@@ -99,6 +99,22 @@
 	<install-in user-type="FULL" />
         <install-in user-type="SYSTEM" />
     </install-in-user-type>
+    <install-in-user-type package="com.android.apps.tag">
+        <install-in user-type="FULL" />
+        <install-in user-type="SYSTEM" />
+    </install-in-user-type>
+    <install-in-user-type package="com.android.imsserviceentitlement">
+        <install-in user-type="FULL" />
+        <install-in user-type="SYSTEM" />
+    </install-in-user-type>
+    <install-in-user-type package="com.android.cellbroadcastservice">
+        <install-in user-type="FULL" />
+        <install-in user-type="SYSTEM" />
+    </install-in-user-type>
+    <install-in-user-type package="com.android.cellbroadcastreceiver.module">
+        <install-in user-type="FULL" />
+        <install-in user-type="SYSTEM" />
+    </install-in-user-type>
 
 
 <!--
diff --git a/shared/config/Android.bp b/shared/config/Android.bp
index c1ea54b..3e5540f 100644
--- a/shared/config/Android.bp
+++ b/shared/config/Android.bp
@@ -46,6 +46,14 @@
     installable: false,
 }
 
+prebuilt_etc {
+    name: "p2p_supplicant.conf.cf",
+    src: "p2p_supplicant.conf",
+    filename_from_src: true,
+    relative_install_path: "wifi",
+    installable: false,
+}
+
 filegroup {
     name: "manifest_android.hardware.bluetooth@1.1-service.xml",
     srcs: ["manifest_android.hardware.bluetooth@1.1-service.xml"]
diff --git a/shared/config/fstab-erofs.ext4 b/shared/config/fstab-erofs.ext4
deleted file mode 100644
index 7722fbe..0000000
--- a/shared/config/fstab-erofs.ext4
+++ /dev/null
@@ -1,19 +0,0 @@
-/dev/block/by-name/boot /boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=boot
-/dev/block/by-name/init_boot /init_boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=init_boot
-/dev/block/by-name/vendor_boot /vendor_boot emmc defaults recoveryonly,slotselect
-system /system erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system,avb_keys=/avb
-# Add all non-dynamic partitions except system, after this comment
-/dev/block/by-name/userdata /data ext4 nodev,noatime,nosuid,errors=panic latemount,wait,check,quota,formattable,fileencryption=aes-256-xts:aes-256-cts,keydirectory=/metadata/vold/metadata_encryption,checkpoint=block
-/dev/block/by-name/metadata /metadata ext4 nodev,noatime,nosuid,errors=panic wait,formattable,first_stage_mount,check
-/dev/block/by-name/misc /misc emmc defaults defaults
-# Add all dynamic partitions except system, after this comment
-odm /odm erofs ro wait,logical,first_stage_mount,slotselect,avb
-product /product erofs ro wait,logical,first_stage_mount,slotselect,avb
-system_ext /system_ext erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system
-vendor /vendor erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta
-vendor_dlkm /vendor_dlkm erofs noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
-odm_dlkm /odm_dlkm erofs noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
-/dev/block/zram0 none swap defaults zramsize=75%
-/dev/block/vdc1 /sdcard vfat defaults recoveryonly
-/devices/*/block/vdc auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
-shared /mnt/vendor/shared virtiofs nosuid,nodev,noatime nofail
diff --git a/shared/config/fstab-erofs.f2fs b/shared/config/fstab-erofs.f2fs
deleted file mode 100644
index 0b28b93..0000000
--- a/shared/config/fstab-erofs.f2fs
+++ /dev/null
@@ -1,19 +0,0 @@
-/dev/block/by-name/boot /boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=boot
-/dev/block/by-name/init_boot /init_boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=init_boot
-/dev/block/by-name/vendor_boot /vendor_boot emmc defaults recoveryonly,slotselect
-system /system erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system,avb_keys=/avb
-# Add all non-dynamic partitions except system, after this comment
-/dev/block/by-name/userdata /data f2fs nodev,noatime,nosuid,inlinecrypt,reserve_root=32768 latemount,wait,check,quota,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,fscompress,keydirectory=/metadata/vold/metadata_encryption,checkpoint=fs
-/dev/block/by-name/metadata /metadata ext4 nodev,noatime,nosuid,errors=panic wait,formattable,first_stage_mount,check
-/dev/block/by-name/misc /misc emmc defaults defaults
-# Add all dynamic partitions except system, after this comment
-odm /odm erofs ro wait,logical,first_stage_mount,slotselect,avb
-product /product erofs ro wait,logical,first_stage_mount,slotselect,avb
-system_ext /system_ext erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system
-vendor /vendor erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta
-vendor_dlkm /vendor_dlkm erofs noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
-odm_dlkm /odm_dlkm erofs noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
-/dev/block/zram0 none swap defaults zramsize=75%
-/dev/block/vdc1 /sdcard vfat defaults recoveryonly
-/devices/*/block/vdc auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
-shared /mnt/vendor/shared virtiofs nosuid,nodev,noatime nofail
diff --git a/shared/config/fstab.ext4 b/shared/config/fstab.ext4
index 7567d14..2e1fa6c 100644
--- a/shared/config/fstab.ext4
+++ b/shared/config/fstab.ext4
@@ -1,18 +1,27 @@
+# Non-dynamic, boot critical partitions
 /dev/block/by-name/boot /boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=boot
 /dev/block/by-name/init_boot /init_boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=init_boot
 /dev/block/by-name/vendor_boot /vendor_boot emmc defaults recoveryonly,slotselect
+system /system erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system,avb_keys=/avb
 system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb=vbmeta_system,avb_keys=/avb
 # Add all non-dynamic partitions except system, after this comment
 /dev/block/by-name/userdata /data ext4 nodev,noatime,nosuid,errors=panic latemount,wait,check,quota,formattable,fileencryption=aes-256-xts:aes-256-cts,keydirectory=/metadata/vold/metadata_encryption,checkpoint=block
 /dev/block/by-name/metadata /metadata ext4 nodev,noatime,nosuid,errors=panic wait,formattable,first_stage_mount,check
 /dev/block/by-name/misc /misc emmc defaults defaults
 # Add all dynamic partitions except system, after this comment
+odm /odm erofs ro wait,logical,first_stage_mount,slotselect,avb
 odm /odm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+product /product erofs ro wait,logical,first_stage_mount,slotselect,avb
 product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+system_ext /system_ext erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system
 system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb=vbmeta_system
+vendor /vendor erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta
 vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb=vbmeta
+vendor_dlkm /vendor_dlkm erofs ro wait,logical,first_stage_mount,slotselect,avb
 vendor_dlkm /vendor_dlkm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+odm_dlkm /odm_dlkm erofs ro wait,logical,first_stage_mount,slotselect,avb
 odm_dlkm /odm_dlkm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+# ZRAM, SD-Card and virtiofs shares
 /dev/block/zram0 none swap defaults zramsize=75%
 /dev/block/vdc1 /sdcard vfat defaults recoveryonly
 /devices/*/block/vdc auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
diff --git a/shared/config/fstab.f2fs b/shared/config/fstab.f2fs
index 008ca00..e546335 100644
--- a/shared/config/fstab.f2fs
+++ b/shared/config/fstab.f2fs
@@ -1,18 +1,27 @@
+# Non-dynamic, boot critical partitions
 /dev/block/by-name/boot /boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=boot
 /dev/block/by-name/init_boot /init_boot emmc defaults recoveryonly,slotselect,first_stage_mount,avb=init_boot
 /dev/block/by-name/vendor_boot /vendor_boot emmc defaults recoveryonly,slotselect
+system /system erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system,avb_keys=/avb
 system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb=vbmeta_system,avb_keys=/avb
 # Add all non-dynamic partitions except system, after this comment
 /dev/block/by-name/userdata /data f2fs nodev,noatime,nosuid,inlinecrypt,reserve_root=32768 latemount,wait,check,quota,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,fscompress,keydirectory=/metadata/vold/metadata_encryption,checkpoint=fs
 /dev/block/by-name/metadata /metadata ext4 nodev,noatime,nosuid,errors=panic wait,formattable,first_stage_mount,check
 /dev/block/by-name/misc /misc emmc defaults defaults
 # Add all dynamic partitions except system, after this comment
+odm /odm erofs ro wait,logical,first_stage_mount,slotselect,avb
 odm /odm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+product /product erofs ro wait,logical,first_stage_mount,slotselect,avb
 product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+system_ext /system_ext erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta_system
 system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb=vbmeta_system
+vendor /vendor erofs ro wait,logical,first_stage_mount,slotselect,avb=vbmeta
 vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb=vbmeta
+vendor_dlkm /vendor_dlkm erofs ro wait,logical,first_stage_mount,slotselect,avb
 vendor_dlkm /vendor_dlkm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+odm_dlkm /odm_dlkm erofs ro wait,logical,first_stage_mount,slotselect,avb
 odm_dlkm /odm_dlkm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect,avb
+# ZRAM, SD-Card and virtiofs shares
 /dev/block/zram0 none swap defaults zramsize=75%
 /dev/block/vdc1 /sdcard vfat defaults recoveryonly
 /devices/*/block/vdc auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
diff --git a/shared/config/p2p_supplicant.conf b/shared/config/p2p_supplicant.conf
new file mode 100644
index 0000000..6d12807
--- /dev/null
+++ b/shared/config/p2p_supplicant.conf
@@ -0,0 +1,3 @@
+disable_scan_offload=1
+update_config=1
+p2p_go_vht=1
diff --git a/shared/config/wpa_supplicant.rc b/shared/config/wpa_supplicant.rc
index 843279a..a57f5c1 100644
--- a/shared/config/wpa_supplicant.rc
+++ b/shared/config/wpa_supplicant.rc
@@ -1,4 +1,7 @@
-service wpa_supplicant /vendor/bin/hw/wpa_supplicant -g@android:wpa_wlan0
+service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
+        -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
diff --git a/shared/device.mk b/shared/device.mk
index 5d79ca6..d35227d 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -106,6 +106,7 @@
     ro.hardware.virtual_device=1 \
     ro.logd.size=1M \
     wifi.interface=wlan0 \
+    wifi.direct.interface=p2p-dev-wlan0 \
     persist.sys.zram_enabled=1 \
     ro.hardware.keystore_desede=true \
     ro.rebootescrow.device=/dev/block/pmem0 \
@@ -291,6 +292,7 @@
     frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
     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.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
+    frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
     frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \
     frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \
     frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
@@ -328,7 +330,6 @@
     device/google/cuttlefish/shared/config/input/Crosvm_Virtio_Multitouch_Touchscreen_3.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/Crosvm_Virtio_Multitouch_Touchscreen_3.idc
 endif
 
-ifeq ($(TARGET_RO_FILE_SYSTEM_TYPE),ext4)
 PRODUCT_COPY_FILES += \
     device/google/cuttlefish/shared/config/fstab.f2fs:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.f2fs \
     device/google/cuttlefish/shared/config/fstab.f2fs:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.f2fs \
@@ -336,15 +337,6 @@
     device/google/cuttlefish/shared/config/fstab.ext4:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.ext4 \
     device/google/cuttlefish/shared/config/fstab.ext4:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ext4 \
     device/google/cuttlefish/shared/config/fstab.ext4:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.ext4
-else
-PRODUCT_COPY_FILES += \
-    device/google/cuttlefish/shared/config/fstab-$(TARGET_RO_FILE_SYSTEM_TYPE).f2fs:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.f2fs \
-    device/google/cuttlefish/shared/config/fstab-$(TARGET_RO_FILE_SYSTEM_TYPE).f2fs:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.f2fs \
-    device/google/cuttlefish/shared/config/fstab-$(TARGET_RO_FILE_SYSTEM_TYPE).f2fs:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.f2fs \
-    device/google/cuttlefish/shared/config/fstab-$(TARGET_RO_FILE_SYSTEM_TYPE).ext4:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.ext4 \
-    device/google/cuttlefish/shared/config/fstab-$(TARGET_RO_FILE_SYSTEM_TYPE).ext4:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ext4 \
-    device/google/cuttlefish/shared/config/fstab-$(TARGET_RO_FILE_SYSTEM_TYPE).ext4:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.ext4
-endif
 
 ifeq ($(TARGET_VULKAN_SUPPORT),true)
 ifneq ($(LOCAL_PREFER_VENDOR_APEX),true)
@@ -397,7 +389,7 @@
 # Hardware Composer HAL
 #
 PRODUCT_PACKAGES += \
-    hwcomposer.drm_minigbm \
+    hwcomposer.drm \
     hwcomposer.cutf \
     hwcomposer-stats \
     android.hardware.graphics.composer@2.4-service
@@ -737,9 +729,11 @@
 
 # WLAN driver configuration files
 LOCAL_WPA_SUPPLICANT_OVERLAY ?= $(LOCAL_PATH)/config/wpa_supplicant_overlay.conf
+LOCAL_P2P_SUPPLICANT ?= $(LOCAL_PATH)/config/p2p_supplicant.conf
 PRODUCT_COPY_FILES += \
     external/wpa_supplicant_8/wpa_supplicant/wpa_supplicant_template.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \
-    $(LOCAL_WPA_SUPPLICANT_OVERLAY):$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
+    $(LOCAL_WPA_SUPPLICANT_OVERLAY):$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf \
+    $(LOCAL_P2P_SUPPLICANT):$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant.conf
 
 ifeq ($(PRODUCT_ENFORCE_MAC80211_HWSIM),true)
 PRODUCT_PACKAGES += \
@@ -752,6 +746,11 @@
 
 $(call soong_config_append,cvdhost,enforce_mac80211_hwsim,true)
 
+# Wifi Runtime Resource Overlay
+PRODUCT_PACKAGES += \
+    CuttlefishTetheringOverlay \
+    CuttlefishWifiOverlay
+
 else
 PRODUCT_PACKAGES += setup_wifi
 PRODUCT_VENDOR_PROPERTIES += ro.vendor.wifi_impl=virt_wifi
diff --git a/shared/phone/overlays/CuttlefishTetheringOverlay/Android.bp b/shared/phone/overlays/CuttlefishTetheringOverlay/Android.bp
new file mode 100644
index 0000000..a35bfd2
--- /dev/null
+++ b/shared/phone/overlays/CuttlefishTetheringOverlay/Android.bp
@@ -0,0 +1,10 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+runtime_resource_overlay {
+    name: "CuttlefishTetheringOverlay",
+    resource_dirs: ["res"],
+    vendor: true,
+    sdk_version: "current",
+}
diff --git a/shared/phone/overlays/CuttlefishTetheringOverlay/AndroidManifest.xml b/shared/phone/overlays/CuttlefishTetheringOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..467d0ef
--- /dev/null
+++ b/shared/phone/overlays/CuttlefishTetheringOverlay/AndroidManifest.xml
@@ -0,0 +1,29 @@
+<!--
+  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.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.networkstack.tethering.cuttlefishoverlay"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <application android:hasCode="false" />
+
+    <overlay
+        android:targetPackage="com.android.networkstack.tethering"
+        android:targetName="TetheringConfig"
+        android:priority="0"
+        android:isStatic="true"/>
+
+</manifest>
\ No newline at end of file
diff --git a/shared/phone/overlays/CuttlefishTetheringOverlay/res/values/config.xml b/shared/phone/overlays/CuttlefishTetheringOverlay/res/values/config.xml
new file mode 100644
index 0000000..00b6735
--- /dev/null
+++ b/shared/phone/overlays/CuttlefishTetheringOverlay/res/values/config.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string-array name="config_tether_wifi_regexs">
+      <item>"wlan\\d"</item>
+    </string-array>
+    <string-array name="config_tether_wifi_p2p_regexs">
+      <item>"p2p-wlan\\d-.*"</item>
+      <item>"p2p-dev-wlan\\d-.*"</item>
+      <item>"p2p\\d"</item>
+      <item>"p2p-p2p\\d-.*"</item>
+    </string-array>
+</resources>
diff --git a/shared/phone/overlays/CuttlefishWifiOverlay/Android.bp b/shared/phone/overlays/CuttlefishWifiOverlay/Android.bp
new file mode 100644
index 0000000..fd2f7eb
--- /dev/null
+++ b/shared/phone/overlays/CuttlefishWifiOverlay/Android.bp
@@ -0,0 +1,10 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+runtime_resource_overlay {
+    name: "CuttlefishWifiOverlay",
+    resource_dirs: ["res"],
+    vendor: true,
+    sdk_version: "current",
+}
diff --git a/shared/phone/overlays/CuttlefishWifiOverlay/AndroidManifest.xml b/shared/phone/overlays/CuttlefishWifiOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..bc29c5c
--- /dev/null
+++ b/shared/phone/overlays/CuttlefishWifiOverlay/AndroidManifest.xml
@@ -0,0 +1,29 @@
+<!--
+  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.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.wifi.resources.cf"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <application android:hasCode="false" />
+
+    <overlay
+        android:targetPackage="com.android.wifi.resources"
+      android:targetName="WifiCustomization"
+        android:priority="0"
+        android:isStatic="true"/>
+
+</manifest>
\ No newline at end of file
diff --git a/shared/phone/overlays/CuttlefishWifiOverlay/res/values/config.xml b/shared/phone/overlays/CuttlefishWifiOverlay/res/values/config.xml
new file mode 100644
index 0000000..450dbe8
--- /dev/null
+++ b/shared/phone/overlays/CuttlefishWifiOverlay/res/values/config.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- True if the firmware supports connected MAC randomization -->
+    <bool name="config_wifi_connected_mac_randomization_supported">true</bool>
+
+    <!-- True if the firmware supports p2p MAC randomization -->
+    <bool name="config_wifi_p2p_mac_randomization_supported">true</bool>
+
+    <!-- True if the firmware supports ap MAC randomization -->
+    <bool name="config_wifi_ap_mac_randomization_supported">true</bool>
+
+</resources>
diff --git a/vsoc_arm64/auto/aosp_cf.mk b/vsoc_arm64/auto/aosp_cf.mk
deleted file mode 100644
index 0f8c417..0000000
--- a/vsoc_arm64/auto/aosp_cf.mk
+++ /dev/null
@@ -1,31 +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.
-#
-
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
-$(call inherit-product, device/google/cuttlefish/shared/auto/device.mk)
-$(call inherit-product, device/google/cuttlefish/vsoc_arm64/kernel.mk)
-
-PRODUCT_NAME := aosp_cf_arm64_auto
-PRODUCT_DEVICE := vsoc_arm64
-PRODUCT_MANUFACTURER := Google
-PRODUCT_MODEL := Cuttlefish arm64 auto
-
-PRODUCT_VENDOR_PROPERTIES += \
-    ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
-    ro.soc.model=$(PRODUCT_DEVICE)
-
-# TODO(b/205788876) remove this when openwrt has an image for arm.
-PRODUCT_ENFORCE_MAC80211_HWSIM := false
\ No newline at end of file
diff --git a/vsoc_arm64/auto/OWNERS b/vsoc_arm64_only/auto/OWNERS
similarity index 100%
rename from vsoc_arm64/auto/OWNERS
rename to vsoc_arm64_only/auto/OWNERS
diff --git a/vsoc_arm64_only/auto/aosp_cf.mk b/vsoc_arm64_only/auto/aosp_cf.mk
new file mode 100644
index 0000000..4a46992
--- /dev/null
+++ b/vsoc_arm64_only/auto/aosp_cf.mk
@@ -0,0 +1,66 @@
+#
+# 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# FIXME: generic_system.mk sets 'PRODUCT_ENFORCE_RRO_TARGETS := *'
+#        but this breaks phone_car. So undo it here.
+PRODUCT_ENFORCE_RRO_TARGETS := frameworks-res
+
+# FIXME: Disable mainline path checks
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS :=
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/base_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# All components inherited here go to vendor image
+#
+LOCAL_DISABLE_OMX := true
+$(call inherit-product, device/google/cuttlefish/shared/auto/device_vendor.mk)
+
+# TODO(b/205788876) remove this when openwrt has an image for arm.
+PRODUCT_ENFORCE_MAC80211_HWSIM := false
+
+#
+# Special settings for the target
+#
+$(call inherit-product, device/google/cuttlefish/vsoc_arm64/kernel.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_arm64/bootloader.mk)
+
+# Exclude features that are not available on AOSP devices.
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/aosp_excluded_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/aosp_excluded_hardware.xml
+
+PRODUCT_NAME := aosp_cf_arm64_auto
+PRODUCT_DEVICE := vsoc_arm64_only
+PRODUCT_MANUFACTURER := Google
+PRODUCT_MODEL := Cuttlefish arm64 auto
+
+PRODUCT_VENDOR_PROPERTIES += \
+    ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
+    ro.soc.model=$(PRODUCT_DEVICE)
diff --git a/vsoc_x86/auto/aosp_cf.mk b/vsoc_x86/auto/aosp_cf.mk
new file mode 100644
index 0000000..4dc6c64
--- /dev/null
+++ b/vsoc_x86/auto/aosp_cf.mk
@@ -0,0 +1,61 @@
+#
+# 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# FIXME: generic_system.mk sets 'PRODUCT_ENFORCE_RRO_TARGETS := *'
+#        but this breaks phone_car. So undo it here.
+PRODUCT_ENFORCE_RRO_TARGETS := frameworks-res
+
+# FIXME: Disable mainline path checks
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS :=
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/base_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# All components inherited here go to vendor image
+#
+$(call inherit-product, device/google/cuttlefish/shared/auto/device_vendor.mk)
+
+#
+# Special settings for the target
+#
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/kernel.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/bootloader.mk)
+
+# Exclude features that are not available on AOSP devices.
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/aosp_excluded_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/aosp_excluded_hardware.xml
+
+PRODUCT_NAME := aosp_cf_x86_auto
+PRODUCT_DEVICE := vsoc_x86
+PRODUCT_MANUFACTURER := Google
+PRODUCT_MODEL := Cuttlefish x86 auto
+
+PRODUCT_VENDOR_PROPERTIES += \
+    ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
+    ro.soc.model=$(PRODUCT_DEVICE)
diff --git a/vsoc_x86/auto/device.mk b/vsoc_x86/auto/device.mk
deleted file mode 100644
index e0d5bad8..0000000
--- a/vsoc_x86/auto/device.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (C) 2017 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.
-#
-
-$(call inherit-product, device/google/cuttlefish/shared/auto/device.mk)
-$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/kernel.mk)
-$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/bootloader.mk)
-
-PRODUCT_NAME := aosp_cf_x86_auto
-PRODUCT_DEVICE := vsoc_x86
-PRODUCT_MANUFACTURER := Google
-PRODUCT_MODEL := Cuttlefish x86 auto
-
-PRODUCT_VENDOR_PROPERTIES += \
-    ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
-    ro.soc.model=$(PRODUCT_DEVICE)
diff --git a/vsoc_x86_64/auto/aosp_cf.mk b/vsoc_x86_64/auto/aosp_cf.mk
new file mode 100644
index 0000000..461aadc
--- /dev/null
+++ b/vsoc_x86_64/auto/aosp_cf.mk
@@ -0,0 +1,62 @@
+#
+# 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# FIXME: generic_system.mk sets 'PRODUCT_ENFORCE_RRO_TARGETS := *'
+#        but this breaks phone_car. So undo it here.
+PRODUCT_ENFORCE_RRO_TARGETS := frameworks-res
+
+# FIXME: Disable mainline path checks
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS :=
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/base_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# All components inherited here go to vendor image
+#
+$(call inherit-product, device/google/cuttlefish/shared/auto/device_vendor.mk)
+
+#
+# Special settings for the target
+#
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/kernel.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/bootloader.mk)
+
+# Exclude features that are not available on AOSP devices.
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/aosp_excluded_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/aosp_excluded_hardware.xml
+
+PRODUCT_NAME := aosp_cf_x86_64_auto
+PRODUCT_DEVICE := vsoc_x86_64
+PRODUCT_MANUFACTURER := Google
+PRODUCT_MODEL := Cuttlefish x86_64 auto
+
+PRODUCT_VENDOR_PROPERTIES += \
+    ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
+    ro.soc.model=$(PRODUCT_DEVICE)
diff --git a/vsoc_x86_64/auto/device.mk b/vsoc_x86_64/auto/device.mk
deleted file mode 100644
index b21f694..0000000
--- a/vsoc_x86_64/auto/device.mk
+++ /dev/null
@@ -1,29 +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.
-#
-
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
-$(call inherit-product, device/google/cuttlefish/shared/auto/device.mk)
-$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/kernel.mk)
-$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/bootloader.mk)
-
-PRODUCT_NAME := aosp_cf_x86_64_auto
-PRODUCT_DEVICE := vsoc_x86_64
-PRODUCT_MANUFACTURER := Google
-PRODUCT_MODEL := Cuttlefish x86_64 auto
-
-PRODUCT_VENDOR_PROPERTIES += \
-    ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
-    ro.soc.model=$(PRODUCT_DEVICE)