Snap for 8589293 from c24b1fc9729a591b0d2449721f0576b198dae52a to sc-v2-platform-release

Change-Id: I4c14654b0d27519015c1d7b5b5187316a5eeef0f
diff --git a/guest/commands/bt_vhci_forwarder/main.cpp b/guest/commands/bt_vhci_forwarder/main.cpp
index 2194dd9..d5c4622 100644
--- a/guest/commands/bt_vhci_forwarder/main.cpp
+++ b/guest/commands/bt_vhci_forwarder/main.cpp
@@ -142,6 +142,11 @@
         PLOG(ERROR) << "vhci to virtio-console failed";
       }
     }
+    if (fds[1].revents & POLLHUP) {
+      LOG(ERROR) << "PollHUP";
+      usleep(50 * 1000);
+      continue;
+    }
     if (fds[1].revents & (POLLIN | POLLERR)) {
       // 'virtio-console to vhci' depends on H4Packetizer because vhci expects
       // full packet, but the data from virtio-console could be partial.
diff --git a/shared/BoardConfig.mk b/shared/BoardConfig.mk
index 2963874..6be1730 100644
--- a/shared/BoardConfig.mk
+++ b/shared/BoardConfig.mk
@@ -114,9 +114,9 @@
 BOARD_MALLOC_ALIGNMENT := 16
 
 # Disable sparse on all filesystem images
-TARGET_USERIMAGES_SPARSE_EROFS_DISABLED := true
-TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
-TARGET_USERIMAGES_SPARSE_F2FS_DISABLED := true
+TARGET_USERIMAGES_SPARSE_EROFS_DISABLED ?= true
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED ?= true
+TARGET_USERIMAGES_SPARSE_F2FS_DISABLED ?= true
 
 # Make the userdata partition 6G to accommodate ASAN and CTS
 BOARD_USERDATAIMAGE_PARTITION_SIZE := $(TARGET_USERDATAIMAGE_PARTITION_SIZE)
@@ -159,13 +159,6 @@
 
 BOARD_SEPOLICY_DIRS += system/bt/vendor_libs/linux/sepolicy
 
-# Avoid multiple includes of sepolicy already included by Pixel experience.
-ifneq ($(filter aosp_% %_auto %_go_phone trout_% gull% %_tv,$(PRODUCT_NAME)),)
-
-SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/flipendo
-
-endif
-
 # product sepolicy, allow other layers to append
 PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/product/private
 # PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/product/public
diff --git a/shared/auto/manifest.xml b/shared/auto/manifest.xml
index 9f7e9a4..e1691a1 100644
--- a/shared/auto/manifest.xml
+++ b/shared/auto/manifest.xml
@@ -15,15 +15,4 @@
         <transport>hwbinder</transport>
         <fqname>@1.0::ICanBus/test</fqname>
     </hal>
-    <!-- FIXME: Move this to shared manifest.xml -->
-    <hal format="hidl">
-        <name>android.hardware.broadcastradio</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>IBroadcastRadio</name>
-            <instance>amfm</instance>
-            <instance>dab</instance>
-        </interface>
-    </hal>
 </manifest>
diff --git a/shared/device.mk b/shared/device.mk
index b7f788b..ebade7a 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -499,9 +499,11 @@
 #
 # GPS
 #
-PRODUCT_PACKAGES += \
+LOCAL_GNSS_PRODUCT_PACKAGE ?= \
     android.hardware.gnss-service.example
 
+PRODUCT_PACKAGES += $(LOCAL_GNSS_PRODUCT_PACKAGE)
+
 # Health
 ifeq ($(LOCAL_HEALTH_PRODUCT_PACKAGE),)
     LOCAL_HEALTH_PRODUCT_PACKAGE := \
diff --git a/shared/sepolicy/system_ext/private/flipendo.te b/shared/sepolicy/system_ext/private/flipendo.te
deleted file mode 100644
index bdf57dc..0000000
--- a/shared/sepolicy/system_ext/private/flipendo.te
+++ /dev/null
@@ -1 +0,0 @@
-gpu_access(flipendo)
diff --git a/shared/sepolicy/vendor/adbd.te b/shared/sepolicy/vendor/adbd.te
index 4ed653a..d932066 100644
--- a/shared/sepolicy/vendor/adbd.te
+++ b/shared/sepolicy/vendor/adbd.te
@@ -1,9 +1,2 @@
 allow adbd self:{ socket vsock_socket } {create listen accept rw_socket_perms_no_ioctl};
-# TODO(b/130668487): Label the vsock sockets.
-allow adbd unlabeled:{socket vsock_socket} rw_socket_perms_no_ioctl;
 allow adbd kernel:system module_request;
-
-recovery_only(`
-# TODO(b/130668487): Label the vsock sockets.
-allow su unlabeled:{ socket vsock_socket } rw_socket_perms_no_ioctl;
-')
diff --git a/shared/sepolicy/vendor/shell.te b/shared/sepolicy/vendor/shell.te
index cc26032..2ef1897 100644
--- a/shared/sepolicy/vendor/shell.te
+++ b/shared/sepolicy/vendor/shell.te
@@ -1,5 +1,2 @@
 allow shell serial_device:chr_file { getattr ioctl read write };
 allow shell cuttlefish_sensor_injection_exec:file rx_file_perms;
-
-# TODO(b/130668487): Label the vsock sockets.
-allow shell adbd:{ socket vsock_socket } rw_socket_perms_no_ioctl;