雷鸟:优化已配对的设备同时出现在"我的设备"和"附近的设备"中。 2829/1 2829/head 2830/target/1
authorluozheng <1732036298@qq.com>
Sun, 30 Nov 2025 07:31:14 +0000 (15:31 +0800)
committerluozheng <1732036298@qq.com>
Sun, 30 Nov 2025 07:31:14 +0000 (15:31 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueListAdapter.cpp

index 977a208..df26e51 100644 (file)
@@ -224,7 +224,7 @@ void ThunderBirdBlueListAdapter::BuildDisplayList()
     nearbyHeader.isSelected = false;
     displayList_.push_back(nearbyHeader);
     
-    // 3. 添加附近的设备(未连接的)
+    // 3. 添加附近的设备(未连接且未配对的)
     for (auto& device : scanDevices) {
         if (nearbyCount >= MAX_NEARBY_DEVICES) {
             break;
@@ -235,6 +235,12 @@ void ThunderBirdBlueListAdapter::BuildDisplayList()
             continue;
         }
         
+        // 跳过已在"我的设备"列表中(已配对)的设备
+        if (btModel->CheckExistConnedList(device)) {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Skip nearby device (already paired): %s", device.deviceName);
+            continue;
+        }
+        
         DeviceListItem item;
         item.type = DeviceItemType::DEVICE_NEARBY;
         item.deviceInfo = device;