diff --git a/frameworks/ans/core/common/include/ans_inner_errors.h b/frameworks/ans/core/common/include/ans_inner_errors.h index 44f0f61998592ca174d7ed7df513d5dda8e63910..6f7c2b56b4b6300f5df725458022cd1843512bc3 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 21c479c7fcfb13ed72239d3bd709aa9038536026..2f04e1eba7dfdfc426c6eb40850a61ec3f73215b 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 1c861680531d5706fe964d346d8d3f3420104703..3cd9fa689c607722e1a785d09e190c95e53a15b2 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 c9dd27dc652a1ebfb1433bfdaf372457e901576a..946297527fa0cd28b8f6701b070dfeffd050c229 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 999497416e064b5b24bb771f006b7936eb2c036b..e8e19b5073be9462d6810c2a6c4dff8eb44c2dcb 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 6b53430328c795c1de165aef9314f7013b12bc71..a82d04e9bc0cbc6e0e6abdf545865ecd24eed7ab 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 a023318892e01241f667bc2fddcaa37746b13bb5..d2287997647a093bb5fb1ffc9fa7fc3838e02206 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 50aacfd848faaa36aa0b5d0abbe3620b86cf521a..ca85cf6656197856ba64b85e9485cf43501b1285 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 ea52d41e60ef0fbeaf0378b823a560d83e72d654..159aed72dd1380bd06293f15f5ce031faa695943 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 af5ee7f9cb4402a06599b682056da1d18d8c812b..db8bcaa5b81d77c5e0a025c84f67791c41be28b7 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 7436531157b43c77858967bb6f5c607a550d7fbc..d2f8c616f7aa88d5f4aa0d634e598e3c313915e3 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 c5bfe04469027943fc7abe77bd507b97d11c63e2..846996cb8a8439a937c192a290fc5eb2310481c0 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 6a556ec8a0b1cb420f1215a39d02aa21f8944cb4..d598507838722597ed9e8218a92eb6b8dbc916b5 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 ddd6a066c4003c72cc6e7198ce138b7ffa4d5411..e8764ebcdaf6a29ac47799de83478365d6ebbba2 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 09e1fafdf2c1a4e992cb52533b1147d8d0bbe9be..886d6fecbc3179498657e96368c43ad3a3f90097 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")