diff --git a/common/src/daudio_util.cpp b/common/src/daudio_util.cpp index 38b270c023caba3c2e73a35e782efa17d7c6a7d0..79552bb8b5c1a78a973433678bda1f97786c72a7 100644 --- a/common/src/daudio_util.cpp +++ b/common/src/daudio_util.cpp @@ -25,7 +25,8 @@ #include #include -#include "softbus_bus_center.h" +#include "device_manager.h" +#include "dm_device_info.h" #include "audio_event.h" #include "daudio_constants.h" @@ -133,14 +134,14 @@ std::string GetEventNameByType(const int32_t eventType) int32_t GetLocalDeviceNetworkId(std::string &networkId) { - NodeBasicInfo basicInfo = { { 0 } }; - int32_t ret = GetLocalNodeDeviceInfo(PKG_NAME.c_str(), &basicInfo); + DmDeviceInfo info; + auto ret = DeviceManager::GetInstance().GetLocalDeviceInfo(PKG_NAME, info); if (ret != DH_SUCCESS) { DHLOGE("Failed to obtain the network ID of the local device. ret: %{public}d", ret); return ret; } - networkId = std::string(basicInfo.networkId); + networkId = info.networkId; return DH_SUCCESS; } diff --git a/services/common/BUILD.gn b/services/common/BUILD.gn index cbf99f9086b41c838fd2c014ce4908a9191d8bd8..695a6e19e597b2e93e3c578fa39294d5755078b3 100644 --- a/services/common/BUILD.gn +++ b/services/common/BUILD.gn @@ -58,8 +58,8 @@ ohos_shared_library("distributed_audio_utils") { external_deps = [ "cJSON:cjson", "c_utils:utils", + "device_manager:devicemanagersdk", "distributed_hardware_fwk:distributedhardwareutils", - "dsoftbus:softbus_client", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter",