Merge "Add getKeyCharacteristics stub to KeyMint remote." am: 3256e9b36f am: 26399d1daf am: d13a019a92

Original change: https://android-review.googlesource.com/c/device/google/cuttlefish/+/1691107

Change-Id: I22e6bea934d342e83ccf65ffa260471ddf19c32f
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index cae5573..cee00d3 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -22,6 +22,7 @@
 	aosp_cf_x86_64_auto:$(LOCAL_DIR)/vsoc_x86_64/auto/device.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_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_pasan:$(LOCAL_DIR)/vsoc_x86/pasan/aosp_cf.mk \
@@ -38,6 +39,7 @@
 	aosp_cf_arm64_phone-userdebug \
 	aosp_cf_x86_64_pc-userdebug \
 	aosp_cf_x86_64_phone-userdebug \
+	aosp_cf_x86_64_foldable-userdebug \
 	aosp_cf_x86_auto-userdebug \
 	aosp_cf_x86_phone-userdebug \
-	aosp_cf_x86_tv-userdebug
\ No newline at end of file
+	aosp_cf_x86_tv-userdebug
diff --git a/guest/hals/ril/reference-ril/reference-ril.c b/guest/hals/ril/reference-ril/reference-ril.c
index f47640b..04cdfce 100644
--- a/guest/hals/ril/reference-ril/reference-ril.c
+++ b/guest/hals/ril/reference-ril/reference-ril.c
@@ -3185,6 +3185,23 @@
     RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
 }
 
+static uint64_t s_last_activity_info_query = 0;
+
+static void requestGetActivityInfo(void *data __unused, size_t datalen __unused, RIL_Token t)
+{
+    uint64_t curTime = ril_nano_time();
+    RIL_ActivityStatsInfo stats =
+    {
+        0, // sleep_mode_time_ms
+        ((curTime - s_last_activity_info_query) / 1000000) - 1, // idle_mode_time_ms
+        {0, 0, 0, 0, 0}, // tx_mode_time_ms
+        0 // rx_mode_time_ms
+    };
+    s_last_activity_info_query = curTime;
+
+    RIL_onRequestComplete(t, RIL_E_SUCCESS, &stats, sizeof(stats));
+}
+
 // TODO: Use all radio types
 static int techFromModemType(int mdmtype)
 {
@@ -4747,6 +4764,10 @@
             }
             break;
 
+        case RIL_REQUEST_GET_ACTIVITY_INFO:
+            requestGetActivityInfo(data, datalen, t);
+            break;
+
         case RIL_REQUEST_SCREEN_STATE:
             requestScreenState(data, t);
             break;
diff --git a/shared/auto/device.mk b/shared/auto/device.mk
index ada04d4..fb1ccdf 100644
--- a/shared/auto/device.mk
+++ b/shared/auto/device.mk
@@ -63,7 +63,7 @@
 
 # AudioControl HAL
 ifeq ($(LOCAL_AUDIOCONTROL_HAL_PRODUCT_PACKAGE),)
-    LOCAL_AUDIOCONTROL_HAL_PRODUCT_PACKAGE := [email protected]
+    LOCAL_AUDIOCONTROL_HAL_PRODUCT_PACKAGE := android.hardware.automotive.audiocontrol-service.example
 endif
 PRODUCT_PACKAGES += $(LOCAL_AUDIOCONTROL_HAL_PRODUCT_PACKAGE)
 
