diff --git a/frameworks/ans/core/common/include/ans_const_define.h b/frameworks/ans/core/common/include/ans_const_define.h index 8e1cb00b4de8e36793045b61a5948fbb453b899d..8568a2b3efdb9f616bd8768384b643cbf76ec3e6 100644 --- a/frameworks/ans/core/common/include/ans_const_define.h +++ b/frameworks/ans/core/common/include/ans_const_define.h @@ -22,7 +22,6 @@ namespace OHOS { namespace Notification { - // Max active notification number constexpr uint32_t MAX_ACTIVE_NUM = 1000; constexpr uint32_t MAX_ACTIVE_NUM_PERAPP = 100; diff --git a/frameworks/ans/core/common/include/ans_log_wrapper.h b/frameworks/ans/core/common/include/ans_log_wrapper.h index 3f03294f465bd7eceec7d115770979fada7ad473..c9543f7ca7733971871baa2e6b0995616984afa5 100644 --- a/frameworks/ans/core/common/include/ans_log_wrapper.h +++ b/frameworks/ans/core/common/include/ans_log_wrapper.h @@ -22,7 +22,6 @@ namespace OHOS { namespace Notification { - #ifndef LOG_DOMAIN #define LOG_DOMAIN 0xD001800 #endif diff --git a/frameworks/ans/core/include/ans_manager_death_recipient.h b/frameworks/ans/core/include/ans_manager_death_recipient.h index a726115e961eb032ce4a5685808f3a3667e64857..671a4e33dc405b564d78839d1d6c880fc056f781 100644 --- a/frameworks/ans/core/include/ans_manager_death_recipient.h +++ b/frameworks/ans/core/include/ans_manager_death_recipient.h @@ -27,7 +27,6 @@ public: virtual void OnRemoteDied(const wptr &object) override; }; - } // namespace Notification } // namespace OHOS diff --git a/frameworks/ans/core/include/ans_notification.h b/frameworks/ans/core/include/ans_notification.h index 54d4811052892156826e737f91910dca76a3484d..f95a82d6257e3189f45f7a47e390d4340bc57a27 100644 --- a/frameworks/ans/core/include/ans_notification.h +++ b/frameworks/ans/core/include/ans_notification.h @@ -427,7 +427,7 @@ public: * @param bundleOption Indicates the bundle name and uid of the application whose notifications are to be removed. * @return Returns remove notification result. */ - ErrCode RemoveAllNotifications(const NotificationBundleOption &bundleOption); + ErrCode RemoveAllNotifications(const NotificationBundleOption &bundleOption); /** * Removes all removable notifications of a specified bundle. diff --git a/frameworks/ans/core/include/ans_subscriber_proxy.h b/frameworks/ans/core/include/ans_subscriber_proxy.h index ea286a7a9584d7ccde41496dd49a0926804a61c0..8739caf27fc5ee1086965993f72f7e99838f5c7d 100644 --- a/frameworks/ans/core/include/ans_subscriber_proxy.h +++ b/frameworks/ans/core/include/ans_subscriber_proxy.h @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - class AnsSubscriberProxy : public IRemoteProxy { public: AnsSubscriberProxy() = delete; diff --git a/frameworks/ans/core/include/ans_subscriber_stub.h b/frameworks/ans/core/include/ans_subscriber_stub.h index 403731bf3243614a4649d45db7b0e8532bbcf1c5..26928cd84e11ac350ddbc43caaa60a5bce17ee15 100644 --- a/frameworks/ans/core/include/ans_subscriber_stub.h +++ b/frameworks/ans/core/include/ans_subscriber_stub.h @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - class AnsSubscriberStub : public IRemoteStub { public: AnsSubscriberStub(); diff --git a/frameworks/ans/core/src/ans_manager_proxy.cpp b/frameworks/ans/core/src/ans_manager_proxy.cpp index 7729d7a7b43fe48cc2c2984128c3575cc18a334c..f3889d70d16d940e32fb95643fbad1ae78b96339 100644 --- a/frameworks/ans/core/src/ans_manager_proxy.cpp +++ b/frameworks/ans/core/src/ans_manager_proxy.cpp @@ -23,7 +23,6 @@ namespace OHOS { namespace Notification { - AnsManagerProxy::AnsManagerProxy(const sptr &impl) : IRemoteProxy(impl) {} @@ -1442,7 +1441,6 @@ ErrCode AnsManagerProxy::GetShowBadgeEnabled(bool &enabled) MessageParcel reply; MessageOption option = {MessageOption::TF_SYNC}; ErrCode result = InnerTransact(GET_SHOW_BADGE_ENABLED, option, data, reply); - if (result != ERR_OK) { ANS_LOGW("[GetShowBadgeEnabled] fail: transact ErrCode=%{public}d", result); return ERR_ANS_TRANSACT_FAILED; @@ -2009,6 +2007,5 @@ bool AnsManagerProxy::ReadParcelableVector(std::vector> &parcelableInfos return true; } - } // namespace Notification } // namespace OHOS diff --git a/frameworks/ans/core/src/ans_manager_stub.cpp b/frameworks/ans/core/src/ans_manager_stub.cpp index 20a8c87d0c62c2714ddd3b6c639c87768463480e..ea74077f45c8a0b8b010def4a71274224bb0b942 100644 --- a/frameworks/ans/core/src/ans_manager_stub.cpp +++ b/frameworks/ans/core/src/ans_manager_stub.cpp @@ -23,7 +23,6 @@ namespace OHOS { namespace Notification { - const std::map> AnsManagerStub::interfaces_ = { {AnsManagerStub::PUBLISH_NOTIFICATION, @@ -249,7 +248,6 @@ ErrCode AnsManagerStub::HandlePublish(MessageParcel &data, MessageParcel &reply) } ErrCode result = Publish(label, notification); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandlePublish] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -272,7 +270,6 @@ ErrCode AnsManagerStub::HandlePublishToDevice(MessageParcel &data, MessageParcel } ErrCode result = PublishToDevice(notification, deviceId); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandlePublishToDevice] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -295,7 +292,6 @@ ErrCode AnsManagerStub::HandleCancel(MessageParcel &data, MessageParcel &reply) } ErrCode result = Cancel(notificationId, label); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleCancel] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -306,7 +302,6 @@ ErrCode AnsManagerStub::HandleCancel(MessageParcel &data, MessageParcel &reply) ErrCode AnsManagerStub::HandleCancelAll(MessageParcel &data, MessageParcel &reply) { ErrCode result = CancelAll(); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleCancelAll] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -317,9 +312,7 @@ ErrCode AnsManagerStub::HandleCancelAll(MessageParcel &data, MessageParcel &repl ErrCode AnsManagerStub::HandleAddSlotByType(MessageParcel &data, MessageParcel &reply) { NotificationConstant::SlotType slotType = static_cast(data.ReadInt32()); - ErrCode result = AddSlotByType(slotType); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleAddSlotByType] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -349,7 +342,6 @@ ErrCode AnsManagerStub::HandleRemoveSlotByType(MessageParcel &data, MessageParce NotificationConstant::SlotType slotType = static_cast(data.ReadInt32()); ErrCode result = RemoveSlotByType(slotType); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleRemoveSlotByType] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -360,7 +352,6 @@ ErrCode AnsManagerStub::HandleRemoveSlotByType(MessageParcel &data, MessageParce ErrCode AnsManagerStub::HandleRemoveAllSlots(MessageParcel &data, MessageParcel &reply) { ErrCode result = RemoveAllSlots(); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleRemoveAllSlots] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -377,7 +368,6 @@ ErrCode AnsManagerStub::HandleAddSlotGroups(MessageParcel &data, MessageParcel & } ErrCode result = AddSlotGroups(groups); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleAddSlotGroups] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -389,7 +379,6 @@ ErrCode AnsManagerStub::HandleGetSlots(MessageParcel &data, MessageParcel &reply { std::vector> slots; ErrCode result = GetSlots(slots); - if (!WriteParcelableVector(slots, reply, result)) { ANS_LOGW("[HandleGetSlots] fail: write slots failed"); return ERR_ANS_PARCELABLE_FAILED; @@ -404,7 +393,6 @@ ErrCode AnsManagerStub::HandleGetSlotByType(MessageParcel &data, MessageParcel & sptr slot; ErrCode result = GetSlotByType(slotType, slot); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetSlotByType] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -427,7 +415,6 @@ ErrCode AnsManagerStub::HandleGetSlotGroup(MessageParcel &data, MessageParcel &r sptr group; ErrCode result = GetSlotGroup(groupId, group); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetSlotGroup] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -444,7 +431,6 @@ ErrCode AnsManagerStub::HandleGetSlotGroups(MessageParcel &data, MessageParcel & { std::vector> groups; ErrCode result = GetSlotGroups(groups); - if (!WriteParcelableVector(groups, reply, result)) { ANS_LOGW("[HandleGetSlotGroups] fail: write groups failed"); return ERR_ANS_PARCELABLE_FAILED; @@ -484,7 +470,6 @@ ErrCode AnsManagerStub::HandleRemoveSlotGroups(MessageParcel &data, MessageParce } ErrCode result = RemoveSlotGroups(groupIds); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleRemoveSlotGroups] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -496,7 +481,6 @@ ErrCode AnsManagerStub::HandleGetActiveNotifications(MessageParcel &data, Messag { std::vector> notifications; ErrCode result = GetActiveNotifications(notifications); - if (!WriteParcelableVector(notifications, reply, result)) { ANS_LOGW("[HandleGetActiveNotifications] fail: write notifications failed"); return ERR_ANS_PARCELABLE_FAILED; @@ -508,7 +492,6 @@ ErrCode AnsManagerStub::HandleGetActiveNotificationNums(MessageParcel &data, Mes { int num = 0; ErrCode result = GetActiveNotificationNums(num); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetActiveNotificationNums] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -525,7 +508,6 @@ ErrCode AnsManagerStub::HandleGetAllActiveNotifications(MessageParcel &data, Mes { std::vector> notifications; ErrCode result = GetAllActiveNotifications(notifications); - if (!WriteParcelableVector(notifications, reply, result)) { ANS_LOGW("[HandleGetAllActiveNotifications] fail: write notifications failed"); return ERR_ANS_PARCELABLE_FAILED; @@ -543,7 +525,6 @@ ErrCode AnsManagerStub::HandleGetSpecialActiveNotifications(MessageParcel &data, std::vector> notifications; ErrCode result = GetSpecialActiveNotifications(key, notifications); - if (!WriteParcelableVector(notifications, reply, result)) { ANS_LOGW("[HandleGetSpecialActiveNotifications] fail: write notifications failed"); return ERR_ANS_PARCELABLE_FAILED; @@ -571,7 +552,6 @@ ErrCode AnsManagerStub::HandleGetNotificationAgent(MessageParcel &data, MessageP { std::string agent; ErrCode result = GetNotificationAgent(agent); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetNotificationAgent] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -595,7 +575,6 @@ ErrCode AnsManagerStub::HandleCanPublishAsBundle(MessageParcel &data, MessagePar bool canPublish = false; ErrCode result = CanPublishAsBundle(representativeBundle, canPublish); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleCanPublishAsBundle] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -651,7 +630,6 @@ ErrCode AnsManagerStub::HandleGetBundleImportance(MessageParcel &data, MessagePa { int importance = 0; ErrCode result = GetBundleImportance(importance); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetBundleImportance] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -673,7 +651,6 @@ ErrCode AnsManagerStub::HandleSetDoNotDisturbDate(MessageParcel &data, MessagePa } ErrCode result = SetDoNotDisturbDate(date); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleSetDoNotDisturbDate] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -687,7 +664,6 @@ ErrCode AnsManagerStub::HandleGetDoNotDisturbDate(MessageParcel &data, MessagePa sptr date = nullptr; ErrCode result = GetDoNotDisturbDate(date); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleSetDoNotDisturbDate] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -708,7 +684,6 @@ ErrCode AnsManagerStub::HandleDoesSupportDoNotDisturbMode(MessageParcel &data, M bool support = false; ErrCode result = DoesSupportDoNotDisturbMode(support); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleDoesSupportDoNotDisturbMode] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -731,7 +706,6 @@ ErrCode AnsManagerStub::HandlePublishContinuousTaskNotification(MessageParcel &d } ErrCode result = PublishContinuousTaskNotification(request); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandlePublishContinuousTaskNotification] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -754,7 +728,6 @@ ErrCode AnsManagerStub::HandleCancelContinuousTaskNotification(MessageParcel &da } ErrCode result = CancelContinuousTaskNotification(label, notificationId); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleCancelContinuousTaskNotification] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -766,7 +739,6 @@ ErrCode AnsManagerStub::HandleIsNotificationPolicyAccessGranted(MessageParcel &d { bool granted = false; ErrCode result = HasNotificationPolicyAccessPermission(granted); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleIsNotificationPolicyAccessGranted] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1058,7 +1030,6 @@ ErrCode AnsManagerStub::HandleGetShowBadgeEnabledForBundle(MessageParcel &data, bool enabled = false; ErrCode result = GetShowBadgeEnabledForBundle(bundleOption, enabled); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetShowBadgeEnabledForBundle] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1075,7 +1046,6 @@ ErrCode AnsManagerStub::HandleGetShowBadgeEnabled(MessageParcel &data, MessagePa { bool enabled = false; ErrCode result = GetShowBadgeEnabled(enabled); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetShowBadgeEnabled] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1154,7 +1124,6 @@ ErrCode AnsManagerStub::HandleAreNotificationsSuspended(MessageParcel &data, Mes { bool suspended = false; ErrCode result = AreNotificationsSuspended(suspended); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleAreNotificationsSuspended] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1171,7 +1140,6 @@ ErrCode AnsManagerStub::HandleGetCurrentAppSorting(MessageParcel &data, MessageP { sptr sortingMap; ErrCode result = GetCurrentAppSorting(sortingMap); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetCurrentAppSorting] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1188,7 +1156,6 @@ ErrCode AnsManagerStub::HandleIsAllowedNotify(MessageParcel &data, MessageParcel { bool allowed = false; ErrCode result = IsAllowedNotify(allowed); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleIsAllowedNotify] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1211,7 +1178,6 @@ ErrCode AnsManagerStub::HandleIsSpecialBundleAllowedNotify(MessageParcel &data, bool allowed = false; ErrCode result = IsSpecialBundleAllowedNotify(bundleOption, allowed); - if (!reply.WriteInt32(result)) { ANS_LOGW("[IsSpecialBundleAllowedNotify] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1233,7 +1199,6 @@ ErrCode AnsManagerStub::HandleCancelGroup(MessageParcel &data, MessageParcel &re } ErrCode result = CancelGroup(groupName); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleCancelGroup] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1256,7 +1221,6 @@ ErrCode AnsManagerStub::HandleRemoveGroupByBundle(MessageParcel &data, MessagePa } ErrCode result = RemoveGroupByBundle(bundleOption, groupName); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleRemoveGroupByBundle] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -1274,7 +1238,6 @@ ErrCode AnsManagerStub::HandleShellDump(MessageParcel &data, MessageParcel &repl std::vector notificationsInfo; ErrCode result = ShellDump(dumpOption, notificationsInfo); - if (!reply.WriteInt32(result)) { ANS_LOGW("[HandleGetRecentNotificationsInfo] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; diff --git a/frameworks/ans/core/src/ans_notification.cpp b/frameworks/ans/core/src/ans_notification.cpp index 7171c3879954453c41b818d610451b453d87c006..2e8b4801880f2a9dd6c1d7727d9ba7397790ef85 100644 --- a/frameworks/ans/core/src/ans_notification.cpp +++ b/frameworks/ans/core/src/ans_notification.cpp @@ -14,7 +14,6 @@ */ #include "ans_notification.h" -#include #include "ans_const_define.h" #include "ans_inner_errors.h" #include "ans_log_wrapper.h" diff --git a/frameworks/ans/core/src/ans_subscriber_proxy.cpp b/frameworks/ans/core/src/ans_subscriber_proxy.cpp index b1abfafed29c133b6fc193af334744156c710f9a..1952b3f6b602b45aa23cdccb6f5e44814212c782 100644 --- a/frameworks/ans/core/src/ans_subscriber_proxy.cpp +++ b/frameworks/ans/core/src/ans_subscriber_proxy.cpp @@ -274,6 +274,5 @@ void AnsSubscriberProxy::OnDoNotDisturbDateChange(const sptr #include "ans_subscriber_stub.h" @@ -216,6 +215,5 @@ void AnsSubscriberStub::OnUpdated(const sptr ¬ificati void AnsSubscriberStub::OnDoNotDisturbDateChange(const sptr &date) {} - } // namespace Notification } // namespace OHOS diff --git a/frameworks/ans/native/src/notification.cpp b/frameworks/ans/native/src/notification.cpp index 100e122204397d86a1dec2169d0304f3f5b876ad..77b1f58b431f2ea034a4d2d0b0addaedf9428b2d 100644 --- a/frameworks/ans/native/src/notification.cpp +++ b/frameworks/ans/native/src/notification.cpp @@ -15,13 +15,12 @@ #include "notification.h" -#include #include "ans_log_wrapper.h" namespace OHOS { namespace Notification { -Notification::Notification(){}; +Notification::Notification() {}; Notification::Notification(const sptr &request) { @@ -445,6 +444,5 @@ std::string Notification::Dump() const } return dump; } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/frameworks/ans/native/src/notification_action_button.cpp b/frameworks/ans/native/src/notification_action_button.cpp index 4c114748e9b228046097642cf7370bd35c27e103..94cd2a7247a4688dc06e7df943fb94bdce7c7d55 100644 --- a/frameworks/ans/native/src/notification_action_button.cpp +++ b/frameworks/ans/native/src/notification_action_button.cpp @@ -15,7 +15,6 @@ #include "notification_action_button.h" -#include #include "ans_log_wrapper.h" namespace OHOS { @@ -34,7 +33,6 @@ std::shared_ptr NotificationActionButton::Create(const auto realExtras = extras; if (!realExtras) { realExtras = std::make_shared(); - if (!realExtras) { ANS_LOGE("create PacMap object failed"); return {}; @@ -289,7 +287,7 @@ bool NotificationActionButton::Marshalling(Parcel &parcel) const NotificationActionButton *NotificationActionButton::Unmarshalling(Parcel &parcel) { auto pButton = new NotificationActionButton(); - if ((nullptr != pButton) && !pButton->ReadFromParcel(parcel)) { + if ((pButton != nullptr) && !pButton->ReadFromParcel(parcel)) { delete pButton; pButton = nullptr; } @@ -345,7 +343,7 @@ bool NotificationActionButton::ReadFromParcel(Parcel &parcel) NotificationUserInput *member {nullptr}; if (valid) { member = parcel.ReadParcelable(); - if (nullptr == member) { + if (member == nullptr) { ANS_LOGE("Failed to read userInput"); return false; } diff --git a/frameworks/ans/native/src/notification_bundle_option.cpp b/frameworks/ans/native/src/notification_bundle_option.cpp index b5adae94ec9affbf19a620b61aafe74774d14544..4269aca2b370ab3a5fe4af6c2621a0a0029843bd 100644 --- a/frameworks/ans/native/src/notification_bundle_option.cpp +++ b/frameworks/ans/native/src/notification_bundle_option.cpp @@ -18,7 +18,8 @@ namespace OHOS { namespace Notification { -NotificationBundleOption::NotificationBundleOption(const std::string &bundleName, const int32_t uid) : bundleName_(bundleName), uid_(uid) +NotificationBundleOption::NotificationBundleOption(const std::string &bundleName, const int32_t uid) + : bundleName_(bundleName), uid_(uid) {} NotificationBundleOption::~NotificationBundleOption() diff --git a/frameworks/ans/native/src/notification_constant.cpp b/frameworks/ans/native/src/notification_constant.cpp index 43f23d63c8a35e2e66e8127514e0c116ae88c98f..5637d588d029b01a062a52b4e2e00f93267e7a80 100644 --- a/frameworks/ans/native/src/notification_constant.cpp +++ b/frameworks/ans/native/src/notification_constant.cpp @@ -18,6 +18,5 @@ namespace OHOS { namespace Notification { const std::string NotificationConstant::EXTRA_INPUTS_SOURCE {"notification_user_input_source"}; - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/frameworks/ans/native/src/notification_content.cpp b/frameworks/ans/native/src/notification_content.cpp index 1accb1daafbfaf6c272bebb5f8d45039291df2f0..5f302bb59010b0e543b87f0720cc772ba89f664b 100644 --- a/frameworks/ans/native/src/notification_content.cpp +++ b/frameworks/ans/native/src/notification_content.cpp @@ -136,7 +136,7 @@ bool NotificationContent::Marshalling(Parcel &parcel) const NotificationContent *NotificationContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } @@ -162,7 +162,8 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) return false; } content_ = std::dynamic_pointer_cast(normalContent); - } break; + break; + } case NotificationContent::Type::CONVERSATION: { std::shared_ptr conversationalContent( parcel.ReadParcelable()); @@ -171,7 +172,8 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) return false; } content_ = std::dynamic_pointer_cast(conversationalContent); - } break; + break; + } case NotificationContent::Type::LONG_TEXT: { std::shared_ptr longTextContent( parcel.ReadParcelable()); @@ -180,7 +182,8 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) return false; } content_ = std::dynamic_pointer_cast(longTextContent); - } break; + break; + } case NotificationContent::Type::MEDIA: { std::shared_ptr mediaContent(parcel.ReadParcelable()); if (!mediaContent) { @@ -188,7 +191,8 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) return false; } content_ = std::dynamic_pointer_cast(mediaContent); - } break; + break; + } case NotificationContent::Type::MULTILINE: { std::shared_ptr multiLineContent( parcel.ReadParcelable()); @@ -197,7 +201,8 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) return false; } content_ = std::dynamic_pointer_cast(multiLineContent); - } break; + break; + } case NotificationContent::Type::PICTURE: { std::shared_ptr pictureContent( parcel.ReadParcelable()); @@ -206,10 +211,11 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) return false; } content_ = std::dynamic_pointer_cast(pictureContent); - } break; + break; + } default: { return false; - } break; + } } return true; diff --git a/frameworks/ans/native/src/notification_conversational_content.cpp b/frameworks/ans/native/src/notification_conversational_content.cpp index 2b1925d8432d563c48ef9a46e73001751b7a4051..102a98424b5ec732231c3fa9b5b718f679b9b933 100644 --- a/frameworks/ans/native/src/notification_conversational_content.cpp +++ b/frameworks/ans/native/src/notification_conversational_content.cpp @@ -133,7 +133,7 @@ bool NotificationConversationalContent::Marshalling(Parcel &parcel) const NotificationConversationalContent *NotificationConversationalContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationConversationalContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } diff --git a/frameworks/ans/native/src/notification_conversational_message.cpp b/frameworks/ans/native/src/notification_conversational_message.cpp index 9274ef8aa3fa392e3c6700da980a0621328d65e0..139826a7cbf8912b7a821a1ce3eac6dd4c84b03b 100644 --- a/frameworks/ans/native/src/notification_conversational_message.cpp +++ b/frameworks/ans/native/src/notification_conversational_message.cpp @@ -102,7 +102,7 @@ bool NotificationConversationalMessage::Marshalling(Parcel &parcel) const NotificationConversationalMessage *NotificationConversationalMessage::Unmarshalling(Parcel &parcel) { auto pMessage = new NotificationConversationalMessage(); - if ((nullptr != pMessage) && !pMessage->ReadFromParcel(parcel)) { + if ((pMessage != nullptr) && !pMessage->ReadFromParcel(parcel)) { delete pMessage; pMessage = nullptr; } diff --git a/frameworks/ans/native/src/notification_long_text_content.cpp b/frameworks/ans/native/src/notification_long_text_content.cpp index c806df2ef08e8d4b0b8f9ce4d178a063e6a6fa55..1ce547bbd6b13a14ca0d855d50d848cb43799925 100644 --- a/frameworks/ans/native/src/notification_long_text_content.cpp +++ b/frameworks/ans/native/src/notification_long_text_content.cpp @@ -13,9 +13,8 @@ * limitations under the License. */ -#include -#include "notification_long_text_content.h" #include "ans_log_wrapper.h" +#include "notification_long_text_content.h" namespace OHOS { namespace Notification { @@ -97,7 +96,7 @@ bool NotificationLongTextContent::Marshalling(Parcel &parcel) const NotificationLongTextContent *NotificationLongTextContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationLongTextContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } diff --git a/frameworks/ans/native/src/notification_media_content.cpp b/frameworks/ans/native/src/notification_media_content.cpp index d66b8bc7afe9bfa8e7a3fd5a76941fcfcdf234b5..252240bc4639825bd4c34e972fd483e3e9069513 100644 --- a/frameworks/ans/native/src/notification_media_content.cpp +++ b/frameworks/ans/native/src/notification_media_content.cpp @@ -13,9 +13,8 @@ * limitations under the License. */ -#include -#include "notification_media_content.h" #include "ans_log_wrapper.h" +#include "notification_media_content.h" namespace OHOS { namespace Notification { @@ -68,7 +67,7 @@ bool NotificationMediaContent::Marshalling(Parcel &parcel) const NotificationMediaContent *NotificationMediaContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationMediaContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } diff --git a/frameworks/ans/native/src/notification_multiline_content.cpp b/frameworks/ans/native/src/notification_multiline_content.cpp index abd88be57d106dc3bfc618f0535c91dc021ed089..d20acf4865c9f109b54f60e78620133d6cf94a6d 100644 --- a/frameworks/ans/native/src/notification_multiline_content.cpp +++ b/frameworks/ans/native/src/notification_multiline_content.cpp @@ -14,8 +14,8 @@ */ #include -#include "notification_multiline_content.h" #include "ans_log_wrapper.h" +#include "notification_multiline_content.h" namespace OHOS { namespace Notification { @@ -95,7 +95,7 @@ bool NotificationMultiLineContent::Marshalling(Parcel &parcel) const NotificationMultiLineContent *NotificationMultiLineContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationMultiLineContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } diff --git a/frameworks/ans/native/src/notification_normal_content.cpp b/frameworks/ans/native/src/notification_normal_content.cpp index e9e253789e260af7f117c2cda145b396160ef0a2..481c1aa9c849de091e56095162b1a10de6c4a139 100644 --- a/frameworks/ans/native/src/notification_normal_content.cpp +++ b/frameworks/ans/native/src/notification_normal_content.cpp @@ -30,7 +30,7 @@ bool NotificationNormalContent::Marshalling(Parcel &parcel) const NotificationNormalContent *NotificationNormalContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationNormalContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } diff --git a/frameworks/ans/native/src/notification_picture_content.cpp b/frameworks/ans/native/src/notification_picture_content.cpp index 9138938cb6b1ff178b5f851ef685f2acaa9e3002..b2aa8af665bf2ceb497ef7e0d34ffef116b7a5e8 100644 --- a/frameworks/ans/native/src/notification_picture_content.cpp +++ b/frameworks/ans/native/src/notification_picture_content.cpp @@ -90,7 +90,7 @@ bool NotificationPictureContent::Marshalling(Parcel &parcel) const NotificationPictureContent *NotificationPictureContent::Unmarshalling(Parcel &parcel) { auto pContent = new NotificationPictureContent(); - if ((nullptr != pContent) && !pContent->ReadFromParcel(parcel)) { + if ((pContent != nullptr) && !pContent->ReadFromParcel(parcel)) { delete pContent; pContent = nullptr; } diff --git a/frameworks/ans/native/src/notification_request.cpp b/frameworks/ans/native/src/notification_request.cpp index 1ea18d3c048611432ab3754a65a6b5e917d182fc..a3898fcdaa58dca505d374839e24b3cdd2bc5442 100644 --- a/frameworks/ans/native/src/notification_request.cpp +++ b/frameworks/ans/native/src/notification_request.cpp @@ -13,10 +13,8 @@ * limitations under the License. */ -#include -#include -#include "notification_request.h" #include "ans_log_wrapper.h" +#include "notification_request.h" namespace OHOS { namespace Notification { @@ -271,7 +269,7 @@ int64_t NotificationRequest::GetDeliveryTime() const bool NotificationRequest::IsShowDeliveryTime() const { - return (0 != deliveryTime_) && showDeliveryTime_; + return (deliveryTime_ != 0) && showDeliveryTime_; } void NotificationRequest::SetShowDeliveryTime(bool showDeliveryTime) @@ -653,7 +651,7 @@ const std::shared_ptr NotificationRequest::GetPublicNotific std::string NotificationRequest::GetNotificationHashCode() const { - if (creatorBundleName_.empty() || (0 == creatorUid_) || ownerBundleName_.empty()) { + if (creatorBundleName_.empty() || (creatorUid_ == 0) || ownerBundleName_.empty()) { return ""; } @@ -1090,7 +1088,7 @@ bool NotificationRequest::Marshalling(Parcel &parcel) const NotificationRequest *NotificationRequest::Unmarshalling(Parcel &parcel) { auto objptr = new NotificationRequest(); - if ((nullptr != objptr) && !objptr->ReadFromParcel(parcel)) { + if ((objptr != nullptr) && !objptr->ReadFromParcel(parcel)) { delete objptr; objptr = nullptr; } @@ -1254,7 +1252,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) auto vsize = parcel.ReadInt32(); for (auto it = 0; it < vsize; ++it) { auto member = parcel.ReadParcelable(); - if (nullptr == member) { + if (member == nullptr) { ANS_LOGE("Failed to read actionButton"); return false; } @@ -1265,7 +1263,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) vsize = parcel.ReadInt32(); for (auto it = 0; it < vsize; ++it) { auto member = parcel.ReadParcelable(); - if (nullptr == member) { + if (member == nullptr) { ANS_LOGE("Failed to read messageUser"); return false; } diff --git a/frameworks/ans/native/src/notification_slot.cpp b/frameworks/ans/native/src/notification_slot.cpp index a54224d445285c056ed89c3ae28a7350e5306f7b..00f7a5b7cd4b38f32e0d93fa1654d05a26c2dbf8 100644 --- a/frameworks/ans/native/src/notification_slot.cpp +++ b/frameworks/ans/native/src/notification_slot.cpp @@ -19,7 +19,6 @@ namespace OHOS { namespace Notification { - const int MAX_TEXT_LENGTH = 1000; NotificationSlot::NotificationSlot(NotificationConstant::SlotType type) : sound_("") diff --git a/frameworks/ans/native/src/notification_slot_group.cpp b/frameworks/ans/native/src/notification_slot_group.cpp index 5f06ffc53694269c0addada01612536ad1b5d191..89720f81266d4ab15cce6f1a3b94544d8755c486 100644 --- a/frameworks/ans/native/src/notification_slot_group.cpp +++ b/frameworks/ans/native/src/notification_slot_group.cpp @@ -137,7 +137,7 @@ bool NotificationSlotGroup::ReadFromParcel(Parcel &parcel) if (size) { for (int32_t i = 0; i < size; ++i) { auto slot = parcel.ReadParcelable(); - if (nullptr == slot) { + if (slot == nullptr) { ANS_LOGE("Failed to read slot"); return false; } diff --git a/frameworks/ans/native/src/notification_subscribe_info.cpp b/frameworks/ans/native/src/notification_subscribe_info.cpp index 542404270259238e4daaaec9fcaa56874dd20ec9..7f42398745c3dd8cac452614fa9ff853b4e012ec 100644 --- a/frameworks/ans/native/src/notification_subscribe_info.cpp +++ b/frameworks/ans/native/src/notification_subscribe_info.cpp @@ -19,7 +19,6 @@ namespace OHOS { namespace Notification { - NotificationSubscribeInfo::NotificationSubscribeInfo() {} @@ -77,6 +76,5 @@ std::string NotificationSubscribeInfo::Dump() { return "Dump"; } - } // namespace Notification } // namespace OHOS diff --git a/frameworks/ans/native/src/notification_subscriber.cpp b/frameworks/ans/native/src/notification_subscriber.cpp index 62e2c09e6bf5c66d6ee6da243e636b62a764105c..d1be62359901128265d0e182c3480a520e1ed6fb 100644 --- a/frameworks/ans/native/src/notification_subscriber.cpp +++ b/frameworks/ans/native/src/notification_subscriber.cpp @@ -20,7 +20,6 @@ namespace OHOS { namespace Notification { - NotificationSubscriber::NotificationSubscriber() { impl_ = new SubscriberImpl(*this); @@ -110,7 +109,7 @@ bool NotificationSubscriber::SubscriberImpl::GetAnsManagerProxy() } proxy_ = iface_cast(remoteObject); - if ((nullptr == proxy_) || (nullptr == proxy_->AsObject())) { + if ((proxy_ == nullptr) || (proxy_->AsObject() == nullptr)) { return false; } } @@ -120,15 +119,14 @@ bool NotificationSubscriber::SubscriberImpl::GetAnsManagerProxy() } NotificationSubscriber::SubscriberImpl::DeathRecipient::DeathRecipient(SubscriberImpl &subscriberImpl) - : subscriberImpl_(subscriberImpl){}; + : subscriberImpl_(subscriberImpl) {}; -NotificationSubscriber::SubscriberImpl::DeathRecipient::~DeathRecipient(){}; +NotificationSubscriber::SubscriberImpl::DeathRecipient::~DeathRecipient() {}; void NotificationSubscriber::SubscriberImpl::DeathRecipient::OnRemoteDied(const wptr &object) { subscriberImpl_.proxy_ = nullptr; subscriberImpl_.subscriber_.OnDied(); } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/frameworks/ans/native/src/notification_user_input.cpp b/frameworks/ans/native/src/notification_user_input.cpp index 0115c3ba4c5d7adc8128dc664ed24807d1fa498c..e8ed66a0f59d717392a33aa8c683296bad2c227c 100644 --- a/frameworks/ans/native/src/notification_user_input.cpp +++ b/frameworks/ans/native/src/notification_user_input.cpp @@ -15,7 +15,6 @@ #include "notification_user_input.h" -#include #include "ans_log_wrapper.h" namespace OHOS { @@ -281,7 +280,7 @@ bool NotificationUserInput::Marshalling(Parcel &parcel) const NotificationUserInput *NotificationUserInput::Unmarshalling(Parcel &parcel) { auto pUserInput = new NotificationUserInput(); - if ((nullptr != pUserInput) && !pUserInput->ReadFromParcel(parcel)) { + if ((pUserInput != nullptr) && !pUserInput->ReadFromParcel(parcel)) { delete pUserInput; pUserInput = nullptr; } diff --git a/frameworks/ans/test/moduletest/ans_innerkits_module_publish_test.cpp b/frameworks/ans/test/moduletest/ans_innerkits_module_publish_test.cpp index aae3d31d700c320acd3c1de0931342e795729eae..65a4ab2e7ef9b7be714c4f5d3ec4350affdb211a 100644 --- a/frameworks/ans/test/moduletest/ans_innerkits_module_publish_test.cpp +++ b/frameworks/ans/test/moduletest/ans_innerkits_module_publish_test.cpp @@ -32,7 +32,6 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - static sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); bool OnConsumedReceived = false; @@ -67,7 +66,7 @@ std::mutex g_send_finished_mtx; AAFwk::Want g_want; const time_t TIME_OUT_SECONDS_LIMIT = 5; -const std::string CLASSIFICATION_ALARM{"alarm"}; +const std::string CLASSIFICATION_ALARM {"alarm"}; class TestAnsSubscriber : public NotificationSubscriber { public: diff --git a/frameworks/ans/test/moduletest/ans_innerkits_module_setting_test.cpp b/frameworks/ans/test/moduletest/ans_innerkits_module_setting_test.cpp index 98a38c06f1a527c1853775734f460935c608b9c6..4a16ba62f171039707bf3e5ebda10f34d91b3530 100644 --- a/frameworks/ans/test/moduletest/ans_innerkits_module_setting_test.cpp +++ b/frameworks/ans/test/moduletest/ans_innerkits_module_setting_test.cpp @@ -28,7 +28,6 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - static sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); const int32_t CALLING_UID = 9998; @@ -73,7 +72,7 @@ HWTEST_F(AnsInterfaceModuleSettingTest, ANS_Interface_MT_NotificationSetting_001 EXPECT_EQ(0, NotificationHelper::SetShowBadgeEnabledForBundle(bundleOption, true)); bool enabled = false; EXPECT_EQ(0, NotificationHelper::GetShowBadgeEnabledForBundle(bundleOption, enabled)); - EXPECT_EQ(true,enabled); + EXPECT_EQ(true, enabled); EXPECT_EQ("bundlename", bundleOption.GetBundleName()); EXPECT_EQ(CALLING_UID, bundleOption.GetUid()); } @@ -91,7 +90,7 @@ HWTEST_F(AnsInterfaceModuleSettingTest, ANS_Interface_MT_NotificationSetting_002 EXPECT_EQ(0, NotificationHelper::SetShowBadgeEnabledForBundle(bundleOption, false)); bool enabled = false; EXPECT_EQ(0, NotificationHelper::GetShowBadgeEnabledForBundle(bundleOption, enabled)); - EXPECT_EQ(false,enabled); + EXPECT_EQ(false, enabled); EXPECT_EQ("bundlename", bundleOption.GetBundleName()); EXPECT_EQ(CALLING_UID, bundleOption.GetUid()); } @@ -111,7 +110,7 @@ HWTEST_F(AnsInterfaceModuleSettingTest, ANS_Interface_MT_NotificationSetting_003 EXPECT_EQ(0, NotificationHelper::SetNotificationsEnabledForSpecifiedBundle(bundleOption, deviceId, true)); bool enabled = false; EXPECT_EQ(0, NotificationHelper::IsAllowedNotify(bundleOption, enabled)); - EXPECT_EQ(true,enabled); + EXPECT_EQ(true, enabled); EXPECT_EQ("bundlename", bundleOption.GetBundleName()); EXPECT_EQ(CALLING_UID, bundleOption.GetUid()); } @@ -119,8 +118,8 @@ HWTEST_F(AnsInterfaceModuleSettingTest, ANS_Interface_MT_NotificationSetting_003 /** * @tc.number : ANS_Interface_MT_NotificationSetting_00400 * @tc.name : NotificationSetting_00400 - * @tc.desc : Set a specified application do not publish notification, get the specified application can not publish - * notification. + * @tc.desc : Set a specified application do not publish notification, get the specified application can not + * publish notification. * @tc.expected : Set a specified application do not publish notification success, get the specified application can * not publish notification. */ @@ -131,7 +130,7 @@ HWTEST_F(AnsInterfaceModuleSettingTest, ANS_Interface_MT_NotificationSetting_004 EXPECT_EQ(0, NotificationHelper::SetNotificationsEnabledForSpecifiedBundle(bundleOption, deviceId, false)); bool enabled = false; EXPECT_EQ(0, NotificationHelper::IsAllowedNotify(bundleOption, enabled)); - EXPECT_EQ(false,enabled); + EXPECT_EQ(false, enabled); EXPECT_EQ("bundlename", bundleOption.GetBundleName()); EXPECT_EQ(CALLING_UID, bundleOption.GetUid()); } diff --git a/frameworks/ans/test/moduletest/ans_innerkits_module_slot_test.cpp b/frameworks/ans/test/moduletest/ans_innerkits_module_slot_test.cpp index caef96a20b5bd4d49f18a39dc6965fc63069ecaa..31675f210c0dd47e995022d567ba435ab176a3da 100644 --- a/frameworks/ans/test/moduletest/ans_innerkits_module_slot_test.cpp +++ b/frameworks/ans/test/moduletest/ans_innerkits_module_slot_test.cpp @@ -29,7 +29,6 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - static sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); const int32_t CALLING_UID = 9998; diff --git a/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index cd58a48388c28f596e09b1eb2933dfb6492ffd46..6bcdb3b57b7797fdadcd836241e4370b7ea1e8b0 100644 --- a/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -24,7 +24,6 @@ namespace OHOS { namespace AppExecFwk { - BundleMgrProxy::BundleMgrProxy(const sptr &impl) : IRemoteProxy(impl) { } @@ -277,6 +276,5 @@ bool BundleMgrProxy::SendTransactCmd(IBundleMgr::Message code, MessageParcel &da { return true; } - } // namespace AppExecFwk } // namespace OHOS diff --git a/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp b/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp index 12a7f65b9d4e00f3c9c65a4a8668e162960cb723..bbbeb490708bddfb63b3f0cfee26529eac2bd62b 100644 --- a/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp @@ -15,7 +15,6 @@ #include "event_handler.h" #include "event_handler_utils.h" -#include namespace OHOS { namespace AppExecFwk { diff --git a/frameworks/ans/test/moduletest/mock/mock_message_parcel.cpp b/frameworks/ans/test/moduletest/mock/mock_message_parcel.cpp index 26b6304c7930522d66ea3a2c6e8fefefb1826ce4..49c18fba8d3d77799f4682f06ff36e906e0998a9 100644 --- a/frameworks/ans/test/moduletest/mock/mock_message_parcel.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_message_parcel.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "message_parcel.h" #include #include +#include "message_parcel.h" #include "ipc_debug.h" #include "iremote_object.h" diff --git a/frameworks/ans/test/moduletest/mock/mock_single_kv_store.cpp b/frameworks/ans/test/moduletest/mock/mock_single_kv_store.cpp index bc79b1906abc1e2fef3eccc0efe1c24426bd0a35..e246e8d9931ca3446ffcb3c9ab9d75f2091c80b8 100644 --- a/frameworks/ans/test/moduletest/mock/mock_single_kv_store.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_single_kv_store.cpp @@ -18,7 +18,6 @@ namespace OHOS { namespace DistributedKv { - Status AnsTestSingleKvStore::GetEntries(const Key &prefixKey, std::vector &entries) const { return Status::SUCCESS; diff --git a/frameworks/wantagent/src/pending_want.cpp b/frameworks/wantagent/src/pending_want.cpp index 926dbfc2d994fd94b0d7a287994321a1dfd31628..56e1e4c96fa40537b8e1e6fe640bddff59e27ea6 100644 --- a/frameworks/wantagent/src/pending_want.cpp +++ b/frameworks/wantagent/src/pending_want.cpp @@ -408,5 +408,4 @@ PendingWant *PendingWant::Unmarshalling(Parcel &parcel) return pendingWant; } - } // namespace OHOS::Notification::WantAgent diff --git a/frameworks/wantagent/src/want_agent_log_wrapper.cpp b/frameworks/wantagent/src/want_agent_log_wrapper.cpp index 059ffb295773be0173e4c969b29c5e89de94bbb5..e379cef2314edea1c742db7c67a161f5f004c686 100644 --- a/frameworks/wantagent/src/want_agent_log_wrapper.cpp +++ b/frameworks/wantagent/src/want_agent_log_wrapper.cpp @@ -14,7 +14,6 @@ */ #include "want_agent_log_wrapper.h" -#include namespace OHOS::Notification::WantAgent { // initial static member object diff --git a/interfaces/innerkits/ans/native/include/message_user.h b/interfaces/innerkits/ans/native/include/message_user.h index 0e7717dda9b1ea5bee41c7a1e13de26a4569223a..7c8dbda6a2b8bd162ef56a7850b3a31f1543c5b0 100644 --- a/interfaces/innerkits/ans/native/include/message_user.h +++ b/interfaces/innerkits/ans/native/include/message_user.h @@ -150,12 +150,12 @@ private: bool ReadFromParcel(Parcel &parcel); private: - std::string key_{}; - std::string name_{}; - std::shared_ptr pixelMap_{nullptr}; + std::string key_ {}; + std::string name_ {}; + std::shared_ptr pixelMap_ {nullptr}; Uri uri_; - bool isMachine_{false}; - bool isUserImportant_{false}; + bool isMachine_ {false}; + bool isUserImportant_ {false}; // no object in parcel static constexpr int VALUE_NULL = -1; diff --git a/interfaces/innerkits/ans/native/include/notification.h b/interfaces/innerkits/ans/native/include/notification.h index 1b125e4fefa7ea54b2f04bc293ad3b2e869b0dc4..7503e15b1f2ccf749a0e30d3171e5200ddc17a4c 100644 --- a/interfaces/innerkits/ans/native/include/notification.h +++ b/interfaces/innerkits/ans/native/include/notification.h @@ -25,7 +25,6 @@ namespace OHOS { namespace Notification { - class Notification final : public Parcelable { public: /** diff --git a/interfaces/innerkits/ans/native/include/notification_bundle_option.h b/interfaces/innerkits/ans/native/include/notification_bundle_option.h index 7c2fa9171aa53825cf990c0676bdd73ce76d83a3..4ea4fb03c6bb482847541f9f2bb6bbb3957b2eb0 100644 --- a/interfaces/innerkits/ans/native/include/notification_bundle_option.h +++ b/interfaces/innerkits/ans/native/include/notification_bundle_option.h @@ -91,8 +91,8 @@ private: bool ReadFromParcel(Parcel &parcel); private: - std::string bundleName_{}; - int32_t uid_{}; + std::string bundleName_ {}; + int32_t uid_ {}; }; } // namespace Notification } // namespace OHOS diff --git a/interfaces/innerkits/ans/native/include/notification_constant.h b/interfaces/innerkits/ans/native/include/notification_constant.h index fb8f4aae84e2ee34cdbf7f77c592a882e79721ce..1f710ef024d25eee815495d73a1ef62813f6293b 100644 --- a/interfaces/innerkits/ans/native/include/notification_constant.h +++ b/interfaces/innerkits/ans/native/include/notification_constant.h @@ -23,8 +23,8 @@ namespace Notification { class NotificationConstant { public: enum InputEditType { - EDIT_AUTO, // Indicates that the system determines whether to allow the user to edit the options before they - // are sent to the application. + EDIT_AUTO, // Indicates that the system determines whether to allow the user to edit the options before + // they are sent to the application. EDIT_DISABLED, // Indicates that the user is not allowed to edit an option before the option is sent to the // application. EDIT_ENABLED, // Indicates that the user is allowed to edit an option before the option is sent to the diff --git a/interfaces/innerkits/ans/native/include/notification_request.h b/interfaces/innerkits/ans/native/include/notification_request.h index ad1b0789fc2c2e9b0aa620e63e80ff085f07279a..34d542ddcb16ec62a645f0aa357a55ef032053cc 100644 --- a/interfaces/innerkits/ans/native/include/notification_request.h +++ b/interfaces/innerkits/ans/native/include/notification_request.h @@ -137,22 +137,6 @@ public: */ static const uint32_t COLOR_DEFAULT; -private: - /** - * Indicates the color mask, used for calculation with the ARGB value set by setColor(int32_t). - */ - static const uint32_t COLOR_MASK; - - /** - * the maximum number of user input history is 5. - */ - static const std::size_t MAX_USER_INPUT_HISTORY; - - /** - * the maximum number of action buttons is 3. - */ - static const std::size_t MAX_ACTION_BUTTONS; - public: /** * Default constructor used to create a NotificationRequest instance. @@ -874,6 +858,22 @@ public: */ static NotificationRequest *Unmarshalling(Parcel &parcel); +private: + /** + * Indicates the color mask, used for calculation with the ARGB value set by setColor(int32_t). + */ + static const uint32_t COLOR_MASK; + + /** + * the maximum number of user input history is 5. + */ + static const std::size_t MAX_USER_INPUT_HISTORY; + + /** + * the maximum number of action buttons is 3. + */ + static const std::size_t MAX_ACTION_BUTTONS; + private: /** * Read a NotificationRequest object from a Parcel. diff --git a/interfaces/innerkits/ans/native/include/notification_slot_group.h b/interfaces/innerkits/ans/native/include/notification_slot_group.h index 723128910a3aff37cc3e9f96b981679ac06303d8..bcba43946a8da0b5845d814a69675b8b41047359 100644 --- a/interfaces/innerkits/ans/native/include/notification_slot_group.h +++ b/interfaces/innerkits/ans/native/include/notification_slot_group.h @@ -140,11 +140,11 @@ private: bool ReadFromParcel(Parcel &parcel); private: - std::string id_{}; - std::string name_{}; - std::string description_{}; - std::vector slots_{}; - bool isDisabled_{false}; + std::string id_ {}; + std::string name_ {}; + std::string description_ {}; + std::vector slots_ {}; + bool isDisabled_ {false}; }; } // namespace Notification } // namespace OHOS diff --git a/interfaces/innerkits/ans/native/include/notification_sorting.h b/interfaces/innerkits/ans/native/include/notification_sorting.h index 1efa272e597a02f54a3512e40fa39b93aa63bb85..da7810b6f07610c8f09f64be51c82d9a9efc4a4f 100644 --- a/interfaces/innerkits/ans/native/include/notification_sorting.h +++ b/interfaces/innerkits/ans/native/include/notification_sorting.h @@ -26,7 +26,6 @@ namespace OHOS { namespace Notification { - class NotificationSorting final : public Parcelable { public: /** diff --git a/interfaces/innerkits/ans/native/include/notification_sorting_map.h b/interfaces/innerkits/ans/native/include/notification_sorting_map.h index 54fb3f37a083a13d8310287230204f13db90946d..0fe5e4b83b215b71139e70b6a217b8cc4919c594 100644 --- a/interfaces/innerkits/ans/native/include/notification_sorting_map.h +++ b/interfaces/innerkits/ans/native/include/notification_sorting_map.h @@ -25,7 +25,6 @@ namespace OHOS { namespace Notification { - class NotificationSortingMap final : public Parcelable { public: /** @@ -96,7 +95,6 @@ private: std::vector sortedKey_ {}; std::map sortings_ {}; }; - } // namespace Notification } // namespace OHOS diff --git a/interfaces/innerkits/ans/native/include/notification_subscribe_info.h b/interfaces/innerkits/ans/native/include/notification_subscribe_info.h index 1eb370e590ea1e33718589e546d77e48caab852b..bb5ede50484e1cb206ef5a34f83186a77d2e1d13 100644 --- a/interfaces/innerkits/ans/native/include/notification_subscribe_info.h +++ b/interfaces/innerkits/ans/native/include/notification_subscribe_info.h @@ -24,7 +24,6 @@ namespace OHOS { namespace Notification { - class NotificationSubscribeInfo final : public Parcelable { public: /** diff --git a/interfaces/innerkits/ans/native/include/notification_subscriber.h b/interfaces/innerkits/ans/native/include/notification_subscriber.h index 54ce4f337146881ab625c5c7b1a763047cde5d21..688959d02cab7b6e34ae369f185165f4c1afeade 100644 --- a/interfaces/innerkits/ans/native/include/notification_subscriber.h +++ b/interfaces/innerkits/ans/native/include/notification_subscriber.h @@ -26,7 +26,6 @@ namespace OHOS { namespace Notification { - class NotificationSubscriber { public: /** @@ -120,7 +119,7 @@ private: public: SubscriberImpl(NotificationSubscriber &subscriber); - ~SubscriberImpl(){}; + ~SubscriberImpl() {}; void OnConnected() override; diff --git a/interfaces/innerkits/wantagent/include/completed_callback.h b/interfaces/innerkits/wantagent/include/completed_callback.h index 5740a899de5027b2dfc2dd6adacd9e244d76192d..5b83a2dc479c0f81178ccf1b8150cc6a95de0b24 100644 --- a/interfaces/innerkits/wantagent/include/completed_callback.h +++ b/interfaces/innerkits/wantagent/include/completed_callback.h @@ -23,7 +23,6 @@ namespace OHOS::Notification::WantAgent { class CompletedCallback { - /** * Called when a Send operation as completed. * diff --git a/interfaces/innerkits/wantagent/include/completed_dispatcher.h b/interfaces/innerkits/wantagent/include/completed_dispatcher.h index bd17fbecf3aa817780cca5b056981ed8c0cf5917..3b987c8fd158c91f414dea0049da5f5d8dd41097 100644 --- a/interfaces/innerkits/wantagent/include/completed_dispatcher.h +++ b/interfaces/innerkits/wantagent/include/completed_dispatcher.h @@ -27,15 +27,6 @@ namespace OHOS::Notification::WantAgent { class PendingWant; class CompletedDispatcher : public AAFwk::WantReceiverStub { -private: - const std::shared_ptr pendingWant_; - const std::shared_ptr callback_; - const std::shared_ptr handler_; - AAFwk::Want want_; - int resultCode_ = 0; - std::string resultData_; - AAFwk::WantParams resultExtras_; - public: CompletedDispatcher(const std::shared_ptr &pendingWant, const std::shared_ptr &callback, const std::shared_ptr &handler); @@ -47,6 +38,15 @@ public: const AAFwk::WantParams &extras, bool serialized, bool sticky, int sendingUser) override; void Run(); + +private: + const std::shared_ptr pendingWant_; + const std::shared_ptr callback_; + const std::shared_ptr handler_; + AAFwk::Want want_; + int resultCode_ = 0; + std::string resultData_; + AAFwk::WantParams resultExtras_; }; } // namespace OHOS::Notification::WantAgent #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_WANTAGENT_COMPLETED_DISPATCHER_H \ No newline at end of file diff --git a/interfaces/innerkits/wantagent/include/pending_want.h b/interfaces/innerkits/wantagent/include/pending_want.h index 7ab84bd4ee814dd9eb1cfcb9e67b3c4e4933d8c1..1db00b77371e1da6b914b40802f47b1fddb5a791 100644 --- a/interfaces/innerkits/wantagent/include/pending_want.h +++ b/interfaces/innerkits/wantagent/include/pending_want.h @@ -32,7 +32,7 @@ namespace OHOS::Notification::WantAgent { class PendingWant final : public std::enable_shared_from_this, public Parcelable { public: - PendingWant(){}; + PendingWant() {}; PendingWant(const sptr &target); PendingWant(const sptr &target, const sptr whitelistToken); virtual ~PendingWant() = default; @@ -255,9 +255,6 @@ private: std::vector> cancelListeners_; class CancelReceiver : public AAFwk::WantReceiverStub { - private: - std::weak_ptr outerInstance_; - public: explicit CancelReceiver(const std::weak_ptr &outerInstance); virtual ~CancelReceiver() = default; @@ -265,6 +262,9 @@ private: void Send(const int32_t resultCode) override; void PerformReceive(const AAFwk::Want &want, int resultCode, const std::string &data, const AAFwk::WantParams &extras, bool serialized, bool sticky, int sendingUser) override; + + private: + std::weak_ptr outerInstance_; }; static std::shared_ptr BuildServicePendingWant(const std::shared_ptr &context, diff --git a/interfaces/innerkits/wantagent/include/trigger_info.h b/interfaces/innerkits/wantagent/include/trigger_info.h index ce60016a4f2758f687fa2dd2495ca816d59e8b78..ba4cdba4e9e7de4c2aa35359811ee45f705cbf12 100644 --- a/interfaces/innerkits/wantagent/include/trigger_info.h +++ b/interfaces/innerkits/wantagent/include/trigger_info.h @@ -100,12 +100,6 @@ public: */ public: class Builder final : public std::enable_shared_from_this { - private: - std::string permission_; - std::shared_ptr params_; - std::shared_ptr want_; - int resultCode_ = 0; - /** * Default constructor used to create a {@code Builder} instance. * @@ -161,6 +155,12 @@ public: * @return Returns the created {@code TriggerInfo} object. */ std::shared_ptr Build(); + + private: + std::string permission_; + std::shared_ptr params_; + std::shared_ptr want_; + int resultCode_ = 0; }; private: diff --git a/interfaces/innerkits/wantagent/include/want_agent.h b/interfaces/innerkits/wantagent/include/want_agent.h index 06d6cd36bbaa03c524ee2600ce1c87ccd9a8f418..f9a19087ed996fe774d20a1658f736d1e141dfde 100644 --- a/interfaces/innerkits/wantagent/include/want_agent.h +++ b/interfaces/innerkits/wantagent/include/want_agent.h @@ -25,16 +25,8 @@ namespace OHOS::Notification::WantAgent { class WantAgent final : public std::enable_shared_from_this, public Parcelable { -private: - std::shared_ptr pendingWant_; - - /** - * Constructor. - * - * @param obj The proxy object. - */ public: - WantAgent(){}; + WantAgent() {}; virtual ~WantAgent() = default; explicit WantAgent(const std::shared_ptr &pendingWant); @@ -67,6 +59,15 @@ public: * @return Returns true if the unmarshalling is successful; returns false otherwise. */ static WantAgent *Unmarshalling(Parcel &parcel); + +private: + std::shared_ptr pendingWant_; + + /** + * Constructor. + * + * @param obj The proxy object. + */ }; } // namespace OHOS::Notification::WantAgent #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_WANTAGENT_INCLUDE_WANT_AGENT_H \ No newline at end of file diff --git a/interfaces/innerkits/wantagent/include/want_agent_constant.h b/interfaces/innerkits/wantagent/include/want_agent_constant.h index 461b023c1fb8d2946e3cbff3116ed5df90150b28..4f611ffa5a2e57019cf92870fcbff9b9ee38f058 100644 --- a/interfaces/innerkits/wantagent/include/want_agent_constant.h +++ b/interfaces/innerkits/wantagent/include/want_agent_constant.h @@ -126,7 +126,7 @@ public: }; private: - WantAgentConstant(){}; + WantAgentConstant() {}; virtual ~WantAgentConstant() = default; }; } // namespace OHOS::Notification::WantAgent diff --git a/interfaces/innerkits/wantagent/include/want_agent_helper.h b/interfaces/innerkits/wantagent/include/want_agent_helper.h index cf775dde26013fa2d08189843925e5f490a2caa6..7f3027fcf9def508e20cecbaf1bbb978d84a4209 100644 --- a/interfaces/innerkits/wantagent/include/want_agent_helper.h +++ b/interfaces/innerkits/wantagent/include/want_agent_helper.h @@ -42,10 +42,6 @@ static const int FLAG_UPDATE_CURRENT = 1 << 27; static const int FLAG_IMMUTABLE = 1 << 26; class WantAgentHelper final : public std::enable_shared_from_this { -private: - WantAgentHelper(); - virtual ~WantAgentHelper() = default; - public: /** * Obtains an WantAgent object. @@ -166,6 +162,10 @@ public: */ static void UnregisterCancelListener( const std::shared_ptr &cancelListener, const std::shared_ptr &agent); + +private: + WantAgentHelper(); + virtual ~WantAgentHelper() = default; private: static void Send(const std::shared_ptr &context, diff --git a/interfaces/innerkits/wantagent/include/want_agent_info.h b/interfaces/innerkits/wantagent/include/want_agent_info.h index 15c411dc90e75bab07b2a0f44de7e35a260fd684..c363784a142dd41d4a28238291aad733a1eee361 100644 --- a/interfaces/innerkits/wantagent/include/want_agent_info.h +++ b/interfaces/innerkits/wantagent/include/want_agent_info.h @@ -32,13 +32,6 @@ namespace OHOS::Notification::WantAgent { * */ class WantAgentInfo final : public std::enable_shared_from_this { -private: - int requestCode_ = 0; - WantAgentConstant::OperationType operationType_ = WantAgentConstant::OperationType::UNKNOWN_TYPE; - std::vector flags_ = std::vector(); - std::vector> wants_ = std::vector>(); - std::shared_ptr extraInfo_; - /** * Default constructor used to create an empty WantAgentInfo instance. * @@ -119,6 +112,13 @@ public: * @return Returns the extra information of the WantAgent object. */ std::shared_ptr GetExtraInfo() const; + +private: + int requestCode_ = 0; + WantAgentConstant::OperationType operationType_ = WantAgentConstant::OperationType::UNKNOWN_TYPE; + std::vector flags_ = std::vector(); + std::vector> wants_ = std::vector>(); + std::shared_ptr extraInfo_; }; } // namespace OHOS::Notification::WantAgent #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_WANTAGENT_INCLUDE_WANT_AGENT_INFO_H \ No newline at end of file diff --git a/interfaces/innerkits/wantagent/include/want_agent_log_wrapper.h b/interfaces/innerkits/wantagent/include/want_agent_log_wrapper.h index 263310dfe9d8c8e453bc81c4d3f25ef1dc457511..8c9c141a35b4427e5295b2e8fa22bcf50f40bc21 100644 --- a/interfaces/innerkits/wantagent/include/want_agent_log_wrapper.h +++ b/interfaces/innerkits/wantagent/include/want_agent_log_wrapper.h @@ -16,8 +16,8 @@ #ifndef BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_WANTAGENT_INCLUDE_WANT_AGENT_LOG_WRAPPER_H #define BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_WANTAGENT_INCLUDE_WANT_AGENT_LOG_WRAPPER_H -#include "hilog/log.h" #include +#include "hilog/log.h" namespace OHOS::Notification::WantAgent { #ifndef WANT_AGENT_LOG_DOMAIN diff --git a/interfaces/kits/napi/ans/include/cancel.h b/interfaces/kits/napi/ans/include/cancel.h index 219005d66f92884b26f8881dec563d9b2f89c701..4cdc87e7953f2396d8cf7d7e69c59f7b8d0ac93e 100644 --- a/interfaces/kits/napi/ans/include/cancel.h +++ b/interfaces/kits/napi/ans/include/cancel.h @@ -25,7 +25,6 @@ using namespace OHOS::Notification; napi_value Cancel(napi_env env, napi_callback_info info); napi_value CancelAll(napi_env env, napi_callback_info info); napi_value CancelGroup(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS diff --git a/interfaces/kits/napi/ans/include/common.h b/interfaces/kits/napi/ans/include/common.h index 94f053a3e5607345c648da912fcc155c467a22b2..0f2075e72a684a9aa945e7a9f6a5428b048d3f48 100644 --- a/interfaces/kits/napi/ans/include/common.h +++ b/interfaces/kits/napi/ans/include/common.h @@ -406,7 +406,6 @@ private: static const int ONLY_CALLBACK_MIN_PARA = 0; static std::set> wantAgent_; }; - } // namespace NotificationNapi } // namespace OHOS diff --git a/interfaces/kits/napi/ans/include/constant.h b/interfaces/kits/napi/ans/include/constant.h index 96cb86f39fc5dde31fcaf306f41df34b8ce1732c..5eb46c17f2c8df0162c99586be4007d3fe9d77a4 100644 --- a/interfaces/kits/napi/ans/include/constant.h +++ b/interfaces/kits/napi/ans/include/constant.h @@ -32,7 +32,6 @@ napi_value InputEditTypeInit(napi_env env, napi_value exports); napi_value ContentTypeInit(napi_env env, napi_value exports); napi_value DoNotDisturbTypeInit(napi_env env, napi_value exports); napi_value ConstantInit(napi_env env, napi_value exports); - } // namespace NotificationNapi } // namespace OHOS diff --git a/interfaces/kits/napi/ans/include/display_badge.h b/interfaces/kits/napi/ans/include/display_badge.h index 945543193b1a9beb9cd79442466f9f2f60546992..992a41deefeb54bd9a820430669fe1cbf86e050c 100644 --- a/interfaces/kits/napi/ans/include/display_badge.h +++ b/interfaces/kits/napi/ans/include/display_badge.h @@ -23,7 +23,6 @@ using namespace OHOS::Notification; napi_value DisplayBadge(napi_env env, napi_callback_info info); napi_value IsBadgeDisplayed(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_DISPLAY_BADGE_H \ No newline at end of file diff --git a/interfaces/kits/napi/ans/include/disturb_mode.h b/interfaces/kits/napi/ans/include/disturb_mode.h index 5b86d6eec429d006cfe3e7f7ec271ef81651ea3a..3a2d668bbf06c6576f18678c8c74c93334f0f0f7 100644 --- a/interfaces/kits/napi/ans/include/disturb_mode.h +++ b/interfaces/kits/napi/ans/include/disturb_mode.h @@ -24,7 +24,6 @@ using namespace OHOS::Notification; napi_value SetDoNotDisturbDate(napi_env env, napi_callback_info info); napi_value GetDoNotDisturbDate(napi_env env, napi_callback_info info); napi_value SupportDoNotDisturbMode(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_DISTURB_MODE_H \ No newline at end of file diff --git a/interfaces/kits/napi/ans/include/enable_notification.h b/interfaces/kits/napi/ans/include/enable_notification.h index e7ae306486c5be506303458a24f219c07b754f23..d96094539a89f199ba1cb470c9f2df6f2b5ef006 100644 --- a/interfaces/kits/napi/ans/include/enable_notification.h +++ b/interfaces/kits/napi/ans/include/enable_notification.h @@ -23,7 +23,6 @@ using namespace OHOS::Notification; napi_value EnableNotification(napi_env env, napi_callback_info info); napi_value IsNotificationEnabled(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_ENABLE_NOTIFICATION_H \ No newline at end of file diff --git a/interfaces/kits/napi/ans/include/get_active.h b/interfaces/kits/napi/ans/include/get_active.h index 867eef8b07962545cf189cc51722c3dde9eb80ea..37865304ad27123aa2b837242fbc1ee34de85599 100644 --- a/interfaces/kits/napi/ans/include/get_active.h +++ b/interfaces/kits/napi/ans/include/get_active.h @@ -25,7 +25,6 @@ using namespace OHOS::Notification; napi_value GetAllActiveNotifications(napi_env env, napi_callback_info info); napi_value GetActiveNotifications(napi_env env, napi_callback_info info); napi_value GetActiveNotificationCount(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS diff --git a/interfaces/kits/napi/ans/include/init.h b/interfaces/kits/napi/ans/include/init.h index fabae8a06626e8624dda17b9c8fe957cca20971a..d8306a6643e2342d93e2bffa6ee0611658321d70 100644 --- a/interfaces/kits/napi/ans/include/init.h +++ b/interfaces/kits/napi/ans/include/init.h @@ -46,7 +46,6 @@ napi_module _module = { .reserved = {0} }; - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_INIT_H diff --git a/interfaces/kits/napi/ans/include/publish.h b/interfaces/kits/napi/ans/include/publish.h index a288687b928cf2cbc8282ac5bd102810abca23da..2f64e25b9b84eeb60943ec630809cb727359ac1f 100644 --- a/interfaces/kits/napi/ans/include/publish.h +++ b/interfaces/kits/napi/ans/include/publish.h @@ -21,9 +21,7 @@ namespace OHOS { namespace NotificationNapi { using namespace OHOS::Notification; - napi_value Publish(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_PUBLISH_H \ No newline at end of file diff --git a/interfaces/kits/napi/ans/include/remove.h b/interfaces/kits/napi/ans/include/remove.h index fddba9010c3cfad8a98dd16c678493213fc09458..56bc61c2c226d3cdd8b8c0eba01f6839ca9d7309 100644 --- a/interfaces/kits/napi/ans/include/remove.h +++ b/interfaces/kits/napi/ans/include/remove.h @@ -26,7 +26,6 @@ napi_value Remove(napi_env env, napi_callback_info info); napi_value RemoveAsBundle(napi_env env, napi_callback_info info); napi_value RemoveAll(napi_env env, napi_callback_info info); napi_value RemoveGroupByBundle(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_REMOVE_H \ No newline at end of file diff --git a/interfaces/kits/napi/ans/include/slot.h b/interfaces/kits/napi/ans/include/slot.h index e4e03749a6a641f4fe5cfd39ff193d5af548d46c..d7aaca4d26f0b899668c6e616abe185e0f4223a0 100644 --- a/interfaces/kits/napi/ans/include/slot.h +++ b/interfaces/kits/napi/ans/include/slot.h @@ -30,7 +30,6 @@ napi_value GetSlots(napi_env env, napi_callback_info info); napi_value GetSlotsByBundle(napi_env env, napi_callback_info info); napi_value RemoveSlot(napi_env env, napi_callback_info info); napi_value RemoveAllSlots(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS diff --git a/interfaces/kits/napi/ans/include/subscribe.h b/interfaces/kits/napi/ans/include/subscribe.h index 08c0df5e32db343c65296d6cadb63ed81c1d36c1..b18e1de4b0bc547caf963db874b64bed9d702eae 100644 --- a/interfaces/kits/napi/ans/include/subscribe.h +++ b/interfaces/kits/napi/ans/include/subscribe.h @@ -80,7 +80,6 @@ private: CallbackInfo dieCallbackInfo_; CallbackInfo disturbModeCallbackInfo_; CallbackInfo disturbDateCallbackInfo_; - }; struct SubscriberInstancesInfo { @@ -96,7 +95,6 @@ bool AddSubscriberInstancesInfo(const napi_env &env, const SubscriberInstancesIn bool DelSubscriberInstancesInfo(const napi_env &env, SubscriberInstance *subscriber); napi_value Subscribe(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_SUBSCRIBE_H \ No newline at end of file diff --git a/interfaces/kits/napi/ans/include/unsubscribe.h b/interfaces/kits/napi/ans/include/unsubscribe.h index 595de743b7f07909e92fd0bbbe89227524f2f3af..2751b461b28b4958c62775cda6deabb88c919aac 100644 --- a/interfaces/kits/napi/ans/include/unsubscribe.h +++ b/interfaces/kits/napi/ans/include/unsubscribe.h @@ -21,7 +21,6 @@ namespace OHOS { namespace NotificationNapi { using namespace OHOS::Notification; - napi_value Unsubscribe(napi_env env, napi_callback_info info); } // namespace NotificationNapi diff --git a/interfaces/kits/napi/ans/src/cancel.cpp b/interfaces/kits/napi/ans/src/cancel.cpp index 0ba7a4461ef82bc3778b57b7c09e77591c6fc485..1632d1fc2c56b88712e004fe9ada291eb9592af0 100644 --- a/interfaces/kits/napi/ans/src/cancel.cpp +++ b/interfaces/kits/napi/ans/src/cancel.cpp @@ -289,6 +289,5 @@ napi_value CancelGroup(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/display_badge.cpp b/interfaces/kits/napi/ans/src/display_badge.cpp index 889fd7842deba7f8cb35af9e9a515133c523a7f1..214b87bb679553c3e9dd33282203ba754ed3ca46 100644 --- a/interfaces/kits/napi/ans/src/display_badge.cpp +++ b/interfaces/kits/napi/ans/src/display_badge.cpp @@ -260,6 +260,5 @@ napi_value IsBadgeDisplayed(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/disturb_mode.cpp b/interfaces/kits/napi/ans/src/disturb_mode.cpp index 2c261ebe820ec46d3f83e1a10373a639b09be496..d9b056f8606d4196bcccf831a14d0bb9a7b51df2 100644 --- a/interfaces/kits/napi/ans/src/disturb_mode.cpp +++ b/interfaces/kits/napi/ans/src/disturb_mode.cpp @@ -316,6 +316,5 @@ napi_value SupportDoNotDisturbMode(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/enable_notification.cpp b/interfaces/kits/napi/ans/src/enable_notification.cpp index b350df6c0a310bb2e048af081579f416bc7c0d4a..f0d943a437db08e3b4ac1f6edbbaf93c3e260d06 100644 --- a/interfaces/kits/napi/ans/src/enable_notification.cpp +++ b/interfaces/kits/napi/ans/src/enable_notification.cpp @@ -257,6 +257,5 @@ napi_value IsNotificationEnabled(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/init.cpp b/interfaces/kits/napi/ans/src/init.cpp index 358865aa343748fc6164c7005f42810a1c58942c..2a27497cb543604e9c78bb575343b2f0192799fa 100644 --- a/interfaces/kits/napi/ans/src/init.cpp +++ b/interfaces/kits/napi/ans/src/init.cpp @@ -96,6 +96,5 @@ __attribute__((constructor)) void RegisterModule(void) napi_module_register(&_module); } EXTERN_C_END - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/slot.cpp b/interfaces/kits/napi/ans/src/slot.cpp index faa723f516217330d13a1622121faf4eebd69af3..15d0156b52fdb49b322f20021e8b323ac1a8a93c 100644 --- a/interfaces/kits/napi/ans/src/slot.cpp +++ b/interfaces/kits/napi/ans/src/slot.cpp @@ -978,6 +978,5 @@ napi_value RemoveAllSlots(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/subscribe.cpp b/interfaces/kits/napi/ans/src/subscribe.cpp index 4056542cf186df85f83f758ed58e1e10722ee6b7..d35db62904b49398c642e7e3143e4e29894028fc 100644 --- a/interfaces/kits/napi/ans/src/subscribe.cpp +++ b/interfaces/kits/napi/ans/src/subscribe.cpp @@ -1083,6 +1083,5 @@ napi_value Subscribe(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/ans/src/unsubscribe.cpp b/interfaces/kits/napi/ans/src/unsubscribe.cpp index a8b188eeb6b89721c214b3d63a916ee5b17339e3..bd500e332483dde4d26846a4d15bc255a9caf113 100644 --- a/interfaces/kits/napi/ans/src/unsubscribe.cpp +++ b/interfaces/kits/napi/ans/src/unsubscribe.cpp @@ -130,6 +130,5 @@ napi_value Unsubscribe(napi_env env, napi_callback_info info) return promise; } } - } // namespace NotificationNapi } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/napi/wantagent/napi_want_agent.cpp b/interfaces/kits/napi/wantagent/napi_want_agent.cpp index 727f54fcbac8eb511c6e4e4d3783b33725d5c091..1d7fa5f792e2dd9600a6dd204bdb45faa8ebfb1b 100644 --- a/interfaces/kits/napi/wantagent/napi_want_agent.cpp +++ b/interfaces/kits/napi/wantagent/napi_want_agent.cpp @@ -15,8 +15,8 @@ #include "napi_want_agent.h" -#include -#include +#include +#include #include #include @@ -330,7 +330,7 @@ napi_value NAPI_GetBundleName(napi_env env, napi_callback_info info) NAPI_ASSERT_RETURN_NULL(env, valuetype == napi_function, "Wrong argument type. Function expected."); callBackMode = true; } - AsyncGetBundleNameCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetBundleNameCallbackInfo{ + AsyncGetBundleNameCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetBundleNameCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, @@ -454,7 +454,7 @@ napi_value NAPI_GetUid(napi_env env, napi_callback_info info) NAPI_ASSERT_RETURN_NULL(env, valuetype == napi_function, "Wrong argument type. Function expected."); callBackMode = true; } - AsyncGetUidCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetUidCallbackInfo{ + AsyncGetUidCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetUidCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, @@ -576,7 +576,7 @@ napi_value NAPI_GetWant(napi_env env, napi_callback_info info) NAPI_ASSERT_RETURN_NULL(env, valuetype == napi_function, "Wrong argument type. Function expected."); callBackMode = true; } - AsyncGetWantCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetWantCallbackInfo{ + AsyncGetWantCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetWantCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, @@ -716,7 +716,7 @@ napi_value NAPI_Cancel(napi_env env, napi_callback_info info) NAPI_ASSERT_RETURN_NULL(env, valuetype == napi_function, "Wrong argument type. Function expected."); callBackMode = true; } - AsyncCancelCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncCancelCallbackInfo{ + AsyncCancelCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncCancelCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, @@ -862,7 +862,7 @@ napi_value NAPI_Trigger(napi_env env, napi_callback_info info) return NapiGetNull(env); } - AsyncTriggerCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncTriggerCallbackInfo{ + AsyncTriggerCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncTriggerCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, @@ -1002,7 +1002,7 @@ napi_value NAPI_Equal(napi_env env, napi_callback_info info) NAPI_ASSERT_RETURN_NULL(env, valuetype == napi_function, "Wrong argument type. Function expected."); callBackMode = true; } - AsyncEqualCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncEqualCallbackInfo{ + AsyncEqualCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncEqualCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, @@ -1254,7 +1254,7 @@ napi_value NAPI_GetWantAgent(napi_env env, napi_callback_info info) callBackMode = true; } - AsyncGetWantAgentCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetWantAgentCallbackInfo{ + AsyncGetWantAgentCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncGetWantAgentCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, diff --git a/interfaces/kits/napi/wantagent/native_module.cpp b/interfaces/kits/napi/wantagent/native_module.cpp index 0177c32c6cfb67d60cce620ccc660bd8da784a02..f4474a384bc9d96c11bce2005773ae619d2c939e 100644 --- a/interfaces/kits/napi/wantagent/native_module.cpp +++ b/interfaces/kits/napi/wantagent/native_module.cpp @@ -14,8 +14,8 @@ */ #include -#include -#include +#include +#include #include #include "napi_want_agent.h" diff --git a/services/ans/include/advanced_notification_service.h b/services/ans/include/advanced_notification_service.h index 176224efaf837d9831416eacb123012bf52ba8ec..95214c02cb979749253cb10252c0cc128d12e48a 100644 --- a/services/ans/include/advanced_notification_service.h +++ b/services/ans/include/advanced_notification_service.h @@ -36,7 +36,6 @@ namespace OHOS { namespace Notification { - class AdvancedNotificationService final : public AnsManagerStub { public: ~AdvancedNotificationService() override; @@ -165,7 +164,6 @@ private: std::shared_ptr systemEventObserver_ = nullptr; DistributedKv::DistributedKvDataManager dataManager_; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/advanced_notification_service_ability.h b/services/ans/include/advanced_notification_service_ability.h index 10f8ac311f8f895412713a166e8aed543a632338..ec5c866d8169672394e40ff6507a2da72a8a1df4 100644 --- a/services/ans/include/advanced_notification_service_ability.h +++ b/services/ans/include/advanced_notification_service_ability.h @@ -23,7 +23,6 @@ namespace OHOS { namespace Notification { - class AdvancedNotificationServiceAbility final : public SystemAbility { public: AdvancedNotificationServiceAbility(const int32_t systemAbilityId, bool runOnCreate); @@ -38,7 +37,6 @@ private: private: sptr service_; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/bundle_manager_helper.h b/services/ans/include/bundle_manager_helper.h index bb8dc8169f727c85d7c76cd9043379b08c466d73..ab4fb0ca9dc8035007ed18eb6323f721f79fed59 100644 --- a/services/ans/include/bundle_manager_helper.h +++ b/services/ans/include/bundle_manager_helper.h @@ -29,7 +29,6 @@ namespace OHOS { namespace Notification { - class BundleManagerHelper : public DelayedSingleton { public: std::string GetBundleNameByUid(int uid); @@ -49,7 +48,6 @@ private: DECLARE_DELAYED_SINGLETON(BundleManagerHelper) }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/distributed_kvstore_death_recipient.h b/services/ans/include/distributed_kvstore_death_recipient.h index d5960480143d54ad5727d664162023f7ccdd2429..a023318892e01241f667bc2fddcaa37746b13bb5 100644 --- a/services/ans/include/distributed_kvstore_death_recipient.h +++ b/services/ans/include/distributed_kvstore_death_recipient.h @@ -22,7 +22,6 @@ namespace OHOS { namespace Notification { - class DistributedKvStoreDeathRecipient : public DistributedKv::KvStoreDeathRecipient { public: DistributedKvStoreDeathRecipient(const std::function &callback) @@ -43,7 +42,6 @@ public: private: std::function callback_; }; - } // namespace Notification } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_SERVICES_ANS_INCLUDE_DISTRIBUTED_KVSTORE_DEATH_RECIPIENT_H \ No newline at end of file diff --git a/services/ans/include/disturb_filter.h b/services/ans/include/disturb_filter.h index 3a28a324da96ec5d9eac6a96c9201fa744bfdb9e..84c4846bb698bafec1651af375eb4abbcf9c2bf3 100644 --- a/services/ans/include/disturb_filter.h +++ b/services/ans/include/disturb_filter.h @@ -20,11 +20,10 @@ namespace OHOS { namespace Notification { - class DisturbFilter : public INotificationFilter { public: - DisturbFilter(){}; - ~DisturbFilter(){}; + DisturbFilter() {}; + ~DisturbFilter() {}; void OnStart() override; void OnStop() override; @@ -34,7 +33,6 @@ public: private: void GetTimeInterval(int64_t &beginDate, int64_t &endDate); }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/interface_system_event.h b/services/ans/include/interface_system_event.h index b4aba38fcbc2d2b0886146ae80adae52b53b7b4c..bc3b8f4adc1c56edfb9d6ce39dd695d086888398 100644 --- a/services/ans/include/interface_system_event.h +++ b/services/ans/include/interface_system_event.h @@ -23,11 +23,9 @@ namespace OHOS { namespace Notification { - struct ISystemEvent { std::function &)> onBundleRemoved; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/notification_filter.h b/services/ans/include/notification_filter.h index 30dc7b90205adf2f8ce107c7d51e8ba19574db0e..4c229109e32e821e8895c07f879e21aff5490c91 100644 --- a/services/ans/include/notification_filter.h +++ b/services/ans/include/notification_filter.h @@ -24,18 +24,16 @@ namespace OHOS { namespace Notification { - class INotificationFilter { public: - INotificationFilter(){}; - virtual ~INotificationFilter(){}; + INotificationFilter() {}; + virtual ~INotificationFilter() {}; virtual void OnStart() = 0; virtual void OnStop() = 0; virtual ErrCode OnPublish(const std::shared_ptr &record) = 0; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/notification_preferences_database.h b/services/ans/include/notification_preferences_database.h index d037fe4718fc08c45d9c067d33f8e1c1fba6c33b..0787c62f255d9a29452e43bcd8bb17351814a292 100644 --- a/services/ans/include/notification_preferences_database.h +++ b/services/ans/include/notification_preferences_database.h @@ -24,7 +24,6 @@ namespace OHOS { namespace Notification { - class NotificationPreferencesDatabase final { public: NotificationPreferencesDatabase(); @@ -142,7 +141,6 @@ private: std::shared_ptr kvStorePtr_ = nullptr; DistributedKv::DistributedKvDataManager dataManager_; }; - } // namespace Notification } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_SERVICES_NOTIFICATION_PREFERENCES_DATABASE_H \ No newline at end of file diff --git a/services/ans/include/notification_record.h b/services/ans/include/notification_record.h index f41e65faf8544b23d92ee845e964744b9712207d..12b541336f369db98f29252d16180808d07cf519 100644 --- a/services/ans/include/notification_record.h +++ b/services/ans/include/notification_record.h @@ -25,14 +25,12 @@ namespace OHOS { namespace Notification { - struct NotificationRecord { sptr bundleOption; sptr request; sptr notification; sptr slot; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/notification_slot_filter.h b/services/ans/include/notification_slot_filter.h index 45092a2bc17a5b32e160ef01f914003d5941b3d4..3b8978c2c581b2bf23b61f427beab1087c4aebd9 100644 --- a/services/ans/include/notification_slot_filter.h +++ b/services/ans/include/notification_slot_filter.h @@ -20,18 +20,16 @@ namespace OHOS { namespace Notification { - class NotificationSlotFilter : public INotificationFilter { public: - NotificationSlotFilter(){}; - ~NotificationSlotFilter(){}; + NotificationSlotFilter() {}; + ~NotificationSlotFilter() {}; void OnStart() override; void OnStop() override; ErrCode OnPublish(const std::shared_ptr &record) override; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/notification_subscriber_manager.h b/services/ans/include/notification_subscriber_manager.h index ea96bfa6b60cc37102b409dec50e56c2b9f4606c..477acb7476a591ed14c781cfa3bcbf00b240f827 100644 --- a/services/ans/include/notification_subscriber_manager.h +++ b/services/ans/include/notification_subscriber_manager.h @@ -79,7 +79,6 @@ private: DECLARE_DELAYED_SINGLETON(NotificationSubscriberManager); DISALLOW_COPY_AND_MOVE(NotificationSubscriberManager); }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/permission_filter.h b/services/ans/include/permission_filter.h index 850069cc8ce2a7a2425fda46887324b1246ae541..f0610279d9ec938eeea5cd8f70484eb3b922af14 100644 --- a/services/ans/include/permission_filter.h +++ b/services/ans/include/permission_filter.h @@ -20,18 +20,16 @@ namespace OHOS { namespace Notification { - class PermissionFilter : public INotificationFilter { public: - PermissionFilter(){}; - ~PermissionFilter(){}; + PermissionFilter() {}; + ~PermissionFilter() {}; void OnStart() override; void OnStop() override; ErrCode OnPublish(const std::shared_ptr &record) override; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/preferences_constant.h b/services/ans/include/preferences_constant.h index f4ced936203431f12af08002c31f7aa6406eccd4..64419b6535b857ca8ea830be59cd2ebe655b7079 100644 --- a/services/ans/include/preferences_constant.h +++ b/services/ans/include/preferences_constant.h @@ -18,7 +18,6 @@ namespace OHOS { namespace Notification { - const static std::string KEY_DO_NOT_DISTURB_TYPE = "ans_doNotDisturbType"; const static std::string KEY_DO_NOT_DISTURB_BEGIN_DATE = "ans_doNotDisturbBeginDate"; const static std::string KEY_DO_NOT_DISTURB_END_DATE = "ans_doNotDisturbEndDate"; @@ -74,7 +73,6 @@ enum class BundleType { BUNDLE_PRIVATE_ALLOWED_TYPE, BUNDLE_ENABLE_NOTIFICATION_TYPE, }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/remote_death_recipient.h b/services/ans/include/remote_death_recipient.h index 400dfd58d209d710ebe01f1a765d70c176f184c7..ea52d41e60ef0fbeaf0378b823a560d83e72d654 100644 --- a/services/ans/include/remote_death_recipient.h +++ b/services/ans/include/remote_death_recipient.h @@ -12,18 +12,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef BASE_NOTIFICATION_ANS_STANDARD_SERVICES_ANS_INCLUDE_REMOTE_DEATH_RECIPIENT_H +#define BASE_NOTIFICATION_ANS_STANDARD_SERVICES_ANS_INCLUDE_REMOTE_DEATH_RECIPIENT_H #include #include "iremote_object.h" #include "refbase.h" -#ifndef BASE_NOTIFICATION_ANS_STANDARD_SERVICES_ANS_INCLUDE_REMOTE_DEATH_RECIPIENT_H -#define BASE_NOTIFICATION_ANS_STANDARD_SERVICES_ANS_INCLUDE_REMOTE_DEATH_RECIPIENT_H - namespace OHOS { namespace Notification { - class RemoteDeathRecipient : public IRemoteObject::DeathRecipient { public: RemoteDeathRecipient(std::function &)> callback) @@ -46,7 +44,6 @@ public: private: std::function &)> callback_; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/system_event_observer.h b/services/ans/include/system_event_observer.h index 7fc8cd4fece62a6763e06ce43474d0b955e55552..8e4be393ced9195a474136d928a9035ae3b60dcb 100644 --- a/services/ans/include/system_event_observer.h +++ b/services/ans/include/system_event_observer.h @@ -26,7 +26,6 @@ namespace OHOS { namespace Notification { - class SystemEventObserver { public: SystemEventObserver(const ISystemEvent& callbacks); @@ -39,7 +38,6 @@ private: std::shared_ptr subscriber_ = nullptr; ISystemEvent callbacks_; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/include/system_event_subscriber.h b/services/ans/include/system_event_subscriber.h index 41b58c48db1f91ffe03ad44bdd576be7f300204c..593f92b8bb6c7386a0f06251a78ee3627f4778f9 100644 --- a/services/ans/include/system_event_subscriber.h +++ b/services/ans/include/system_event_subscriber.h @@ -22,7 +22,6 @@ namespace OHOS { namespace Notification { - class SystemEventSubscriber : public EventFwk::CommonEventSubscriber { public: SystemEventSubscriber(const EventFwk::CommonEventSubscribeInfo &subscribeInfo, @@ -43,7 +42,6 @@ public: private: std::function callback_; }; - } // namespace Notification } // namespace OHOS diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 3deb150f6fdf3692455eb2926a97c59e657cb3bf..1af9f662934d155e0941a4db4e7294abe6fcac30 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -34,7 +34,6 @@ namespace OHOS { namespace Notification { - namespace { static const std::string ACTIVE_NOTIFICATION_OPTION = "active"; static const std::string RECENT_NOTIFICATION_OPTION = "recent"; diff --git a/services/ans/src/advanced_notification_service_ability.cpp b/services/ans/src/advanced_notification_service_ability.cpp index f361f3d16dd85ace767b35d953c3838444d5afe4..56f052fb8b4cf0c10e32d58b47c6ebed42223f8d 100644 --- a/services/ans/src/advanced_notification_service_ability.cpp +++ b/services/ans/src/advanced_notification_service_ability.cpp @@ -17,7 +17,6 @@ namespace OHOS { namespace Notification { - namespace { REGISTER_SYSTEM_ABILITY_BY_ID(AdvancedNotificationServiceAbility, ADVANCED_NOTIFICATION_SERVICE_ABILITY_ID, true); } @@ -45,6 +44,5 @@ void AdvancedNotificationServiceAbility::OnStop() { service_ = nullptr; } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/src/bundle_manager_helper.cpp b/services/ans/src/bundle_manager_helper.cpp index a02c7f20a7cf1b6ad36e34733a4db79c67b03f0d..c5485263ed049c10847aa02809d38b7f4c22995d 100644 --- a/services/ans/src/bundle_manager_helper.cpp +++ b/services/ans/src/bundle_manager_helper.cpp @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - BundleManagerHelper::BundleManagerHelper() { deathRecipient_ = @@ -118,6 +117,5 @@ int BundleManagerHelper::GetDefaultUidByBundleName(const std::string& bundle) return uid; } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/src/notification_preferences.cpp b/services/ans/src/notification_preferences.cpp index dcf3080158dd0a3463445600b131ffd3dd1974dc..04c2ce8d6124d51a02aff3aa09b937d2ed8ab5c2 100644 --- a/services/ans/src/notification_preferences.cpp +++ b/services/ans/src/notification_preferences.cpp @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - NotificationPreferences::NotificationPreferences() { preferncesDB_ = std::make_unique(); @@ -39,7 +38,6 @@ NotificationPreferences &NotificationPreferences::GetInstance() ErrCode NotificationPreferences::AddNotificationSlots( const sptr &bundleOption, const std::vector> &slots) { - ANS_LOGD("%{public}s", __FUNCTION__); if (bundleOption == nullptr || bundleOption->GetBundleName().empty() || slots.empty()) { return ERR_ANS_INVALID_PARAM; @@ -119,7 +117,6 @@ ErrCode NotificationPreferences::RemoveNotificationSlot( NotificationPreferencesInfo preferencesInfo = preferencesInfo_; ErrCode result = ERR_OK; result = CheckSlotForRemoveSlot(bundleOption, slotType, preferencesInfo); - if (result == ERR_OK && (!preferncesDB_->RemoveSlotFromDisturbeDB(GenerateBundleKey(bundleOption), slotType))) { return ERR_ANS_PREFERENCES_NOTIFICATION_DB_OPERATION_FAILED; } @@ -237,7 +234,6 @@ ErrCode NotificationPreferences::UpdateNotificationSlots( ErrCode NotificationPreferences::UpdateNotificationSlotGroups( const sptr &bundleOption, const std::vector> &groups) { - ANS_LOGD("%{public}s", __FUNCTION__); if (bundleOption == nullptr || bundleOption->GetBundleName().empty() || groups.empty()) { return ERR_ANS_INVALID_PARAM; @@ -484,7 +480,6 @@ ErrCode NotificationPreferences::SetNotificationsEnabledForBundle( NotificationPreferencesInfo preferencesInfo = preferencesInfo_; ErrCode result = SetBundleProperty(preferencesInfo, bundleOption, BundleType::BUNDLE_ENABLE_NOTIFICATION_TYPE, enabled); - if (result == ERR_OK) { preferencesInfo_ = preferencesInfo; } @@ -778,6 +773,5 @@ void NotificationPreferences::OnDistributedKvStoreDeathRecipient() } } } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/src/notification_preferences_database.cpp b/services/ans/src/notification_preferences_database.cpp index a839e1440b3017e446e1343e691dfca4ad3209e3..54c5a1e5402796abd64c5d94cd45fb9ac100b821 100644 --- a/services/ans/src/notification_preferences_database.cpp +++ b/services/ans/src/notification_preferences_database.cpp @@ -14,16 +14,12 @@ */ #include "notification_preferences_database.h" -#include -#include -#include #include "ans_log_wrapper.h" #include "uri.h" namespace OHOS { namespace Notification { - const std::map &, std::string &)>> NotificationPreferencesDatabase::slotMap_ = { diff --git a/services/ans/src/notification_preferences_info.cpp b/services/ans/src/notification_preferences_info.cpp index 539035fb81ac5bc157df856499bacf78fba6b0cd..f58a968b7ba62b7c712d208c2d324082888cdfd8 100644 --- a/services/ans/src/notification_preferences_info.cpp +++ b/services/ans/src/notification_preferences_info.cpp @@ -16,7 +16,6 @@ namespace OHOS { namespace Notification { - NotificationPreferencesInfo::BundleInfo::BundleInfo() {} NotificationPreferencesInfo::BundleInfo::~BundleInfo() @@ -291,6 +290,5 @@ void NotificationPreferencesInfo::ClearBundleInfo() { infos_.clear(); } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/src/notification_slot_filter.cpp b/services/ans/src/notification_slot_filter.cpp index d59d1d181ee1fbf38621f09547dd0c1dbb3066f7..9b4c59e6dc9bc00b3f4de75f86f22d73978e752d 100644 --- a/services/ans/src/notification_slot_filter.cpp +++ b/services/ans/src/notification_slot_filter.cpp @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - void NotificationSlotFilter::OnStart() {} @@ -63,6 +62,5 @@ ErrCode NotificationSlotFilter::OnPublish(const std::shared_ptr subscriber {nullptr}; std::set bundleList_ {}; diff --git a/services/ans/src/permission_filter.cpp b/services/ans/src/permission_filter.cpp index d66946c6c9b92638229969941dca7ead26920e74..9c4a86870cd4a44666ca1c5e5c6b6239bd639618 100644 --- a/services/ans/src/permission_filter.cpp +++ b/services/ans/src/permission_filter.cpp @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - void PermissionFilter::OnStart() {} @@ -49,6 +48,5 @@ ErrCode PermissionFilter::OnPublish(const std::shared_ptr &r } return result; } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/src/system_event_observer.cpp b/services/ans/src/system_event_observer.cpp index 959e85f80e9dbf9c559497a5259ff22ad50636f9..c87a77748f8e91b964507ccc7580aff7545ce799 100644 --- a/services/ans/src/system_event_observer.cpp +++ b/services/ans/src/system_event_observer.cpp @@ -21,7 +21,6 @@ namespace OHOS { namespace Notification { - SystemEventObserver::SystemEventObserver(const ISystemEvent &callbacks) : callbacks_(callbacks) { EventFwk::MatchingSkills matchingSkills; @@ -53,6 +52,5 @@ void SystemEventObserver::OnReceiveEvent(const EventFwk::CommonEventData &data) } } } - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/test/unittest/advanced_notification_service_ability_test.cpp b/services/ans/test/unittest/advanced_notification_service_ability_test.cpp index e447dec8c46538a5c1a4366922797e5b3752b4ad..fce488e4deb216ecf38d0bedb7b53cd15aace5ad 100644 --- a/services/ans/test/unittest/advanced_notification_service_ability_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_ability_test.cpp @@ -22,13 +22,12 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class AdvancedNotificationServiceAbilityTest : public testing::Test { public: - static void SetUpTestCase(){}; - static void TearDownTestCase(){}; - void SetUp(){}; - void TearDown(){}; + static void SetUpTestCase() {}; + static void TearDownTestCase() {}; + void SetUp() {}; + void TearDown() {}; }; /** @@ -43,6 +42,5 @@ HWTEST_F( bool runOnCreate = true; AdvancedNotificationServiceAbility(systemAbilityId, runOnCreate); } - } // namespace Notification } // namespace OHOS diff --git a/services/ans/test/unittest/bundle_manager_helper_test.cpp b/services/ans/test/unittest/bundle_manager_helper_test.cpp index dc710dad0bbe0c0860b3a3862015c6139fe972ea..4cde76e92036d47a6ae466ccd74a5c9c11a8cca1 100644 --- a/services/ans/test/unittest/bundle_manager_helper_test.cpp +++ b/services/ans/test/unittest/bundle_manager_helper_test.cpp @@ -25,13 +25,12 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class BundleManagerHelperTest : public testing::Test { public: - static void SetUpTestCase(){}; - static void TearDownTestCase(){}; - void SetUp(){}; - void TearDown(){}; + static void SetUpTestCase() {}; + static void TearDownTestCase() {}; + void SetUp() {}; + void TearDown() {}; }; /** diff --git a/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp b/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp index efde9364abf099b910403f6fb44b7e646bb97663..0d454850b26a4d203d3766df6b63a7bc524e0067 100644 --- a/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp +++ b/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp @@ -22,7 +22,6 @@ namespace OHOS { namespace Notification { - BundleManagerHelper::BundleManagerHelper() {} @@ -46,12 +45,10 @@ bool BundleManagerHelper::IsSystemApp(int uid) { return (uid == SYSTEM_APP_UID); } - void BundleManagerHelper::Connect() {} void BundleManagerHelper::Disconnect() {} - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/ans/test/unittest/mock/mock_event_handler.cpp b/services/ans/test/unittest/mock/mock_event_handler.cpp index 12a7f65b9d4e00f3c9c65a4a8668e162960cb723..bdadec57f26576acc46f36a40b3fe23500357140 100644 --- a/services/ans/test/unittest/mock/mock_event_handler.cpp +++ b/services/ans/test/unittest/mock/mock_event_handler.cpp @@ -15,11 +15,9 @@ #include "event_handler.h" #include "event_handler_utils.h" -#include namespace OHOS { namespace AppExecFwk { - std::shared_ptr EventHandler::Current() { const std::weak_ptr &wp = std::make_shared(EventRunner::Create(true)); diff --git a/services/ans/test/unittest/notification_preferences_database_test.cpp b/services/ans/test/unittest/notification_preferences_database_test.cpp index 6cb5f7743cca916a72244f025dbc542147dee9d7..b294f18e74bf7b02abbf99326214ccc9b404e36d 100644 --- a/services/ans/test/unittest/notification_preferences_database_test.cpp +++ b/services/ans/test/unittest/notification_preferences_database_test.cpp @@ -21,13 +21,12 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class NotificationPreferencesDatabaseTest : public testing::Test { public: - static void SetUpTestCase(){}; - static void TearDownTestCase(){}; - void SetUp(){}; - void TearDown(){}; + static void SetUpTestCase() {}; + static void TearDownTestCase() {}; + void SetUp() {}; + void TearDown() {}; const std::string bundleName_ = "bundleName"; std::unique_ptr preferncesDB_ = @@ -173,7 +172,6 @@ HWTEST_F(NotificationPreferencesDatabaseTest, PutImportance_00200, Function | Sm */ HWTEST_F(NotificationPreferencesDatabaseTest, PutTotalBadgeNums_00100, Function | SmallTest | Level1) { - EXPECT_TRUE(preferncesDB_->PutTotalBadgeNums(bundleName_, 0)); } @@ -456,7 +454,6 @@ HWTEST_F(NotificationPreferencesDatabaseTest, CheckKvStore_00100, Function | Sma */ HWTEST_F(NotificationPreferencesDatabaseTest, PutBundlePropertyValueToDisturbeDB_00100, Function | SmallTest | Level1) { - NotificationPreferencesInfo::BundleInfo info; EXPECT_EQ(true, preferncesDB_->PutBundlePropertyValueToDisturbeDB(info)); } @@ -494,6 +491,5 @@ HWTEST_F(NotificationPreferencesDatabaseTest, CheckBundle_00100, Function | Smal { EXPECT_EQ(true, preferncesDB_->CheckBundle(bundleName_)); } - } // namespace Notification } // namespace OHOS diff --git a/services/ans/test/unittest/notification_preferences_test.cpp b/services/ans/test/unittest/notification_preferences_test.cpp index 6c535345989002a4e07b5a3e184edc9395f7b360..f1ec114e4ba29a4e1e2055d39d392bbb81503cd4 100644 --- a/services/ans/test/unittest/notification_preferences_test.cpp +++ b/services/ans/test/unittest/notification_preferences_test.cpp @@ -22,12 +22,11 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class NotificationPreferencesTest : public testing::Test { public: - static void SetUpTestCase(){}; - static void TearDownTestCase(){}; - void SetUp(){}; + static void SetUpTestCase() {}; + static void TearDownTestCase() {}; + void SetUp() {}; void TearDown(); void TestAddNotificationSlot(); @@ -127,7 +126,6 @@ HWTEST_F(NotificationPreferencesTest, AddNotificationSlots_00400, Function | Sma */ HWTEST_F(NotificationPreferencesTest, AddNotificationSlots_00500, Function | SmallTest | Level1) { - sptr slot1 = new NotificationSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION); sptr slot2 = new NotificationSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION); diff --git a/services/ans/test/unittest/notification_slot_filter_test.cpp b/services/ans/test/unittest/notification_slot_filter_test.cpp index 15e72a01eaa691c015842a11293d96dbdb5d0001..7cc73fa00702dd8767f0aca584dab062815b25ab 100644 --- a/services/ans/test/unittest/notification_slot_filter_test.cpp +++ b/services/ans/test/unittest/notification_slot_filter_test.cpp @@ -21,13 +21,12 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class NotificationSlotFilterTest : public testing::Test { public: - static void SetUpTestCase(){}; - static void TearDownTestCase(){}; - void SetUp(){}; - void TearDown(){}; + static void SetUpTestCase() {}; + static void TearDownTestCase() {}; + void SetUp() {}; + void TearDown() {}; }; /** diff --git a/services/ans/test/unittest/notification_subscriber_manager_test.cpp b/services/ans/test/unittest/notification_subscriber_manager_test.cpp index 6ce1eee9981d3310a3a0e9417dee5706f8e135b1..eb8d6f743b304b824deb98ca8738bc223a9594dd 100644 --- a/services/ans/test/unittest/notification_subscriber_manager_test.cpp +++ b/services/ans/test/unittest/notification_subscriber_manager_test.cpp @@ -25,7 +25,6 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class NotificationSubscriberManagerTest : public testing::Test { public: static void SetUpTestCase(); diff --git a/services/ans/test/unittest/permission_filter_test.cpp b/services/ans/test/unittest/permission_filter_test.cpp index 3aa2fa8293354a3b4fa40e4ab6624e9e35750bc7..f1010e09320c16b8a054c734e50864c2334d8af9 100644 --- a/services/ans/test/unittest/permission_filter_test.cpp +++ b/services/ans/test/unittest/permission_filter_test.cpp @@ -26,11 +26,10 @@ using namespace testing::ext; namespace OHOS { namespace Notification { - class PermissionFilterTest : public testing::Test { public: - static void SetUpTestCase(){}; - static void TearDownTestCase(){}; + static void SetUpTestCase() {}; + static void TearDownTestCase() {}; void SetUp(); void TearDown(); }; diff --git a/services/test/moduletest/ans_module_test.cpp b/services/test/moduletest/ans_module_test.cpp index a967f8b00e9908a7d51afa5b243ab8a00ed4ab52..50b07085e5eabbe02e61e745d24f3411838f0f38 100644 --- a/services/test/moduletest/ans_module_test.cpp +++ b/services/test/moduletest/ans_module_test.cpp @@ -1079,10 +1079,10 @@ HWTEST_F(AnsModuleTest, AnsModuleTest_0051, Function | SmallTest | Level1) slots.push_back(slot); g_advancedNotificationService->AddSlots(slots); - std::vector> slotsRef{}; + std::vector> slotsRef {}; g_advancedNotificationService->GetSlots(slotsRef); EXPECT_EQ(1, static_cast(slotsRef.size())); - std::vector slotsId{}; + std::vector slotsId {}; for (const auto &i : slotsRef) { slotsId.push_back(i->GetId()); } @@ -1104,9 +1104,9 @@ HWTEST_F(AnsModuleTest, AnsModuleTest_0052, Function | SmallTest | Level1) slots.push_back(slot); g_advancedNotificationService->AddSlots(slots); - std::vector> slotsRef{}; + std::vector> slotsRef {}; g_advancedNotificationService->GetSlots(slotsRef); - std::vector slotsId{}; + std::vector slotsId {}; for (const auto &i : slotsRef) { slotsId.push_back(i->GetId()); } @@ -1620,7 +1620,6 @@ HWTEST_F(AnsModuleTest, AnsModuleTest_0103, Function | SmallTest | Level1) */ HWTEST_F(AnsModuleTest, AnsModuleTest_0105, Function | SmallTest | Level1) { - std::vector> slots; sptr socialSlot = new NotificationSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION); sptr reminderSlot = new NotificationSlot(NotificationConstant::SlotType::SERVICE_REMINDER); diff --git a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp index 5738fc88159f6492dd145f45e311b2fdaa7c4911..7839b908cb6b9d9d2d1aa866abc9a5639840b2f4 100644 --- a/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp +++ b/services/test/moduletest/mock/mock_bundle_mgr_proxy.cpp @@ -274,6 +274,5 @@ bool BundleMgrProxy::SendTransactCmd(IBundleMgr::Message code, MessageParcel &da { return true; } - } // namespace AppExecFwk } // namespace OHOS diff --git a/services/test/moduletest/mock/mock_event_handler.cpp b/services/test/moduletest/mock/mock_event_handler.cpp index 12a7f65b9d4e00f3c9c65a4a8668e162960cb723..bbbeb490708bddfb63b3f0cfee26529eac2bd62b 100644 --- a/services/test/moduletest/mock/mock_event_handler.cpp +++ b/services/test/moduletest/mock/mock_event_handler.cpp @@ -15,7 +15,6 @@ #include "event_handler.h" #include "event_handler_utils.h" -#include namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/ansSTSlotGroupTest/include/ans_slotgroup_test.h b/test/resource/ansSTSlotGroupTest/include/ans_slotgroup_test.h index cdab5c143ca173ebb9e1f9b4160c7e9378fe2b2c..4e20ffb27f05cd9239d22d905b0fa60cddb9a6e3 100644 --- a/test/resource/ansSTSlotGroupTest/include/ans_slotgroup_test.h +++ b/test/resource/ansSTSlotGroupTest/include/ans_slotgroup_test.h @@ -26,7 +26,6 @@ namespace OHOS { namespace AppExecFwk { - class AnsSlotGroupSystemTest : public Ability { protected: virtual void OnStart(const Want &want) override; @@ -45,7 +44,6 @@ private: std::string targetBundle; std::string targetAbility; }; - } // namespace AppExecFwk } // namespace OHOS #endif \ No newline at end of file diff --git a/tools/dump/include/notification_shell_command.h b/tools/dump/include/notification_shell_command.h index b881ffacd7b8fd415b082c3c7e6100c25af88f94..ae1b2f8dcd93d9f09755b9ef12dc25837f3fec5f 100644 --- a/tools/dump/include/notification_shell_command.h +++ b/tools/dump/include/notification_shell_command.h @@ -23,11 +23,10 @@ namespace OHOS { namespace Notification { - class NotificationShellCommand : public OHOS::AAFwk::ShellCommand { public: NotificationShellCommand(int argc, char *argv[]); - ~NotificationShellCommand() override{}; + ~NotificationShellCommand() override {}; private: ErrCode CreateCommandMap() override; @@ -39,7 +38,6 @@ private: private: std::shared_ptr ans_; }; - } // namespace Notification } // namespace OHOS #endif // BASE_NOTIFICATION_ANS_STANDARD_TOOLS_DUMP_INCLUDE_NOTIFICATION_SHELL_COMMAND_H \ No newline at end of file diff --git a/tools/dump/src/main.cpp b/tools/dump/src/main.cpp index 3a650b7e4fd83240780365c8ca85fd893339859d..b9557ac51c1a3fe359a78b965912b63a95621260 100644 --- a/tools/dump/src/main.cpp +++ b/tools/dump/src/main.cpp @@ -13,7 +13,6 @@ * limitations under the License. */ -#include #include "notification_shell_command.h"