From: Caisking Date: Thu, 22 May 2025 01:55:06 +0000 (+0800) Subject: 修改获取已安装app应用的返回 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~288^2~4 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=dad298003280b7bdedfe5d6f1c8eb4e95e15728b;p=mirrors%2FFD230.git 修改获取已安装app应用的返回 --- diff --git a/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp b/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp index 21b36cba2..d04b3529b 100644 --- a/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp +++ b/code/sdk/application/wearable/fd230/service/app_store/app_store.cpp @@ -213,13 +213,20 @@ cJSON* ble_get_pkg_list() { goto CLEANUP; } - // 添加 "name" 字段 - if (cJSON_AddStringToObject(jsonObject, "name", bundleInfos[i].bundleName) == NULL) { + // 添加 "pakgname" 字段 + if (cJSON_AddStringToObject(jsonObject, "packageName", bundleInfos[i].bundleName) == NULL) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_BLE, "Failed to add 'name' field for package at index %d", i); cJSON_Delete(jsonObject); goto CLEANUP; } + // 添加应用名称 + if (cJSON_AddStringToObject(jsonObject, "appName", bundleInfos[i].label) == NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_BLE, "Failed to add 'label' field for package at index %d", i); + cJSON_Delete(jsonObject); + goto CLEANUP; + } + // 将对象添加到数组 if (cJSON_AddItemToArray(jsonArray, jsonObject) != 1) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_BLE, "Failed to add package at index %d to JSON array", i);