diff --git a/shared/config/CleanSpec.mk b/shared/config/CleanSpec.mk
index a74a710..9556fc5 100644
--- a/shared/config/CleanSpec.mk
+++ b/shared/config/CleanSpec.mk
@@ -50,3 +50,4 @@
 $(call add-clean-step, find $(PRODUCT_OUT)/vendor/bin/hw/ -type f -name "android.hardware.drm@*" -print0 | xargs -0 rm -f)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/[email protected])
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/[email protected])
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/[email protected])
diff --git a/shared/config/config_foldable.json b/shared/config/config_foldable.json
index 9ae7315..dd64d17 100644
--- a/shared/config/config_foldable.json
+++ b/shared/config/config_foldable.json
@@ -4,13 +4,31 @@
 	"dpi" : 386,
 	"memory_mb" : 4096,
 	"custom_actions" : [
-		{
-			"shell_command":"wm size | grep '816' && wm size 1768x2208 || wm size 816x2260",
-			"button":{
-				"command":"fold",
-				"title":"Fold/Unfold",
-				"icon_name":"chrome_reader_mode"
-			}
-		}
+                {
+                        "device_states": [
+                                {
+                                        "lid_switch_open": false,
+                                        "hinge_angle_value": 0
+                                }
+                        ],
+                        "button":{
+                                "command":"device_state_closed",
+                                "title":"Device State Closed",
+                                "icon_name":"smartphone"
+                        }
+                },
+                {
+                        "device_states": [
+                                {
+                                        "lid_switch_open": true,
+                                        "hinge_angle_value": 180
+                                }
+                        ],
+                        "button":{
+                                "command":"device_state_opened",
+                                "title":"Device State Opened",
+                                "icon_name":"tablet"
+                        }
+                }
 	]
 }
diff --git a/shared/config/init.vendor.rc b/shared/config/init.vendor.rc
index 184833f..dd33baf 100644
--- a/shared/config/init.vendor.rc
+++ b/shared/config/init.vendor.rc
@@ -130,6 +130,7 @@
     interface [email protected]::ISupplicant default
     interface [email protected]::ISupplicant default
     interface [email protected]::ISupplicant default
+    interface [email protected]::ISupplicant default
     socket wpa_wlan0 dgram 660 wifi wifi
     group system wifi inet
     disabled
