diff --git a/interfaces/kits/taihe/include/ohos.distributedDeviceManager.h b/interfaces/kits/taihe/include/ohos.distributedDeviceManager.h index 0242f0efac793acaf0310cd2d55f74d5156f12d2..6a9d3100a818cf86901233eaf27bff6798364c40 100644 --- a/interfaces/kits/taihe/include/ohos.distributedDeviceManager.h +++ b/interfaces/kits/taihe/include/ohos.distributedDeviceManager.h @@ -39,7 +39,7 @@ public: ~DeviceManagerImpl() = default; std::string GetLocalDeviceId(); void UnbindTarget(taihe::string_view deviceId); - double GetDeviceType(taihe::string_view networkId); + int32_t GetDeviceType(taihe::string_view networkId); std::string GetDeviceName(taihe::string_view networkId); std::string GetLocalDeviceNetworkId(); diff --git a/interfaces/kits/taihe/src/ohos.distributedDeviceManager.cpp b/interfaces/kits/taihe/src/ohos.distributedDeviceManager.cpp index a05aeefca620d465229e789884b10896d8a478df..e33938961a70713e0f6a5354c45e74d4347adf8f 100644 --- a/interfaces/kits/taihe/src/ohos.distributedDeviceManager.cpp +++ b/interfaces/kits/taihe/src/ohos.distributedDeviceManager.cpp @@ -25,7 +25,7 @@ namespace ANI::distributedDeviceManager { namespace { -constexpr double DEVICE_TYPE_UNKNOWN = -1.0; +constexpr int32_t DEVICE_TYPE_UNKNOWN = -1; constexpr const char *DEVICE_TYPE_EMPTY_STR = ""; constexpr const char *ERROR_DEVICE_ID = "error deviceId"; constexpr const char *ERROR_NETWORK_ID = "error networkId"; @@ -140,7 +140,7 @@ void DeviceManagerImpl::UnbindTarget(taihe::string_view deviceId) } } -double DeviceManagerImpl::GetDeviceType(taihe::string_view networkId) +int32_t DeviceManagerImpl::GetDeviceType(taihe::string_view networkId) { int32_t deviceType; int32_t ret = OHOS::DistributedHardware::DeviceManager::GetInstance().GetDeviceType( @@ -310,7 +310,7 @@ void DeviceManagerImpl::OnServiceDie(taihe::callback_view onServiceDiecb { if (OHOS::DistributedHardware::DeviceManager::GetInstance().CheckNewAPIAccessPermission() != 0) { taihe::set_business_error(OHOS::DistributedHardware::ERR_DM_NO_PERMISSION, - "OnReplyResult check permission failed"); + "OnServiceDie check permission failed"); return; } @@ -473,7 +473,7 @@ void DeviceManagerImpl::OffServiceDie(taihe::optional_view