HCI: Prefer the requested hci_interface

Bug: 345058678
Test: mma -j32
      Connect passthrough mode with AAOS
Change-Id: I9fd5e4cba1e14e6260f485f56f473ce506f18437
diff --git a/bluetooth/aidl/default/net_bluetooth_mgmt.cpp b/bluetooth/aidl/default/net_bluetooth_mgmt.cpp
index db6caae..24693ef 100644
--- a/bluetooth/aidl/default/net_bluetooth_mgmt.cpp
+++ b/bluetooth/aidl/default/net_bluetooth_mgmt.cpp
@@ -161,6 +161,16 @@
       struct mgmt_ev_read_index_list* data =
           (struct mgmt_ev_read_index_list*)ev.data;
 
+      // Prefer the exact hci_interface
+      for (int i = 0; i < data->num_controllers; i++) {
+        if (data->index[i] == hci_interface) {
+          ALOGI("hci interface %d found", data->index[i]);
+          ret = data->index[i];
+          goto end;
+        }
+      }
+
+      // Accept a larger one if we can't find the exact one
       for (int i = 0; i < data->num_controllers; i++) {
         if (data->index[i] >= hci_interface) {
           ALOGI("hci interface %d found", data->index[i]);