diff --git a/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp b/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp index ef942bb..ff705c8 100755 --- a/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp +++ b/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp @@ -68,7 +68,7 @@ int32_t DistributedDeviceProfileProxy::DeleteDeviceProfile(const std::string& se sptr remote = Remote(); MessageParcel data; if (!data.WriteInterfaceToken(IDistributedDeviceProfile::GetDescriptor())) { - HILOGE("write inteface token failed"); + HILOGE("write interface token failed"); return ERR_FLATTEN_OBJECT; } PARCEL_WRITE_HELPER(data, String, serviceId); @@ -84,7 +84,7 @@ int32_t DistributedDeviceProfileProxy::SubscribeProfileEvents( sptr remote = Remote(); MessageParcel data; if (!data.WriteInterfaceToken(IDistributedDeviceProfile::GetDescriptor())) { - HILOGE("write inteface token failed"); + HILOGE("write interface token failed"); return ERR_FLATTEN_OBJECT; } size_t size = subscribeInfos.size(); @@ -116,7 +116,7 @@ int32_t DistributedDeviceProfileProxy::UnsubscribeProfileEvents( sptr remote = Remote(); MessageParcel data; if (!data.WriteInterfaceToken(IDistributedDeviceProfile::GetDescriptor())) { - HILOGE("write inteface token failed"); + HILOGE("write interface token failed"); return ERR_FLATTEN_OBJECT; } if (!DeviceProfileUtils::WriteProfileEvents(profileEvents, data)) { @@ -142,7 +142,7 @@ int32_t DistributedDeviceProfileProxy::SyncDeviceProfile(const SyncOptions& sync sptr remote = Remote(); MessageParcel data; if (!data.WriteInterfaceToken(IDistributedDeviceProfile::GetDescriptor())) { - HILOGE("write inteface token failed"); + HILOGE("write interface token failed"); return ERR_FLATTEN_OBJECT; } diff --git a/interfaces/innerkits/core/src/profile_event_notifier_stub.cpp b/interfaces/innerkits/core/src/profile_event_notifier_stub.cpp index 700be80..95a9a6b 100755 --- a/interfaces/innerkits/core/src/profile_event_notifier_stub.cpp +++ b/interfaces/innerkits/core/src/profile_event_notifier_stub.cpp @@ -39,7 +39,7 @@ ProfileEventNotifierStub::HandlersMap ProfileEventNotifierStub::InitHandlersMap( int32_t ProfileEventNotifierStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { - HILOGI("code = %{public}d", code); + HILOGI("code = %{public}u", code); std::u16string descriptor = ProfileEventNotifierStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { diff --git a/services/core/src/authority/trust_group_manager.cpp b/services/core/src/authority/trust_group_manager.cpp index 9a07aae..9d3bc33 100644 --- a/services/core/src/authority/trust_group_manager.cpp +++ b/services/core/src/authority/trust_group_manager.cpp @@ -69,12 +69,12 @@ bool TrustGroupManager::CheckTrustGroup(const std::string& deviceId) int32_t ret = hichainGmInstance_->getRelatedGroups(ANY_OS_ACCOUNT, AUTH_APPID.c_str(), deviceId.c_str(), &returnGroups, &groupNum); if (ret != ERR_OK) { - HILOGE("faild , ret: %d", ret); + HILOGE("failed, ret:%{public}d", ret); return false; } if (returnGroups == nullptr || groupNum == 0) { - HILOGE("faild, returnGroups is nullptr"); + HILOGE("failed, returnGroups is nullptr"); return false; } diff --git a/services/core/src/distributed_device_profile_stub.cpp b/services/core/src/distributed_device_profile_stub.cpp index 6158727..3ea0996 100755 --- a/services/core/src/distributed_device_profile_stub.cpp +++ b/services/core/src/distributed_device_profile_stub.cpp @@ -49,7 +49,7 @@ bool DistributedDeviceProfileStub::EnforceInterfaceToken(MessageParcel& data) int32_t DistributedDeviceProfileStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { - HILOGI("code = %{public}d, flags = %{public}d", code, option.GetFlags()); + HILOGI("code = %{public}u, flags = %{public}d", code, option.GetFlags()); auto iter = funcsMap_.find(code); if (iter != funcsMap_.end()) { diff --git a/services/core/src/subscribemanager/profile_change_handler.cpp b/services/core/src/subscribemanager/profile_change_handler.cpp index 72fc09a..b2670d6 100755 --- a/services/core/src/subscribemanager/profile_change_handler.cpp +++ b/services/core/src/subscribemanager/profile_change_handler.cpp @@ -57,6 +57,9 @@ std::unique_ptr ProfileKey::Parse(const std::string& entryKey) int32_t index = 0; auto profileKey = std::make_unique(); + if (profileKey == nullptr) { + return nullptr; + } profileKey->udid = std::move(vec[index++]); if (profileKey->udid.size() != DEVICE_ID_SIZE) { HILOGE("parse udid failed"); diff --git a/services/core/test/unittest/event_subscribe_test.cpp b/services/core/test/unittest/event_subscribe_test.cpp index c70d0e5..b75a70a 100755 --- a/services/core/test/unittest/event_subscribe_test.cpp +++ b/services/core/test/unittest/event_subscribe_test.cpp @@ -421,7 +421,7 @@ HWTEST_F(EventSubscribeTest, SubscribeWithUnsusbscribe002, TestSize.Level2) } /** - * @tc.steps: step4. put a other subscribed service profile + * @tc.steps: step4. put a subscribed service profile * @tc.expected: step4. can't receive notification. */ errCode = PutFakeStorage(); diff --git a/services/core/test/unittest/profile_authority_test.cpp b/services/core/test/unittest/profile_authority_test.cpp index 6e84557..b2b7308 100644 --- a/services/core/test/unittest/profile_authority_test.cpp +++ b/services/core/test/unittest/profile_authority_test.cpp @@ -119,7 +119,7 @@ HWTEST_F(ProfileAuthorityTest, CheckAuthority_003, TestSize.Level0) /** * @tc.name: CheckAuthority_004 - * @tc.desc: check authority of a empty serviceId + * @tc.desc: check authority of an empty serviceId * @tc.type: FUNC */ HWTEST_F(ProfileAuthorityTest, CheckAuthority_004, TestSize.Level0)