diff --git a/hisysevent.yaml b/hisysevent.yaml index 4199d39a..03712e46 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -13,9 +13,9 @@ domain: DEVICE_PROFILE -DEVICE_PROFILE_SYNC_EVENT: +DP_SYNC_EVENT: __BASE: {type: BEHAVIOR, level: MINOR, tag: deviceProfileSyn, desc: device profile sync} -DEVICE_PROFILE_SYNC_FAILED: +DP_SYNC_FAILED: __BASE: {type: FAULT, level: CRITICAL, desc: device profile sync failed} FAULT_CODE: {type: INT32, desc: fault code} \ No newline at end of file diff --git a/services/core/src/dbstorage/device_profile_storage_manager.cpp b/services/core/src/dbstorage/device_profile_storage_manager.cpp index ec411341..08e5f029 100644 --- a/services/core/src/dbstorage/device_profile_storage_manager.cpp +++ b/services/core/src/dbstorage/device_profile_storage_manager.cpp @@ -44,8 +44,8 @@ const std::string TAG = "DeviceProfileStorageManager"; const std::string SERVICE_TYPE = "type"; const std::string SERVICES = "services"; -const std::string DEVICE_PROFILE_SYNC_FAILED = "DEVICE_PROFILE_SYNC_FAILED"; -const std::string DEVICE_PROFILE_SYNC_EVENT = "DEVICE_PROFILE_SYNC_EVENT"; +const std::string DP_SYNC_FAILED = "DP_SYNC_FAILED"; +const std::string DP_SYNC_EVENT = "DP_SYNC_EVENT"; const std::string FAULT_CODE_KEY = "FAULT_CODE"; const std::string DP_DEVICE_PUT_TRACE = "DP_DEVICE_PUT"; const std::string DP_DEVICE_GET_TRACE = "DP_DEVICE_GET"; @@ -325,7 +325,7 @@ int32_t DeviceProfileStorageManager::SyncDeviceProfile(const SyncOptions& syncOp StartAsyncTrace(HITRACE_TAG_DEVICE_PROFILE, DP_DEVICE_SYNC_TRACE, FIX_TASK_ID); auto syncTask = [syncOptions, this]() { HILOGI("start sync"); - ReportBehaviorEvent(DEVICE_PROFILE_SYNC_EVENT); + ReportBehaviorEvent(DP_SYNC_EVENT); auto devicesList = syncOptions.GetDeviceList(); if (devicesList.empty()) { DpDeviceManager::GetInstance().GetDeviceIdList(devicesList); @@ -334,7 +334,7 @@ int32_t DeviceProfileStorageManager::SyncDeviceProfile(const SyncOptions& syncOp std::vector devicesVector(std::vector { devicesList.begin(), devicesList.end() }); int32_t result = onlineSyncTbl_->SyncDeviceProfile(devicesVector, syncOptions.GetSyncMode()); if (result != ERR_OK) { - ReportFaultEvent(DEVICE_PROFILE_SYNC_FAILED, FAULT_CODE_KEY, result); + ReportFaultEvent(DP_SYNC_FAILED, FAULT_CODE_KEY, result); HILOGE("sync failed result : %{public}d", result); NotifySyncCompleted(); return; diff --git a/services/core/test/unittest/profile_crud_test.cpp b/services/core/test/unittest/profile_crud_test.cpp index 63a22c32..f669b415 100644 --- a/services/core/test/unittest/profile_crud_test.cpp +++ b/services/core/test/unittest/profile_crud_test.cpp @@ -39,7 +39,7 @@ namespace { const std::string SERVICE_TYPE = "syscap"; const std::string CHARACTER_PRIVATE_SYSCAP = "privatesyscap"; const std::string CHARACTER_OS_SYSCAP = "ossyscap"; - const std::string DEVICE_PROFILE_SYNC_FAILED = "DEVICE_PROFILE_SYNC_FAILED"; + const std::string DP_SYNC_FAILED = "DP_SYNC_FAILED"; const std::string FAULT_CODE_KEY = "FAULT_CODE"; const std::string DOMAIN_NAME = std::string(HiSysEvent::Domain::DEVICE_PROFILE); } @@ -741,7 +741,7 @@ HWTEST_F(ProfileCrudTest, GetDeviceProfile_002, TestSize.Level3) */ HWTEST_F(ProfileCrudTest, DfxErrorPrint_001, TestSize.Level3) { - int ret = HiSysEvent::Write(DOMAIN_NAME, DEVICE_PROFILE_SYNC_FAILED, + int ret = HiSysEvent::Write(DOMAIN_NAME, DP_SYNC_FAILED, HiSysEvent::EventType::FAULT, FAULT_CODE_KEY, -1); EXPECT_EQ(0, ret); } diff --git a/services/core/test/unittest/profile_storage_test.cpp b/services/core/test/unittest/profile_storage_test.cpp index 790be65c..4371e1cf 100644 --- a/services/core/test/unittest/profile_storage_test.cpp +++ b/services/core/test/unittest/profile_storage_test.cpp @@ -47,7 +47,6 @@ namespace { const std::string SERVICE_TYPE = "test"; const std::string CHARACTER_PRIVATE_SYSCAP = "privatesyscap"; const std::string CHARACTER_OS_SYSCAP = "ossyscap"; - const std::string DEVICE_PROFILE_SYNC_FAILED = "DEVICE_PROFILE_SYNC_FAILED"; const std::string FAULT_CODE_KEY = "FAULT_CODE"; const std::string DOMAIN_NAME = std::string(HiSysEvent::Domain::DEVICE_PROFILE); const std::string APP_ID = "distributed_device_profile_service";