diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index ec7521c06..7720e0d46 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -157,6 +157,8 @@
Calendar permission is required to schedule and manage your audio meetings and recording tasks
NSCameraUsageDescription
Camera permission is required for QR code scanning and video calling functions
+ NSContactsUsageDescription
+ Contacts access is required to help you make phone calls to your contacts through voice commands. This enables the AI assistant to find and dial your contacts when you ask it to call someone.
NSLocationAlwaysAndWhenInUseUsageDescription
Location access enables the app to provide location-based voice translation services, such as translating local place names and providing contextual information relevant to your current location during conversations.
NSLocationWhenInUseUsageDescription
diff --git a/lib/modules/pairing/controllers/pairing_controller.dart b/lib/modules/pairing/controllers/pairing_controller.dart
index 6a53441b2..51387abe8 100644
--- a/lib/modules/pairing/controllers/pairing_controller.dart
+++ b/lib/modules/pairing/controllers/pairing_controller.dart
@@ -771,10 +771,10 @@ class PairingController extends GetxController with WidgetsBindingObserver {
final deviceName = device.name;
DBProduct? product;
// 检查是否已有BLE绑定的设备
- /// 检查是否已有BLE绑定的设备
+ // 检查是否已有BLE绑定的设备
if (AppConfig.config.products.isNotEmpty) {
final match = AppConfig.config.products.where(
- (d) => d.devicename == device.name,
+ (d) => d.devicename.contains(deviceName),
);
product = match.isNotEmpty ? match.first : null;
}
@@ -787,7 +787,7 @@ class PairingController extends GetxController with WidgetsBindingObserver {
final existingDevice = User.instance.devices.firstWhere(
(d) =>
d.devicetype == 1 &&
- d.devicename == device.name &&
+ d.devicename.contains(deviceName) &&
d.devicemac == device.address,
orElse: () => UserDevice(
id: -1,
@@ -813,13 +813,12 @@ class PairingController extends GetxController with WidgetsBindingObserver {
_bleManager.disconnect();
}
}
-
+ // 检查是否已有BLE绑定的设备
if (Platform.isAndroid) {
- // 检查是否已有BLE绑定的设备
final existingDevice = User.instance.devices.firstWhere(
(d) =>
d.devicetype == 2 &&
- d.devicename == device.name &&
+ d.devicename.contains(deviceName) &&
d.devicemac == device.address,
orElse: () => UserDevice(
id: -1,
@@ -838,7 +837,7 @@ class PairingController extends GetxController with WidgetsBindingObserver {
}
print(
'获取到 deviceName: $deviceName address: ${device.address} uuids:$uuids');
- if (names.any((name) => name.contains(deviceName))) {
+ if (product != null && product.devicetype != 1) {
if (currentBleState == 2) {
//已连接直接返回
return 9;
diff --git a/local_plugins/chat_api/android/src/main/kotlin/com/yunqiinnovation/chat_api/SystemFunctionHandler.kt b/local_plugins/chat_api/android/src/main/kotlin/com/yunqiinnovation/chat_api/SystemFunctionHandler.kt
index 1cc996d38..c15934fc9 100644
--- a/local_plugins/chat_api/android/src/main/kotlin/com/yunqiinnovation/chat_api/SystemFunctionHandler.kt
+++ b/local_plugins/chat_api/android/src/main/kotlin/com/yunqiinnovation/chat_api/SystemFunctionHandler.kt
@@ -87,17 +87,7 @@ class SystemFunctionHandler(private val context: Context? = null) {
description = "获取用户通信录联系人列表",
parameters = mapOf(
"type" to "object",
- "properties" to mapOf(
- "limit" to mapOf(
- "type" to "integer",
- "description" to "返回联系人数量限制,默认20个",
- "default" to 20
- ),
- "search" to mapOf(
- "type" to "string",
- "description" to "搜索关键词,可选参数"
- )
- ),
+ "properties" to emptyMap(),
"required" to emptyList()
),
handler = GetContactsListHandler(context)
@@ -1378,10 +1368,7 @@ private class GetContactsListHandler(private val context: Context?) : FunctionHa
}
return try {
- val limit = (arguments["limit"] as? Number)?.toInt() ?: 20
- val searchKeyword = arguments["search"] as? String
-
- val contacts = getContactsList(context, limit, searchKeyword)
+ val contacts = getContactsList(context)
JSONObject().apply {
put("result", "成功获取联系人列表")
@@ -1406,7 +1393,7 @@ private class GetContactsListHandler(private val context: Context?) : FunctionHa
* @param searchKeyword 搜索关键词
* @return 联系人列表
*/
- private fun getContactsList(context: Context, limit: Int, searchKeyword: String?): List