From 55a3b24b31a12d5fb7ac4ac8986ecb826fec9d49 Mon Sep 17 00:00:00 2001 From: liuyanzhi Date: Wed, 23 Mar 2022 14:12:34 +0800 Subject: [PATCH] add fix Signed-off-by: liuyanzhi Change-Id: I563abbed1e7c597b54f4e918ba32c4eee1a4734d --- frameworks/ans/core/common/include/ans_inner_errors.h | 2 +- frameworks/ans/core/include/ans_manager_interface.h | 2 +- frameworks/ans/core/include/ans_subscriber_interface.h | 2 +- .../innerkits/ans/native/include/notification_constant.h | 2 +- .../ans/native/include/notification_conversational_content.h | 4 ++-- interfaces/innerkits/ans/native/include/notification_slot.h | 2 +- services/ans/include/distributed_kvstore_death_recipient.h | 4 ++-- services/ans/include/reminder_event_manager.h | 2 +- services/ans/include/remote_death_recipient.h | 4 ++-- services/ans/include/system_event_observer.h | 2 +- services/ans/src/notification_preferences_database.cpp | 1 + services/ans/src/notification_subscriber_manager.cpp | 2 +- services/distributed/src/distributed_device_callback.cpp | 1 - services/test/moduletest/ans_module_test.cpp | 2 +- tools/dump/src/notification_shell_command.cpp | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/frameworks/ans/core/common/include/ans_inner_errors.h b/frameworks/ans/core/common/include/ans_inner_errors.h index 44f0f6199..6f7c2b56b 100644 --- a/frameworks/ans/core/common/include/ans_inner_errors.h +++ b/frameworks/ans/core/common/include/ans_inner_errors.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/frameworks/ans/core/include/ans_manager_interface.h b/frameworks/ans/core/include/ans_manager_interface.h index 21c479c7f..2f04e1eba 100644 --- a/frameworks/ans/core/include/ans_manager_interface.h +++ b/frameworks/ans/core/include/ans_manager_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/frameworks/ans/core/include/ans_subscriber_interface.h b/frameworks/ans/core/include/ans_subscriber_interface.h index 1c8616805..3cd9fa689 100644 --- a/frameworks/ans/core/include/ans_subscriber_interface.h +++ b/frameworks/ans/core/include/ans_subscriber_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/interfaces/innerkits/ans/native/include/notification_constant.h b/interfaces/innerkits/ans/native/include/notification_constant.h index c9dd27dc6..946297527 100644 --- a/interfaces/innerkits/ans/native/include/notification_constant.h +++ b/interfaces/innerkits/ans/native/include/notification_constant.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/interfaces/innerkits/ans/native/include/notification_conversational_content.h b/interfaces/innerkits/ans/native/include/notification_conversational_content.h index 999497416..e8e19b507 100644 --- a/interfaces/innerkits/ans/native/include/notification_conversational_content.h +++ b/interfaces/innerkits/ans/native/include/notification_conversational_content.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -34,7 +34,7 @@ public: * @param messageUser Indicates the MessageUser who sends all Message objects in this conversation-like * notification. This parameter cannot be null. */ - NotificationConversationalContent(const MessageUser &messageUser); + explicit NotificationConversationalContent(const MessageUser &messageUser); /** * Default deconstructor used to deconstruct. diff --git a/interfaces/innerkits/ans/native/include/notification_slot.h b/interfaces/innerkits/ans/native/include/notification_slot.h index 6b5343032..a82d04e9b 100644 --- a/interfaces/innerkits/ans/native/include/notification_slot.h +++ b/interfaces/innerkits/ans/native/include/notification_slot.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/ans/include/distributed_kvstore_death_recipient.h b/services/ans/include/distributed_kvstore_death_recipient.h index a02331889..d22879976 100644 --- a/services/ans/include/distributed_kvstore_death_recipient.h +++ b/services/ans/include/distributed_kvstore_death_recipient.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,7 +24,7 @@ namespace OHOS { namespace Notification { class DistributedKvStoreDeathRecipient : public DistributedKv::KvStoreDeathRecipient { public: - DistributedKvStoreDeathRecipient(const std::function &callback) + explicit DistributedKvStoreDeathRecipient(const std::function &callback) { callback_ = callback; } diff --git a/services/ans/include/reminder_event_manager.h b/services/ans/include/reminder_event_manager.h index 50aacfd84..ca85cf665 100644 --- a/services/ans/include/reminder_event_manager.h +++ b/services/ans/include/reminder_event_manager.h @@ -26,7 +26,7 @@ namespace OHOS { namespace Notification { class ReminderEventManager { public: - ReminderEventManager(std::shared_ptr &reminderDataManager); + explicit ReminderEventManager(std::shared_ptr &reminderDataManager); virtual ~ReminderEventManager() {}; ReminderEventManager(ReminderEventManager &other) = delete; ReminderEventManager& operator = (const ReminderEventManager &other) = delete; diff --git a/services/ans/include/remote_death_recipient.h b/services/ans/include/remote_death_recipient.h index ea52d41e6..159aed72d 100644 --- a/services/ans/include/remote_death_recipient.h +++ b/services/ans/include/remote_death_recipient.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,7 +24,7 @@ namespace OHOS { namespace Notification { class RemoteDeathRecipient : public IRemoteObject::DeathRecipient { public: - RemoteDeathRecipient(std::function &)> callback) + explicit RemoteDeathRecipient(std::function &)> callback) { callback_ = callback; } diff --git a/services/ans/include/system_event_observer.h b/services/ans/include/system_event_observer.h index af5ee7f9c..db8bcaa5b 100644 --- a/services/ans/include/system_event_observer.h +++ b/services/ans/include/system_event_observer.h @@ -28,7 +28,7 @@ namespace OHOS { namespace Notification { class SystemEventObserver { public: - SystemEventObserver(const ISystemEvent &callbacks); + explicit SystemEventObserver(const ISystemEvent &callbacks); ~SystemEventObserver(); private: diff --git a/services/ans/src/notification_preferences_database.cpp b/services/ans/src/notification_preferences_database.cpp index 743653115..d2f8c616f 100644 --- a/services/ans/src/notification_preferences_database.cpp +++ b/services/ans/src/notification_preferences_database.cpp @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "notification_preferences_database.h" #include "ans_const_define.h" diff --git a/services/ans/src/notification_subscriber_manager.cpp b/services/ans/src/notification_subscriber_manager.cpp index c5bfe0446..846996cb8 100644 --- a/services/ans/src/notification_subscriber_manager.cpp +++ b/services/ans/src/notification_subscriber_manager.cpp @@ -287,7 +287,7 @@ ErrCode NotificationSubscriberManager::RemoveSubscriberInner( RemoveRecordInfo(record, subscribeInfo); - if (record->subscribedAll == false && record->bundleList_.empty()) { + if (!record->subscribedAll && record->bundleList_.empty()) { record->subscriber->AsObject()->RemoveDeathRecipient(recipient_); subscriberRecordList_.remove(record); diff --git a/services/distributed/src/distributed_device_callback.cpp b/services/distributed/src/distributed_device_callback.cpp index 6a556ec8a..d59850783 100644 --- a/services/distributed/src/distributed_device_callback.cpp +++ b/services/distributed/src/distributed_device_callback.cpp @@ -36,7 +36,6 @@ void DistributedDeviceCallback::OnDeviceChanged( } if (type == DistributedKv::DeviceChangeType::DEVICE_OFFLINE) { - ANS_LOGI("device %{public}s is OFFLINE", info.deviceId.c_str()); if (callback_.OnDisconnected) { callback_.OnDisconnected(info.deviceId); } diff --git a/services/test/moduletest/ans_module_test.cpp b/services/test/moduletest/ans_module_test.cpp index ddd6a066c..e8764ebcd 100644 --- a/services/test/moduletest/ans_module_test.cpp +++ b/services/test/moduletest/ans_module_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/tools/dump/src/notification_shell_command.cpp b/tools/dump/src/notification_shell_command.cpp index 09e1fafdf..886d6fecb 100644 --- a/tools/dump/src/notification_shell_command.cpp +++ b/tools/dump/src/notification_shell_command.cpp @@ -49,7 +49,7 @@ static const std::string DUMP_HELP_MSG = #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED " --distributed, -D list all distributed notifications by remote device\n" #endif - " --setRecentCount set the max count of recent notification keeping in memory\n"; + " --setRecentCount set the max count of recent notifications keeping in memory\n"; } // namespace NotificationShellCommand::NotificationShellCommand(int argc, char *argv[]) : ShellCommand(argc, argv, "anm_dump") -- Gitee