From 0f47dbc5de20e3e400cad00e1d7a7eae20371b86 Mon Sep 17 00:00:00 2001 From: s30044129 Date: Tue, 2 Sep 2025 19:50:27 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- common/src/dfx/standard/dm_hidumper.cpp | 1 + interfaces/cj/kits/src/device_manager_utils.cpp | 1 + interfaces/inner_kits/native_cpp/include/dm_device_info.h | 5 +++++ interfaces/inner_kits/native_cpp/src/dm_device_info.cpp | 1 + interfaces/kits/js/src/native_devicemanager_js.cpp | 4 ++++ interfaces/kits/js4.0/src/dm_native_util.cpp | 1 + services/service/src/softbus/softbus_publish.cpp | 2 +- 7 files changed, 14 insertions(+), 1 deletion(-) diff --git a/common/src/dfx/standard/dm_hidumper.cpp b/common/src/dfx/standard/dm_hidumper.cpp index 77238b7bb..51a2fc9ca 100644 --- a/common/src/dfx/standard/dm_hidumper.cpp +++ b/common/src/dfx/standard/dm_hidumper.cpp @@ -36,6 +36,7 @@ static DumperInfo g_dumperDeviceType[] = { {DEVICE_TYPE_WATCH, "DEVICE_TYPE_WATCH"}, {DEVICE_TYPE_CAR, "DEVICE_TYPE_CAR"}, {DEVICE_TYPE_TV, "DEVICE_TYPE_TV"}, + {DEVICE_TYPE_GLASS, "DEVICE_TYPE_GLASS"}, }; // HiDumper info diff --git a/interfaces/cj/kits/src/device_manager_utils.cpp b/interfaces/cj/kits/src/device_manager_utils.cpp index eacec0c7c..c643842f7 100644 --- a/interfaces/cj/kits/src/device_manager_utils.cpp +++ b/interfaces/cj/kits/src/device_manager_utils.cpp @@ -198,6 +198,7 @@ const std::string &GetDeviceTypeById(DmDeviceType type) {DEVICE_TYPE_PC, std::string(DEVICE_TYPE_PC_STRING)}, {DEVICE_TYPE_SMART_DISPLAY, std::string(DEVICE_TYPE_SMART_DISPLAY_STRING)}, {DEVICE_TYPE_2IN1, std::string(DEVICE_TYPE_2IN1_STRING)}, + {DEVICE_TYPE_GLASS, std::string(DEVICE_TYPE_GLASS_STRING)}, }; for (const auto& item : mapArray) { if (item.first == type) { diff --git a/interfaces/inner_kits/native_cpp/include/dm_device_info.h b/interfaces/inner_kits/native_cpp/include/dm_device_info.h index b7704d94d..d096b8621 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_device_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_device_info.h @@ -99,6 +99,10 @@ typedef enum DmDeviceType { */ DEVICE_TYPE_2IN1 = 0xA2F, THIRD_TV = 0x2E, + /** + * Indicates ai glasses. + */ + DEVICE_TYPE_GLASS = 0xA31, } DmDeviceType; /** @@ -371,6 +375,7 @@ DM_EXPORT extern const char* DEVICE_TYPE_WIFICAMERA_STRING; DM_EXPORT extern const char* DEVICE_TYPE_PC_STRING; DM_EXPORT extern const char* DEVICE_TYPE_SMART_DISPLAY_STRING; DM_EXPORT extern const char* DEVICE_TYPE_2IN1_STRING; +DM_EXPORT extern const char* DEVICE_TYPE_GLASS_STRING; typedef struct DmAccessCaller { std::string accountId; diff --git a/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp b/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp index c80cbb4a4..d54a3d26a 100644 --- a/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp +++ b/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp @@ -25,5 +25,6 @@ const char* DEVICE_TYPE_WIFICAMERA_STRING = "WiFiCamera"; const char* DEVICE_TYPE_PC_STRING = "PC"; const char* DEVICE_TYPE_SMART_DISPLAY_STRING = "SMART_DISPLAY"; const char* DEVICE_TYPE_2IN1_STRING = "2IN1"; +const char* DEVICE_TYPE_GLASS_STRING = "GLASSES"; } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/js/src/native_devicemanager_js.cpp b/interfaces/kits/js/src/native_devicemanager_js.cpp index e0571b6d7..abe1548ab 100644 --- a/interfaces/kits/js/src/native_devicemanager_js.cpp +++ b/interfaces/kits/js/src/native_devicemanager_js.cpp @@ -3350,6 +3350,7 @@ napi_value DeviceManagerNapi::InitDeviceTypeEnum(napi_env env, napi_value export napi_value wearable; napi_value car; napi_value tv; + napi_value glasses; int32_t refCount = 1; napi_create_uint32(env, static_cast(DmDeviceType::DEVICE_TYPE_UNKNOWN), @@ -3366,6 +3367,8 @@ napi_value DeviceManagerNapi::InitDeviceTypeEnum(napi_env env, napi_value export &car); napi_create_uint32(env, static_cast(DmDeviceType::DEVICE_TYPE_TV), &tv); + napi_create_uint32(env, static_cast(DmDeviceType::DEVICE_TYPE_GLASS), + &glasses); napi_property_descriptor desc[] = { DECLARE_NAPI_STATIC_PROPERTY("UNKNOWN_TYPE", unknown_type), @@ -3375,6 +3378,7 @@ napi_value DeviceManagerNapi::InitDeviceTypeEnum(napi_env env, napi_value export DECLARE_NAPI_STATIC_PROPERTY("WEARABLE", wearable), DECLARE_NAPI_STATIC_PROPERTY("CAR", car), DECLARE_NAPI_STATIC_PROPERTY("TV", tv), + DECLARE_NAPI_STATIC_PROPERTY("GLASSES", glasses), }; napi_value result = nullptr; diff --git a/interfaces/kits/js4.0/src/dm_native_util.cpp b/interfaces/kits/js4.0/src/dm_native_util.cpp index 60a8e66d8..d9073e926 100644 --- a/interfaces/kits/js4.0/src/dm_native_util.cpp +++ b/interfaces/kits/js4.0/src/dm_native_util.cpp @@ -139,6 +139,7 @@ std::string GetDeviceTypeById(DmDeviceType type) {DEVICE_TYPE_PC, DEVICE_TYPE_PC_STRING}, {DEVICE_TYPE_SMART_DISPLAY, DEVICE_TYPE_SMART_DISPLAY_STRING}, {DEVICE_TYPE_2IN1, DEVICE_TYPE_2IN1_STRING}, + {DEVICE_TYPE_GLASS, DEVICE_TYPE_GLASS_STRING}, }; for (const auto& item : mapArray) { if (item.first == type) { diff --git a/services/service/src/softbus/softbus_publish.cpp b/services/service/src/softbus/softbus_publish.cpp index 94a605c14..b4bdadc95 100644 --- a/services/service/src/softbus/softbus_publish.cpp +++ b/services/service/src/softbus/softbus_publish.cpp @@ -45,7 +45,7 @@ void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32 std::lock_guard saLock(g_publishMutex); DmDeviceInfo info; SoftbusCache::GetInstance().GetLocalDeviceInfo(info); - if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH) { + if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH || info.deviceTypeId == DmDeviceType::DEVICE_TYPE_GLASS) { LOGE("deviceType: %{public}d is watch, not publish", static_cast(info.deviceTypeId)); return; } -- Gitee From 28f955c1dd959b2d689e5054dc332f02eed140c4 Mon Sep 17 00:00:00 2001 From: s30044129 Date: Tue, 2 Sep 2025 19:56:32 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- common/src/dfx/standard/dm_hidumper.cpp | 2 +- interfaces/cj/kits/src/device_manager_utils.cpp | 2 +- interfaces/inner_kits/native_cpp/include/dm_device_info.h | 4 ++-- interfaces/inner_kits/native_cpp/src/dm_device_info.cpp | 2 +- interfaces/kits/js/src/native_devicemanager_js.cpp | 2 +- interfaces/kits/js4.0/src/dm_native_util.cpp | 2 +- services/service/src/softbus/softbus_publish.cpp | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/src/dfx/standard/dm_hidumper.cpp b/common/src/dfx/standard/dm_hidumper.cpp index 51a2fc9ca..b81b9a426 100644 --- a/common/src/dfx/standard/dm_hidumper.cpp +++ b/common/src/dfx/standard/dm_hidumper.cpp @@ -36,7 +36,7 @@ static DumperInfo g_dumperDeviceType[] = { {DEVICE_TYPE_WATCH, "DEVICE_TYPE_WATCH"}, {DEVICE_TYPE_CAR, "DEVICE_TYPE_CAR"}, {DEVICE_TYPE_TV, "DEVICE_TYPE_TV"}, - {DEVICE_TYPE_GLASS, "DEVICE_TYPE_GLASS"}, + {DEVICE_TYPE_GLASSES, "DEVICE_TYPE_GLASSES"}, }; // HiDumper info diff --git a/interfaces/cj/kits/src/device_manager_utils.cpp b/interfaces/cj/kits/src/device_manager_utils.cpp index c643842f7..bdec6f474 100644 --- a/interfaces/cj/kits/src/device_manager_utils.cpp +++ b/interfaces/cj/kits/src/device_manager_utils.cpp @@ -198,7 +198,7 @@ const std::string &GetDeviceTypeById(DmDeviceType type) {DEVICE_TYPE_PC, std::string(DEVICE_TYPE_PC_STRING)}, {DEVICE_TYPE_SMART_DISPLAY, std::string(DEVICE_TYPE_SMART_DISPLAY_STRING)}, {DEVICE_TYPE_2IN1, std::string(DEVICE_TYPE_2IN1_STRING)}, - {DEVICE_TYPE_GLASS, std::string(DEVICE_TYPE_GLASS_STRING)}, + {DEVICE_TYPE_GLASSES, std::string(DEVICE_TYPE_GLASSES_STRING)}, }; for (const auto& item : mapArray) { if (item.first == type) { diff --git a/interfaces/inner_kits/native_cpp/include/dm_device_info.h b/interfaces/inner_kits/native_cpp/include/dm_device_info.h index d096b8621..41cc4ac94 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_device_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_device_info.h @@ -102,7 +102,7 @@ typedef enum DmDeviceType { /** * Indicates ai glasses. */ - DEVICE_TYPE_GLASS = 0xA31, + DEVICE_TYPE_GLASSES = 0xA31, } DmDeviceType; /** @@ -375,7 +375,7 @@ DM_EXPORT extern const char* DEVICE_TYPE_WIFICAMERA_STRING; DM_EXPORT extern const char* DEVICE_TYPE_PC_STRING; DM_EXPORT extern const char* DEVICE_TYPE_SMART_DISPLAY_STRING; DM_EXPORT extern const char* DEVICE_TYPE_2IN1_STRING; -DM_EXPORT extern const char* DEVICE_TYPE_GLASS_STRING; +DM_EXPORT extern const char* DEVICE_TYPE_GLASSES_STRING; typedef struct DmAccessCaller { std::string accountId; diff --git a/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp b/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp index d54a3d26a..4ed54ddf0 100644 --- a/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp +++ b/interfaces/inner_kits/native_cpp/src/dm_device_info.cpp @@ -25,6 +25,6 @@ const char* DEVICE_TYPE_WIFICAMERA_STRING = "WiFiCamera"; const char* DEVICE_TYPE_PC_STRING = "PC"; const char* DEVICE_TYPE_SMART_DISPLAY_STRING = "SMART_DISPLAY"; const char* DEVICE_TYPE_2IN1_STRING = "2IN1"; -const char* DEVICE_TYPE_GLASS_STRING = "GLASSES"; +const char* DEVICE_TYPE_GLASSES_STRING = "GLASSES"; } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/js/src/native_devicemanager_js.cpp b/interfaces/kits/js/src/native_devicemanager_js.cpp index abe1548ab..bd1985cdd 100644 --- a/interfaces/kits/js/src/native_devicemanager_js.cpp +++ b/interfaces/kits/js/src/native_devicemanager_js.cpp @@ -3367,7 +3367,7 @@ napi_value DeviceManagerNapi::InitDeviceTypeEnum(napi_env env, napi_value export &car); napi_create_uint32(env, static_cast(DmDeviceType::DEVICE_TYPE_TV), &tv); - napi_create_uint32(env, static_cast(DmDeviceType::DEVICE_TYPE_GLASS), + napi_create_uint32(env, static_cast(DmDeviceType::DEVICE_TYPE_GLASSES), &glasses); napi_property_descriptor desc[] = { diff --git a/interfaces/kits/js4.0/src/dm_native_util.cpp b/interfaces/kits/js4.0/src/dm_native_util.cpp index d9073e926..21963460d 100644 --- a/interfaces/kits/js4.0/src/dm_native_util.cpp +++ b/interfaces/kits/js4.0/src/dm_native_util.cpp @@ -139,7 +139,7 @@ std::string GetDeviceTypeById(DmDeviceType type) {DEVICE_TYPE_PC, DEVICE_TYPE_PC_STRING}, {DEVICE_TYPE_SMART_DISPLAY, DEVICE_TYPE_SMART_DISPLAY_STRING}, {DEVICE_TYPE_2IN1, DEVICE_TYPE_2IN1_STRING}, - {DEVICE_TYPE_GLASS, DEVICE_TYPE_GLASS_STRING}, + {DEVICE_TYPE_GLASSES, DEVICE_TYPE_GLASSES_STRING}, }; for (const auto& item : mapArray) { if (item.first == type) { diff --git a/services/service/src/softbus/softbus_publish.cpp b/services/service/src/softbus/softbus_publish.cpp index b4bdadc95..9dc842971 100644 --- a/services/service/src/softbus/softbus_publish.cpp +++ b/services/service/src/softbus/softbus_publish.cpp @@ -45,8 +45,8 @@ void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32 std::lock_guard saLock(g_publishMutex); DmDeviceInfo info; SoftbusCache::GetInstance().GetLocalDeviceInfo(info); - if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH || info.deviceTypeId == DmDeviceType::DEVICE_TYPE_GLASS) { - LOGE("deviceType: %{public}d is watch, not publish", static_cast(info.deviceTypeId)); + if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH || info.deviceTypeId == DmDeviceType::DEVICE_TYPE_GLASSES) { + LOGE("deviceType: %{public}d, not publish", static_cast(info.deviceTypeId)); return; } LOGI("deviceType: %{public}d", static_cast(info.deviceTypeId)); -- Gitee From b33fa8ba6828546b7197999f2a9a09d113a07233 Mon Sep 17 00:00:00 2001 From: s30044129 Date: Thu, 4 Sep 2025 14:23:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- services/service/src/softbus/softbus_publish.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/service/src/softbus/softbus_publish.cpp b/services/service/src/softbus/softbus_publish.cpp index 9dc842971..3b412c20f 100644 --- a/services/service/src/softbus/softbus_publish.cpp +++ b/services/service/src/softbus/softbus_publish.cpp @@ -45,7 +45,8 @@ void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32 std::lock_guard saLock(g_publishMutex); DmDeviceInfo info; SoftbusCache::GetInstance().GetLocalDeviceInfo(info); - if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH || info.deviceTypeId == DmDeviceType::DEVICE_TYPE_GLASSES) { + if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH || + info.deviceTypeId == DmDeviceType::DEVICE_TYPE_GLASSES) { LOGE("deviceType: %{public}d, not publish", static_cast(info.deviceTypeId)); return; } -- Gitee From fdcbebcb67a4df4228d20e035cb7ad045b7f96e7 Mon Sep 17 00:00:00 2001 From: s30044129 Date: Thu, 4 Sep 2025 17:40:01 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- services/service/src/softbus/softbus_publish.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/service/src/softbus/softbus_publish.cpp b/services/service/src/softbus/softbus_publish.cpp index 3b412c20f..ef64320f2 100644 --- a/services/service/src/softbus/softbus_publish.cpp +++ b/services/service/src/softbus/softbus_publish.cpp @@ -40,8 +40,8 @@ std::mutex g_publishMutex; void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32_t screenState) { - LOGI("PublishCommonEventCallback start, bleState: %{public}d, wifiState: %{public}d, screenState: %{public}d", - bluetoothState, wifiState, screenState); + LOGI("PublishCommonEventCallback start, bleState: %{public}d, wifiState: %{public}d, screenState: %{public}d" + ", deviceType: %{public}d", bluetoothState, wifiState, screenState, static_cast(info.deviceTypeId)); std::lock_guard saLock(g_publishMutex); DmDeviceInfo info; SoftbusCache::GetInstance().GetLocalDeviceInfo(info); @@ -50,7 +50,6 @@ void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32 LOGE("deviceType: %{public}d, not publish", static_cast(info.deviceTypeId)); return; } - LOGI("deviceType: %{public}d", static_cast(info.deviceTypeId)); SoftbusPublish softbusPublish; if (screenState == DM_SCREEN_OFF) { int32_t ret = softbusPublish.StopPublishSoftbusLNN(DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID); -- Gitee From c68fa17cdfe287a37fd7682652c97ec7d2467bdc Mon Sep 17 00:00:00 2001 From: s30044129 Date: Thu, 4 Sep 2025 19:53:11 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- services/service/src/softbus/softbus_publish.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/service/src/softbus/softbus_publish.cpp b/services/service/src/softbus/softbus_publish.cpp index ef64320f2..bcfaf55ea 100644 --- a/services/service/src/softbus/softbus_publish.cpp +++ b/services/service/src/softbus/softbus_publish.cpp @@ -40,11 +40,11 @@ std::mutex g_publishMutex; void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32_t screenState) { - LOGI("PublishCommonEventCallback start, bleState: %{public}d, wifiState: %{public}d, screenState: %{public}d" - ", deviceType: %{public}d", bluetoothState, wifiState, screenState, static_cast(info.deviceTypeId)); std::lock_guard saLock(g_publishMutex); DmDeviceInfo info; SoftbusCache::GetInstance().GetLocalDeviceInfo(info); + LOGI("PublishCommonEventCallback start, bleState: %{public}d, wifiState: %{public}d, screenState: %{public}d" + ", deviceType: %{public}d", bluetoothState, wifiState, screenState, static_cast(info.deviceTypeId)); if (info.deviceTypeId == DmDeviceType::DEVICE_TYPE_WATCH || info.deviceTypeId == DmDeviceType::DEVICE_TYPE_GLASSES) { LOGE("deviceType: %{public}d, not publish", static_cast(info.deviceTypeId)); -- Gitee