diff --git a/shared/config/task_profiles.json b/shared/config/task_profiles.json
index 5844ee7..42366fc 100644
--- a/shared/config/task_profiles.json
+++ b/shared/config/task_profiles.json
@@ -14,32 +14,6 @@
       ]
     },
     {
-      "Name": "Frozen",
-      "Actions": [
-        {
-          "Name": "JoinCgroup",
-          "Params":
-          {
-            "Controller": "freezer",
-            "Path": "frozen"
-          }
-        }
-      ]
-    },
-    {
-      "Name": "Unfrozen",
-      "Actions": [
-        {
-          "Name": "JoinCgroup",
-          "Params":
-          {
-            "Controller": "freezer",
-            "Path": ""
-          }
-        }
-      ]
-    },
-    {
       "Name": "NormalPerformance",
       "Actions": [
         {
diff --git a/shared/device.mk b/shared/device.mk
index 3aa608d..db2a721 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -36,6 +36,7 @@
 
 PRODUCT_SOONG_NAMESPACES += device/generic/goldfish-opengl # for vulkan
 
+PRODUCT_FS_COMPRESSION := 1
 TARGET_RO_FILE_SYSTEM_TYPE ?= ext4
 TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE ?= f2fs
 TARGET_USERDATAIMAGE_PARTITION_SIZE ?= 6442450944
@@ -95,6 +96,7 @@
     ro.rebootescrow.device=/dev/block/pmem0 \
     ro.incremental.enable=1 \
     debug.c2.use_dmabufheaps=1 \
+    ro.camerax.extensions.enabled=true \
 
 # Below is a list of properties we probably should get rid of.
 PRODUCT_VENDOR_PROPERTIES += \
@@ -110,7 +112,7 @@
     debug.stagefright.c2inputsurface=-1
 
 # Enforce privapp permissions control.
-PRODUCT_VENDOR_PROPERTIES += ro.control_privapp_permissions=enforce
+PRODUCT_VENDOR_PROPERTIES += ro.control_privapp_permissions?=enforce
 
 # aes-256-heh default is not supported in standard kernels.
 PRODUCT_VENDOR_PROPERTIES += ro.crypto.volume.filenames_mode=aes-256-cts
@@ -134,6 +136,9 @@
 PRODUCT_PACKAGES += \
     checkpoint_gc
 
+# Enable CameraX extension sample
+PRODUCT_PACKAGES += androidx.camera.extensions.impl sample_camera_extensions.xml
+
 # DRM service opt-in
 PRODUCT_VENDOR_PROPERTIES += drm.service.enabled=true
 
@@ -160,7 +165,6 @@
 SOONG_CONFIG_cvd += launch_configs
 SOONG_CONFIG_cvd_launch_configs += \
     cvd_config_auto.json \
-    cvd_config_foldable.json \
     cvd_config_phone.json \
     cvd_config_tablet.json \
     cvd_config_tv.json \
@@ -286,6 +290,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.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 \
     frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml \
@@ -413,29 +418,41 @@
 DEVICE_PACKAGE_OVERLAYS += $(LOCAL_AUDIO_DEVICE_PACKAGE_OVERLAYS)
 
 #
-# BiometricsFace HAL
+# BiometricsFace HAL (HIDL)
 #
 PRODUCT_PACKAGES += \
     [email protected]
 
 #
-# BiometricsFingerprint HAL
+# BiometricsFingerprint HAL (HIDL)
 #
 PRODUCT_PACKAGES += \
-    [email protected]
+    [email protected]
+
+#
+# BiometricsFace HAL (AIDL)
+#
+PRODUCT_PACKAGES += \
+    android.hardware.biometrics.face-service.example
+
+#
+# BiometricsFingerprint HAL (AIDL)
+#
+PRODUCT_PACKAGES += \
+    android.hardware.biometrics.fingerprint-service.example
 
 #
 # Contexthub HAL
 #
 PRODUCT_PACKAGES += \
-    [email protected]
+    [email protected]
 
 #
 # Drm HAL
 #
 PRODUCT_PACKAGES += \
-    [email protected] \
-    [email protected]
+    [email protected] \
+    [email protected]
 
 #
 # Dumpstate HAL
@@ -449,9 +466,9 @@
 # Camera
 #
 PRODUCT_PACKAGES += \
-    [email protected] \
+    [email protected] \
     libgooglecamerahwl_impl \
-    [email protected] \
+    [email protected] \
 
 #
 # Gatekeeper
@@ -466,7 +483,7 @@
 # GPS
 #
 PRODUCT_PACKAGES += \
-    [email protected]
+    android.hardware.gnss-service.example
 
 # Health
 ifeq ($(LOCAL_HEALTH_PRODUCT_PACKAGE),)
@@ -629,7 +646,22 @@
 
 PRODUCT_SOONG_NAMESPACES += external/mesa3d
 
+#for Confirmation UI
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/common/proprietary/confirmatioui_hal
+
 # Need this so that the application's loop on reading input can be synchronized
 # with HW VSYNC
 PRODUCT_VENDOR_PROPERTIES += \
     ro.surface_flinger.running_without_sync_framework=true
+
+# Set support one-handed mode
+PRODUCT_PRODUCT_PROPERTIES += \
+    ro.support_one_handed_mode=true
+
+# Set one_handed_mode screen translate offset percentage
+PRODUCT_PRODUCT_PROPERTIES += \
+    persist.debug.one_handed_offset_percentage=50
+
+# Set one_handed_mode translate animation duration milliseconds
+PRODUCT_PRODUCT_PROPERTIES += \
+    persist.debug.one_handed_translate_animation_duration=300
diff --git a/shared/foldable/android-info.txt b/shared/foldable/android-info.txt
new file mode 100644
index 0000000..8552685
--- /dev/null
+++ b/shared/foldable/android-info.txt
@@ -0,0 +1 @@
+config=foldable
diff --git a/shared/foldable/device_state_configuration.xml b/shared/foldable/device_state_configuration.xml
new file mode 100644
index 0000000..9618b11
--- /dev/null
+++ b/shared/foldable/device_state_configuration.xml
@@ -0,0 +1,37 @@
+<device-state-config>
+  <device-state>
+    <identifier>0</identifier>
+    <name>CLOSED</name>
+    <conditions>
+      <lid-switch>
+        <open>false</open>
+      </lid-switch>
+    </conditions>
+  </device-state>
+  <device-state>
+    <identifier>1</identifier>
+    <name>HALF_OPENED</name>
+    <conditions>
+      <lid-switch>
+        <open>true</open>
+      </lid-switch>
+      <sensor>
+        <type>android.sensor.hinge_angle</type>
+        <name>Hinge Angle Sensor</name>
+        <value>
+          <min>0</min>
+          <max>180</max>
+        </value>
+      </sensor>
+    </conditions>
+  </device-state>
+  <device-state>
+    <identifier>2</identifier>
+    <name>OPENED</name>
+    <conditions>
+      <lid-switch>
+        <open>true</open>
+      </lid-switch>
+    </conditions>
+  </device-state>
+</device-state-config>
diff --git a/shared/foldable/overlay/frameworks/base/core/res/res/values/config.xml b/shared/foldable/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..2c540e1
--- /dev/null
+++ b/shared/foldable/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+  <!-- Indicate the display area rect for foldable devices in folded state. -->
+  <!-- left and right bounds come from:  (open_width/2) +/- (folded_width)/2 -->
+  <string name="config_foldedArea">476 0 1292 2208</string>
+  <!-- WindowsManager JetPack display features -->
+  <string name="config_display_features" translatable="false">fold-[884,0,884,2208]</string>
+  <!-- Map of System DeviceState supplied by DeviceStateManager to WM Jetpack posture. -->
+  <string-array name="config_device_state_postures" translatable="false">
+      <item>0:1</item> <!-- CLOSED : STATE_FLAT -->
+      <item>3:2</item> <!-- HALF_OPENED : STATE_HALF_OPENED -->
+      <item>2:3</item> <!-- OPENED : STATE_FLIPPED -->
+  </string-array>
+  <!-- The device states (supplied by DeviceStateManager) that should be treated as folded by the
+       display fold controller. -->
+  <integer-array name="config_foldedDeviceStates" translatable="false">
+    <item>0</item> <!-- CLOSED -->
+  </integer-array>
+  <!-- Controls whether the device support multi window modes like split-screen. -->
+  <bool name="config_supportsMultiWindow">true</bool>
+  <!-- Controls whether device supports split-screen mode. -->
+  <bool name="config_supportsSplitScreenMultiWindow">true</bool>
+  <!-- Radius of the software rounded corners. -->
+  <dimen name="rounded_corner_radius">34px</dimen>
+</resources>
diff --git a/shared/phone/device_vendor.mk b/shared/phone/device_vendor.mk
index de49af4..61f72c1 100644
--- a/shared/phone/device_vendor.mk
+++ b/shared/phone/device_vendor.mk
@@ -43,7 +43,9 @@
     libcuttlefish-rild
 
 PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.biometrics.face.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.biometrics.face.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.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \
     frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
     frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml
 
diff --git a/shared/sepolicy/system_ext/private/property_contexts b/shared/sepolicy/system_ext/private/property_contexts
index ba4a683..13c17c3 100644
--- a/shared/sepolicy/system_ext/private/property_contexts
+++ b/shared/sepolicy/system_ext/private/property_contexts
@@ -5,7 +5,5 @@
 persist.vendor.radio.VT_HYBRID_ENABLE           u:object_r:vendor_radio_prop:s0
 persist.vendor.radio.videopause.mode            u:object_r:vendor_radio_prop:s0
 persist.vendor.radio.smlog_switch               u:object_r:vendor_radio_prop:s0
-persist.radio.poweranomaly.start                u:object_r:vendor_radio_prop:s0
-persist.radio.lowpowermonitor.start             u:object_r:vendor_radio_prop:s0
 ro.vendor.radio.log_loc                         u:object_r:vendor_radio_prop:s0
 ro.vendor.radio.log_prefix                      u:object_r:vendor_radio_prop:s0
diff --git a/shared/sepolicy/system_ext/private/sample_tuner_tis_app.te b/shared/sepolicy/system_ext/private/sample_tuner_tis_app.te
new file mode 100644
index 0000000..60f5e69
--- /dev/null
+++ b/shared/sepolicy/system_ext/private/sample_tuner_tis_app.te
@@ -0,0 +1,7 @@
+# Sample Tuner TIS app
+type sample_tuner_tis_app, domain;
+
+app_domain(sample_tuner_tis_app)
+
+allow sample_tuner_tis_app app_api_service:service_manager find;
+hal_client_domain(sample_tuner_tis_app, hal_tv_tuner);
diff --git a/shared/sepolicy/system_ext/private/seapp_contexts b/shared/sepolicy/system_ext/private/seapp_contexts
index 23c3681..1cd8665 100644
--- a/shared/sepolicy/system_ext/private/seapp_contexts
+++ b/shared/sepolicy/system_ext/private/seapp_contexts
@@ -4,3 +4,6 @@
 
 # Connectivity monitor
 user=_app isPrivApp=true seinfo=platform name=com.google.android.connectivitymonitor domain=con_monitor_app type=app_data_file levelFrom=all
+
+# Sample Tuner TIS
+user=system isPrivApp=true seinfo=platform name=com.android.tv.samples.sampletunertvinput domain=sample_tuner_tis_app type=app_data_file levelFrom=all
diff --git a/shared/sepolicy/vendor/bug_map b/shared/sepolicy/vendor/bug_map
index 32a0b4c..4a3a9af 100644
--- a/shared/sepolicy/vendor/bug_map
+++ b/shared/sepolicy/vendor/bug_map
@@ -3,3 +3,4 @@
 kernel kernel capability b/179966921
 migrate_legacy_obb_data dalvikcache_data_file file b/152338071
 system_server system_server process b/65201432
+gmscore_app hal_camera_prop file b/156287758
diff --git a/shared/sepolicy/vendor/file_contexts b/shared/sepolicy/vendor/file_contexts
index 74616b6..66eee37 100644
--- a/shared/sepolicy/vendor/file_contexts
+++ b/shared/sepolicy/vendor/file_contexts
@@ -62,12 +62,12 @@
 /vendor/bin/rename_netiface  u:object_r:rename_netiface_exec:s0
 /vendor/bin/suspend_blocker  u:object_r:suspend_blocker_exec:s0
 /vendor/bin/hw/libcuttlefish-rild  u:object_r:libcuttlefish_rild_exec:s0
-/vendor/bin/hw/android\.hardware\.camera\.provider@2\.6-service-google u:object_r:hal_camera_default_exec:s0
-/vendor/bin/hw/android\.hardware\.camera\.provider@2\.6-service-google-lazy u:object_r:hal_camera_default_exec:s0
+/vendor/bin/hw/android\.hardware\.camera\.provider@2\.7-service-google u:object_r:hal_camera_default_exec:s0
+/vendor/bin/hw/android\.hardware\.camera\.provider@2\.7-service-google-lazy u:object_r:hal_camera_default_exec:s0
 /vendor/bin/hw/android\.hardware\.power\.stats@1\.0-service\.mock  u:object_r:hal_power_stats_default_exec:s0
 /vendor/bin/hw/android\.hardware\.bluetooth@1\.1-service\.remote  u:object_r:hal_bluetooth_remote_exec:s0
 /vendor/bin/hw/android\.hardware\.bluetooth@1\.1-service\.sim  u:object_r:hal_bluetooth_sim_exec:s0
-/vendor/bin/hw/android\.hardware\.contexthub@1\.1-service\.mock  u:object_r:hal_contexthub_default_exec:s0
+/vendor/bin/hw/android\.hardware\.contexthub@1\.2-service\.mock  u:object_r:hal_contexthub_default_exec:s0
 /vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service\.clearkey  u:object_r:hal_drm_clearkey_exec:s0
 /vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service-lazy\.clearkey  u:object_r:hal_drm_clearkey_exec:s0
 /vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service\.widevine  u:object_r:hal_drm_widevine_exec:s0
diff --git a/shared/sepolicy/vendor/google/bug_map b/shared/sepolicy/vendor/google/bug_map
index 26c5581..0521b52 100644
--- a/shared/sepolicy/vendor/google/bug_map
+++ b/shared/sepolicy/vendor/google/bug_map
@@ -1 +1,2 @@
+untrusted_app selinuxfs file b/175910397
 zygote ramdump_app process b/139558100
diff --git a/shared/tv/device.mk b/shared/tv/device.mk
index 487c16a..9b78ee1 100644
--- a/shared/tv/device.mk
+++ b/shared/tv/device.mk
@@ -28,16 +28,17 @@
     frameworks/native/data/etc/android.hardware.hdmi.cec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.hdmi.cec.xml \
     frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
     frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
-    hardware/interfaces/tv/tuner/config/sample_tuner_vts_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/tuner_vts_config.xml \
+    hardware/interfaces/tv/tuner/config/sample_tuner_vts_config_1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/tuner_vts_config_1_0.xml \
+    hardware/interfaces/tv/tuner/config/sample_tuner_vts_config_1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/tuner_vts_config_1_1.xml \
 
 # HDMI CEC HAL
-PRODUCT_PACKAGES += [email protected]
+PRODUCT_PACKAGES += [email protected]
 
 # Setup HDMI CEC as Playback Device
 PRODUCT_PROPERTY_OVERRIDES += ro.hdmi.device_type=4
 
 # Tuner HAL
-PRODUCT_PACKAGES += [email protected]
+PRODUCT_PACKAGES += [email protected]
 
 # Enabling managed profiles
 DEVICE_PACKAGE_OVERLAYS += device/google/cuttlefish/shared/tv/overlay
diff --git a/shared/tv/sepolicy/vendor/file_contexts b/shared/tv/sepolicy/vendor/file_contexts
index 267f831..88b1cf5 100644
--- a/shared/tv/sepolicy/vendor/file_contexts
+++ b/shared/tv/sepolicy/vendor/file_contexts
@@ -1,2 +1 @@
 /vendor/bin/hw/android\.hardware\.tv\.cec@1\.0-service\.mock u:object_r:hal_tv_cec_mock_exec:s0
-/vendor/bin/hw/android\.hardware\.tv\.tuner@1\.0-service u:object_r:hal_tv_tuner_default_exec:s0
diff --git a/tests/hal/hal_implementation_test.cpp b/tests/hal/hal_implementation_test.cpp
index 3674d15..abe6af2 100644
--- a/tests/hal/hal_implementation_test.cpp
+++ b/tests/hal/hal_implementation_test.cpp
@@ -25,7 +25,7 @@
 
 static const std::set<std::string> kKnownMissingHidl = {
     "[email protected]",
-    "[email protected]",
+    "[email protected]",
     "[email protected]", // deprecated, see b/37226359
     "[email protected]",
     "[email protected]",
@@ -44,7 +44,7 @@
     "[email protected]",
     "[email protected]",
     "[email protected]",
-    "[email protected]",
+    "[email protected]",
     "[email protected]",
     "[email protected]",
     "[email protected]",
@@ -80,16 +80,16 @@
     "[email protected]",
     "[email protected]", // see b/170699770
     "[email protected]",
-    "[email protected]",
+    "[email protected]",
     "[email protected]",
-    "[email protected]",
-    "[email protected]",
-    "[email protected]",
+    "[email protected]",
+    "[email protected]",
+    "[email protected]",
     "[email protected]",
     "[email protected]",
     "[email protected]",
-    "[email protected]",
-    "[email protected]",
+    "[email protected]",
+    "[email protected]",
     "[email protected]",
     "[email protected]",
     "[email protected]",
@@ -97,6 +97,7 @@
 
 static const std::set<std::string> kKnownMissingAidl = {
     // types-only packages, which never expect a default implementation
+    "android.hardware.biometrics.common.",
     "android.hardware.common.",
     "android.hardware.common.fmq.",
     "android.hardware.graphics.common.",
@@ -110,6 +111,9 @@
     "android.automotive.computepipe.registry.",
     "android.automotive.computepipe.runner.",
     "android.automotive.watchdog.",
+    "android.frameworks.automotive.powerpolicy.",
+    "android.frameworks.automotive.telemetry.",
+    "android.hardware.automotive.audiocontrol.",
     "android.hardware.automotive.occupant_awareness.",
 };
 
@@ -275,7 +279,7 @@
         bool knownMissing = false;
         for (const std::string& type : iface.types) {
             if (manifest.erase(type) > 0) hasRegistration = true;
-            if (thoughtMissing.erase(getAidlPackage(type)) > 0) knownMissing = true;
+            if (thoughtMissing.erase(getAidlPackage(type)) > 0)  knownMissing = true;
         }
 
         if (knownMissing) {
diff --git a/vsoc_x86/auto/preinstalled-packages-product-car-cuttlefish.xml b/vsoc_x86/auto/preinstalled-packages-product-car-cuttlefish.xml
index c0fd016..aef6dcc 100644
--- a/vsoc_x86/auto/preinstalled-packages-product-car-cuttlefish.xml
+++ b/vsoc_x86/auto/preinstalled-packages-product-car-cuttlefish.xml
@@ -80,11 +80,21 @@
         <install-in user-type="FULL" />
         <install-in user-type="SYSTEM" />
     </install-in-user-type>
+    <!-- Required for Wifi -->
+    <install-in-user-type package="com.android.networkstack.inprocess">
+        <install-in user-type="FULL" />
+        <install-in user-type="SYSTEM" />
+    </install-in-user-type>
     <!-- Required when sysui queries for system user apps to handle the home intent -->
     <install-in-user-type package="com.android.car.carlauncher">
         <install-in user-type="FULL" />
         <install-in user-type="SYSTEM" />
     </install-in-user-type>
+    <!-- Required when using Camera2 extensions -->
+    <install-in-user-type package="com.android.camera">
+        <install-in user-type="SYSTEM" />
+        <install-in user-type="FULL" />
+    </install-in-user-type>
 
 <!--
   Apps that do need to run on SYSTEM and evaluated by package owner.
@@ -138,106 +148,19 @@
     <install-in-user-type package="com.android.car.themeplayground">
         <install-in user-type="FULL" />
     </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.amethyst">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.aquamarine">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.black">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.tangerine">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.cinnamon">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.green">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.ocean">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.space">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.orchid">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.color.purple">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.font.notoserifsource">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon.pebble">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon.roundedrect">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon.squircle">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon.taperedrect">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon.teardrop">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon.vessel">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.circular.android">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.circular.launcher">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.circular.settings">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.circular.systemui">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.circular.themepicker">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.filled.android">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.filled.launcher">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.filled.settings">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.filled.systemui">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.filled.themepicker">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.rounded.android">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.rounded.launcher">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.rounded.settings">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.rounded.systemui">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
     <install-in-user-type package="com.android.car.linkviewer">
         <install-in user-type="FULL" />
     </install-in-user-type>
-    <install-in-user-type package="com.android.car.retaildemo">
+    <install-in-user-type package="com.android.car.multidisplay">
         <install-in user-type="FULL" />
     </install-in-user-type>
-    <install-in-user-type package="com.android.car.voicecontrol">
+      <install-in-user-type package="com.android.car.voicecontrol">
+        <install-in user-type="FULL" />
+    </install-in-user-type>
+    <install-in-user-type package="com.google.android.car.multidisplaytest">
+        <install-in user-type="FULL" />
+    </install-in-user-type>
+    <install-in-user-type package="com.android.car.retaildemo">
         <install-in user-type="FULL" />
     </install-in-user-type>
     <install-in-user-type package="com.android.documentsui">
@@ -255,14 +178,10 @@
     <install-in-user-type package="com.google.android.apps.geo.autograph.vms.client.systemstate">
         <install-in user-type="FULL" />
     </install-in-user-type>
-    <install-in-user-type package="com.android.theme.icon_pack.rounded.themepicker">
-        <install-in user-type="FULL" />
-    </install-in-user-type>
     <install-in-user-type package="com.android.smspush">
         <install-in user-type="FULL" />
     </install-in-user-type>
     <install-in-user-type package="com.android.angle">
         <install-in user-type="FULL" />
     </install-in-user-type>
-
 </config>
diff --git a/vsoc_x86_64/phone/aosp_cf_foldable.mk b/vsoc_x86_64/phone/aosp_cf_foldable.mk
new file mode 100644
index 0000000..89b0ea3
--- /dev/null
+++ b/vsoc_x86_64/phone/aosp_cf_foldable.mk
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+
+# Inherit mostly from aosp_cf_x86_64_phone
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/phone/aosp_cf.mk)
+PRODUCT_NAME := aosp_cf_x86_64_foldable
+PRODUCT_MODEL := Cuttlefish x86_64 foldable
+
+# Include the device state configuration for a foldable device.
+PRODUCT_COPY_FILES += \
+    device/google/cuttlefish/shared/foldable/device_state_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/devicestate/device_state_configuration.xml
+# Include RRO settings that specify the fold states and screen information.
+DEVICE_PACKAGE_OVERLAYS += device/google/cuttlefish/shared/foldable/overlay
+# Include the foldable `launch_cvd --config foldable` option.
+SOONG_CONFIG_cvd_launch_configs += cvd_config_foldable.json
+# Include the android-info.txt that specifies the foldable --config by default.
+TARGET_BOARD_INFO_FILE := device/google/cuttlefish/shared/foldable/android-info.txt