Merge "Bluetooth vts hal: Restore to 2s startup" into main
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 4a7bfbd..8b08945 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -1740,6 +1740,11 @@
 }
 
 TEST_P(AudioCoreModule, TryConnectMissingDevice) {
+    // Limit checks to connection types that are known to be detectable by HAL implementations.
+    static const std::set<std::string> kCheckedConnectionTypes{
+            AudioDeviceDescription::CONNECTION_HDMI, AudioDeviceDescription::CONNECTION_HDMI_ARC,
+            AudioDeviceDescription::CONNECTION_HDMI_EARC, AudioDeviceDescription::CONNECTION_IP_V4,
+            AudioDeviceDescription::CONNECTION_USB};
     ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
     std::vector<AudioPort> ports = moduleConfig->getExternalDevicePorts();
     if (ports.empty()) {
@@ -1748,14 +1753,10 @@
     WithDebugFlags doNotSimulateConnections = WithDebugFlags::createNested(*debug);
     doNotSimulateConnections.flags().simulateDeviceConnections = false;
     ASSERT_NO_FATAL_FAILURE(doNotSimulateConnections.SetUp(module.get()));
+    bool hasAtLeastOneCheckedConnection = false;
     for (const auto& port : ports) {
-        // Virtual devices may not require external hardware and thus can always be connected.
-        if (port.ext.get<AudioPortExt::device>().device.type.connection ==
-                    AudioDeviceDescription::CONNECTION_VIRTUAL ||
-            // SCO devices are handled at low level by DSP, may not be able to check actual
-            // connection.
-            port.ext.get<AudioPortExt::device>().device.type.connection ==
-                    AudioDeviceDescription::CONNECTION_BT_SCO) {
+        if (kCheckedConnectionTypes.count(
+                    port.ext.get<AudioPortExt::device>().device.type.connection) == 0) {
             continue;
         }
         AudioPort portWithData = GenerateUniqueDeviceAddress(port), connectedPort;
@@ -1768,6 +1769,10 @@
             EXPECT_IS_OK(module->disconnectExternalDevice(connectedPort.id))
                     << "when disconnecting device port ID " << connectedPort.id;
         }
+        hasAtLeastOneCheckedConnection = true;
+    }
+    if (!hasAtLeastOneCheckedConnection) {
+        GTEST_SKIP() << "No external devices with connection types that can be checked.";
     }
 }
 
diff --git a/compatibility_matrices/compatibility_matrix.202404.xml b/compatibility_matrices/compatibility_matrix.202404.xml
index f6f70e0..a5e40dd 100644
--- a/compatibility_matrices/compatibility_matrix.202404.xml
+++ b/compatibility_matrices/compatibility_matrix.202404.xml
@@ -538,6 +538,7 @@
             <name>ISharedSecret</name>
             <instance>default</instance>
             <instance>strongbox</instance>
+            <regex-instance>.*</regex-instance>
         </interface>
     </hal>
     <hal format="aidl">
diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
index 62756bd..4b438ce 100644
--- a/compatibility_matrices/compatibility_matrix.202504.xml
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -529,6 +529,7 @@
             <name>ISharedSecret</name>
             <instance>default</instance>
             <instance>strongbox</instance>
+            <regex-instance>.*</regex-instance>
         </interface>
     </hal>
     <hal format="aidl">
diff --git a/threadnetwork/aidl/default/socket_interface.cpp b/threadnetwork/aidl/default/socket_interface.cpp
index 7bdf39a..0544502 100644
--- a/threadnetwork/aidl/default/socket_interface.cpp
+++ b/threadnetwork/aidl/default/socket_interface.cpp
@@ -23,6 +23,7 @@
 #include "socket_interface.hpp"
 
 #include <errno.h>
+#include <linux/limits.h>
 #include <openthread/logging.h>
 #include <sys/inotify.h>
 #include <sys/socket.h>
@@ -273,7 +274,7 @@
         }
 
         if (FD_ISSET(inotifyFd, &fds)) {
-            char buffer[sizeof(struct inotify_event)];
+            char buffer[sizeof(struct inotify_event) + NAME_MAX + 1];
             ssize_t bytesRead = read(inotifyFd, buffer, sizeof(buffer));
 
             VerifyOrDie(bytesRead >= 0, OT_EXIT_ERROR_ERRNO);