diff --git a/frameworks/ans/src/ans_dialog_host_client.cpp b/frameworks/ans/src/ans_dialog_host_client.cpp index 719e6c0c0abc9d17966051f456a436f7956246c9..6f8a9561e34919baeddd088bd6aab268c00f5ba5 100644 --- a/frameworks/ans/src/ans_dialog_host_client.cpp +++ b/frameworks/ans/src/ans_dialog_host_client.cpp @@ -20,7 +20,7 @@ namespace OHOS::Notification { bool AnsDialogHostClient::CreateIfNullptr(sptr& result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); std::lock_guard lock(AnsDialogHostClient::instanceMutex_); if (instance_ != nullptr) { result = instance_; @@ -46,7 +46,7 @@ void AnsDialogHostClient::Destroy() bool AnsDialogHostClient::SetDialogCallbackInterface( std::unique_ptr dialogCallbackInterface) { - ANS_LOGD("enter"); + ANS_LOGD("called"); std::lock_guard lock(AnsDialogHostClient::instanceMutex_); if (dialogCallbackInterface == nullptr || AnsDialogHostClient::instance_ == nullptr) { return false; @@ -57,7 +57,7 @@ bool AnsDialogHostClient::SetDialogCallbackInterface( ErrCode AnsDialogHostClient::OnDialogStatusChanged(const DialogStatusData& statusData) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (dialogCallbackInterface_ == nullptr) { ANS_LOGE("AnsDialogCallbackNativeInterface is null."); return ERR_OK; diff --git a/frameworks/ans/src/notification_bundle_option.cpp b/frameworks/ans/src/notification_bundle_option.cpp index 056acc20d61bcfe152aa20da7268918500baa3f5..061ee3b6ad95be2f5dbe50fb74ebddbced38ee6d 100644 --- a/frameworks/ans/src/notification_bundle_option.cpp +++ b/frameworks/ans/src/notification_bundle_option.cpp @@ -152,7 +152,7 @@ NotificationBundleOption *NotificationBundleOption::FromJson(const nlohmann::jso auto *pBundle = new (std::nothrow) NotificationBundleOption(); if (pBundle == nullptr) { - ANS_LOGE("Failed to create bundle option instance"); + ANS_LOGE("null pBundle"); return nullptr; } diff --git a/frameworks/ans/src/notification_button_option.cpp b/frameworks/ans/src/notification_button_option.cpp index 5e2437a22cd2a12d4fbbfb61d9672df1ad102553..586bc9ca6060f8ca9c0e579bdcb0a5a469552c17 100644 --- a/frameworks/ans/src/notification_button_option.cpp +++ b/frameworks/ans/src/notification_button_option.cpp @@ -59,7 +59,7 @@ NotificationButtonOption *NotificationButtonOption::FromJson(const nlohmann::jso NotificationButtonOption *button = new (std::nothrow) NotificationButtonOption(); if (button == nullptr) { - ANS_LOGE("Failed to create button option instance"); + ANS_LOGE("null button"); return nullptr; } diff --git a/frameworks/ans/src/notification_capsule.cpp b/frameworks/ans/src/notification_capsule.cpp index 12ea7a4f6b2e6fd9f015cde00f34fdd11e341fef..26166a91f30fbca134ba070d51c734218ccb347d 100644 --- a/frameworks/ans/src/notification_capsule.cpp +++ b/frameworks/ans/src/notification_capsule.cpp @@ -130,7 +130,7 @@ NotificationCapsule *NotificationCapsule::FromJson(const nlohmann::json &jsonObj NotificationCapsule *capsule = new (std::nothrow) NotificationCapsule(); if (capsule == nullptr) { - ANS_LOGE("Failed to create capsule instance"); + ANS_LOGE("null capsule"); return nullptr; } diff --git a/frameworks/ans/src/notification_content.cpp b/frameworks/ans/src/notification_content.cpp index 596e2b5cb6ea8f01df750a959a784e84752c27e2..ff25c0add12318443ab7125caf460217d2905a5f 100644 --- a/frameworks/ans/src/notification_content.cpp +++ b/frameworks/ans/src/notification_content.cpp @@ -24,7 +24,7 @@ std::map NotificationContent::convertStr NotificationContent::NotificationContent(const std::shared_ptr &normalContent) { if (!normalContent) { - ANS_LOGE("NotificationNormalContent can not be null"); + ANS_LOGE("null normalContent"); return; } @@ -35,7 +35,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &longTextContent) { if (!longTextContent) { - ANS_LOGE("NotificationLongTextContent can not be null"); + ANS_LOGE("null longTextContent"); return; } @@ -46,7 +46,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &pictureContent) { if (!pictureContent) { - ANS_LOGE("NotificationPictureContent can not be null"); + ANS_LOGE("null pictureContent"); return; } @@ -57,7 +57,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &conversationContent) { if (!conversationContent) { - ANS_LOGE("NotificationConversationalContent can not be null"); + ANS_LOGE("null conversationContent"); return; } @@ -68,7 +68,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &multiLineContent) { if (!multiLineContent) { - ANS_LOGE("NotificationMultiLineContent can not be null"); + ANS_LOGE("null multiLineContent"); return; } @@ -79,7 +79,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &mediaContent) { if (!mediaContent) { - ANS_LOGE("NotificationMediaContent can not be null"); + ANS_LOGE("null mediaContent"); return; } @@ -90,7 +90,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &localLiveViewContent) { if (!localLiveViewContent) { - ANS_LOGE("NotificationLocalLiveViewContent can not be null"); + ANS_LOGE("null localLiveViewContent"); return; } @@ -102,7 +102,7 @@ NotificationContent::NotificationContent(const std::shared_ptr &liveViewContent) { if (!liveViewContent) { - ANS_LOGE("NotificationLiveViewContent can not be null"); + ANS_LOGE("null liveViewContent"); return; } @@ -168,13 +168,13 @@ NotificationContent *NotificationContent::FromJson(const nlohmann::json &jsonObj } const auto &jsonEnd = jsonObject.cend(); if ((jsonObject.find("contentType") == jsonEnd) || (jsonObject.find("content") == jsonEnd)) { - ANS_LOGE("Incomplete NotificationContent json object. Cannot convert content from JSON."); + ANS_LOGE("Cannot convert content from JSON"); return nullptr; } auto pContent = new (std::nothrow) NotificationContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create NotificationContent instance"); + ANS_LOGE("null pContent"); return nullptr; } @@ -279,7 +279,7 @@ bool NotificationContent::ReadFromParcel(Parcel &parcel) bool NotificationContent::ConvertJsonToContent(NotificationContent *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return false; } @@ -292,7 +292,7 @@ bool NotificationContent::ConvertJsonToContent(NotificationContent *target, cons auto contentObj = jsonObject.at("content"); if (contentObj.is_null()) { - ANS_LOGE("Invalid json object. Cannot convert content from JSON."); + ANS_LOGE("Cannot convert content from JSON"); return false; } @@ -324,7 +324,7 @@ bool NotificationContent::ConvertJsonToContent(NotificationContent *target, cons break; } if (pBasicContent == nullptr) { - ANS_LOGE("Parse content error!"); + ANS_LOGE("null pBasicContent"); return false; } target->content_ = std::shared_ptr(pBasicContent); @@ -351,7 +351,7 @@ bool NotificationContent::GetContentTypeByString( contentType = iterContentType->second; return true; } - ANS_LOGE("GetContentTypeByString failed as Invalid strContentType."); + ANS_LOGE("Invalid strContentType"); return false; } } // namespace Notification diff --git a/frameworks/ans/src/notification_conversational_message.cpp b/frameworks/ans/src/notification_conversational_message.cpp index a46c8297fa1991200dc16e05219fecbab8104e29..6298781e300a903d1e8d988c68f8486b26c49aef 100644 --- a/frameworks/ans/src/notification_conversational_message.cpp +++ b/frameworks/ans/src/notification_conversational_message.cpp @@ -98,7 +98,7 @@ NotificationConversationalMessage *NotificationConversationalMessage::FromJson(c auto pMessage = new (std::nothrow) NotificationConversationalMessage(); if (pMessage == nullptr) { - ANS_LOGE("Failed to create conversationalMessage instance"); + ANS_LOGE("null pMessage"); return nullptr; } @@ -196,7 +196,7 @@ bool NotificationConversationalMessage::ReadFromParcel(Parcel &parcel) auto pUser = parcel.ReadParcelable(); if (pUser == nullptr) { - ANS_LOGE("Failed to read sender"); + ANS_LOGE("null pUser"); return false; } sender_ = *pUser; diff --git a/frameworks/ans/src/notification_distributed_options.cpp b/frameworks/ans/src/notification_distributed_options.cpp index 571ce714c8f8d95de4dab21808484089b0a637b4..4e206ce3f7f5f18229ee28db6a5ebc1b4b20a986 100644 --- a/frameworks/ans/src/notification_distributed_options.cpp +++ b/frameworks/ans/src/notification_distributed_options.cpp @@ -92,7 +92,7 @@ NotificationDistributedOptions *NotificationDistributedOptions::FromJson(const n auto pOpt = new (std::nothrow) NotificationDistributedOptions(); if (pOpt == nullptr) { - ANS_LOGE("Failed to create distributedOptions instance"); + ANS_LOGE("null pOpt"); return nullptr; } diff --git a/frameworks/ans/src/notification_do_not_disturb_profile.cpp b/frameworks/ans/src/notification_do_not_disturb_profile.cpp index a35dad96f17879d25ebe3922ba5174ee32a494c4..d3221959b940c88ce8cfb56b0f859ed12c3a200c 100644 --- a/frameworks/ans/src/notification_do_not_disturb_profile.cpp +++ b/frameworks/ans/src/notification_do_not_disturb_profile.cpp @@ -110,7 +110,7 @@ bool NotificationDoNotDisturbProfile::ReadFromParcel(Parcel &parcel) for (uint32_t index = 0; index < size; ++index) { sptr bundleOption = parcel.ReadParcelable(); if (bundleOption == nullptr) { - ANS_LOGE("Failed to read bundle option."); + ANS_LOGE("null bundleOption"); return false; } trustList_.emplace_back(*bundleOption); diff --git a/frameworks/ans/src/notification_flags.cpp b/frameworks/ans/src/notification_flags.cpp index 8f234f1263d553547f3a0e8d84e9afcd8d0b08b0..36f9b6636b486f1a715c16271d460d51b7dddeb1 100644 --- a/frameworks/ans/src/notification_flags.cpp +++ b/frameworks/ans/src/notification_flags.cpp @@ -168,7 +168,7 @@ NotificationFlags *NotificationFlags::FromJson(const nlohmann::json &jsonObject) auto pFlags = new (std::nothrow) NotificationFlags(); if (pFlags == nullptr) { - ANS_LOGE("Failed to create notificationFlags instance"); + ANS_LOGE("null pFlags"); return nullptr; } @@ -215,7 +215,7 @@ NotificationFlags *NotificationFlags::Unmarshalling(Parcel &parcel) { auto templ = new (std::nothrow) NotificationFlags(); if (templ == nullptr) { - ANS_LOGE("Failed to create NotificationFlags instance"); + ANS_LOGE("null templ"); return nullptr; } if (!templ->ReadFromParcel(parcel)) { @@ -239,7 +239,7 @@ bool NotificationFlags::GetReminderFlagsByString( const std::string &strReminderFlags, std::shared_ptr &reminderFlags) { if (strReminderFlags.size() <= SOUND_ENABLED_SEQ) { - ANS_LOGE("GetReminderFlagsByString failed as Invalid reminderFlags size."); + ANS_LOGE("GetReminderFlagsByString failed as Invalid reminderFlags size"); return false; } for (int32_t seq = 0; seq < strReminderFlags.size(); seq++) { diff --git a/frameworks/ans/src/notification_icon_button.cpp b/frameworks/ans/src/notification_icon_button.cpp index 96d43b5800130a78da442dd872098daa4f8bc8f4..a873d73cc16e13c5d47953109b987dce0682ea52 100644 --- a/frameworks/ans/src/notification_icon_button.cpp +++ b/frameworks/ans/src/notification_icon_button.cpp @@ -118,7 +118,7 @@ NotificationIconButton *NotificationIconButton::FromJson(const nlohmann::json &j auto *button = new (std::nothrow) NotificationIconButton(); if (button == nullptr) { - ANS_LOGE("Failed to create icon button"); + ANS_LOGE("null button"); return nullptr; } @@ -143,7 +143,7 @@ NotificationIconButton *NotificationIconButton::FromJson(const nlohmann::json &j } auto pIcon = AnsImageUtil::UnPackImage(resources); if (pIcon == nullptr) { - ANS_LOGE("Failed to parse button icon"); + ANS_LOGE("null pIcon"); delete button; button = nullptr; } else { @@ -153,7 +153,7 @@ NotificationIconButton *NotificationIconButton::FromJson(const nlohmann::json &j auto resources = jsonObject.at("iconImage"); auto pIcon = AnsImageUtil::UnPackImage(resources); if (pIcon == nullptr) { - ANS_LOGE("Failed to parse button icon"); + ANS_LOGE("null pIcon"); delete button; button = nullptr; } else { diff --git a/frameworks/ans/src/notification_live_view_content.cpp b/frameworks/ans/src/notification_live_view_content.cpp index cda062ac738f8dec1e917c69af0be9d4c09b55f3..a8523142832752377507a47916527f91f9e32c5c 100644 --- a/frameworks/ans/src/notification_live_view_content.cpp +++ b/frameworks/ans/src/notification_live_view_content.cpp @@ -163,7 +163,7 @@ NotificationLiveViewContent *NotificationLiveViewContent::FromJson(const nlohman auto *pContent = new (std::nothrow) NotificationLiveViewContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create liveViewContent instance"); + ANS_LOGE("null pContent"); return nullptr; } diff --git a/frameworks/ans/src/notification_local_live_view_button.cpp b/frameworks/ans/src/notification_local_live_view_button.cpp index 8fb5db1f9e210e9dd8364865e008a084caf2464a..519add10919a4dcd9d50cc3549414f5406f0518d 100644 --- a/frameworks/ans/src/notification_local_live_view_button.cpp +++ b/frameworks/ans/src/notification_local_live_view_button.cpp @@ -154,7 +154,7 @@ NotificationLocalLiveViewButton *NotificationLocalLiveViewButton::FromJson(const NotificationLocalLiveViewButton *button = new (std::nothrow) NotificationLocalLiveViewButton(); if (button == nullptr) { - ANS_LOGE("Failed to create capsule instance"); + ANS_LOGE("null button"); return nullptr; } @@ -172,7 +172,7 @@ NotificationLocalLiveViewButton *NotificationLocalLiveViewButton::FromJson(const } auto pIcon = AnsImageUtil::UnPackImage(iconObj.get()); if (pIcon == nullptr) { - ANS_LOGE("Failed to parse button icon"); + ANS_LOGE("null pIcon"); delete button; return nullptr; } @@ -245,7 +245,7 @@ bool NotificationLocalLiveViewButton::ReadFromParcel(Parcel &parcel) auto member = std::shared_ptr(parcel.ReadParcelable()); if (member == nullptr) { buttonIcons_.clear(); - ANS_LOGE("Failed to read LocalLiveViewButton"); + ANS_LOGE("null member"); return false; } diff --git a/frameworks/ans/src/notification_local_live_view_content.cpp b/frameworks/ans/src/notification_local_live_view_content.cpp index a5c234dc17e7fa15f202396ff45c8449e72b1251..9c2e3c82c93646da3de094b9ef4cd3bf38ccc415 100644 --- a/frameworks/ans/src/notification_local_live_view_content.cpp +++ b/frameworks/ans/src/notification_local_live_view_content.cpp @@ -194,7 +194,7 @@ NotificationLocalLiveViewContent *NotificationLocalLiveViewContent::FromJson(con auto pContent = new (std::nothrow) NotificationLocalLiveViewContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create localLiveViewContent instance"); + ANS_LOGE("null pContent"); return nullptr; } @@ -353,7 +353,7 @@ bool NotificationLocalLiveViewContent::ReadFromParcel(Parcel &parcel) auto pCapsule = parcel.ReadParcelable(); if (pCapsule == nullptr) { - ANS_LOGE("Failed to read capsule"); + ANS_LOGE("null pCapsule"); return false; } capsule_ = *pCapsule; @@ -375,7 +375,7 @@ bool NotificationLocalLiveViewContent::ReadFromParcel(Parcel &parcel) for (uint32_t i = 0; i < vsize; ++i) { auto btn = parcel.ReadParcelable(); if (btn == nullptr) { - ANS_LOGE("Failed to read card button"); + ANS_LOGE("null btn"); return false; } card_button_.push_back(*btn); @@ -385,7 +385,7 @@ bool NotificationLocalLiveViewContent::ReadFromParcel(Parcel &parcel) auto pProgress = parcel.ReadParcelable(); if (pProgress == nullptr) { - ANS_LOGE("Failed to read progress"); + ANS_LOGE("null pProgress"); return false; } progress_ = *pProgress; @@ -394,7 +394,7 @@ bool NotificationLocalLiveViewContent::ReadFromParcel(Parcel &parcel) auto pTime = parcel.ReadParcelable(); if (pTime == nullptr) { - ANS_LOGE("Failed to read time"); + ANS_LOGE("null pTime"); return false; } time_ = *pTime; diff --git a/frameworks/ans/src/notification_local_live_view_subscriber.cpp b/frameworks/ans/src/notification_local_live_view_subscriber.cpp index 7d017ce4302623f5e6b3d6a5c9b9dd051cdc8821..65d630629af1a742360127a967633bd2a584eb34 100644 --- a/frameworks/ans/src/notification_local_live_view_subscriber.cpp +++ b/frameworks/ans/src/notification_local_live_view_subscriber.cpp @@ -46,7 +46,7 @@ ErrCode NotificationLocalLiveViewSubscriber::SubscriberLocalLiveViewImpl::OnConn sptr proxy = GetAnsManagerProxy(); if (proxy != nullptr) { proxy->AsObject()->AddDeathRecipient(recipient_); - ANS_LOGD("%s, Add death recipient.", __func__); + ANS_LOGD("Add death recipient"); } subscriber_.OnConnected(); return ERR_OK; @@ -58,7 +58,7 @@ ErrCode NotificationLocalLiveViewSubscriber::SubscriberLocalLiveViewImpl::OnDisc sptr proxy = GetAnsManagerProxy(); if (proxy != nullptr) { proxy->AsObject()->RemoveDeathRecipient(recipient_); - ANS_LOGD("%s, Remove death recipient.", __func__); + ANS_LOGD("Remove death recipient"); } subscriber_.OnDisconnected(); return ERR_OK; diff --git a/frameworks/ans/src/notification_long_text_content.cpp b/frameworks/ans/src/notification_long_text_content.cpp index 8efbac17eef4bd8c29f5f358fa590f1a6b4981b7..d0113f07fd4c6ba6f049d4c72ae09b88f3c6086e 100644 --- a/frameworks/ans/src/notification_long_text_content.cpp +++ b/frameworks/ans/src/notification_long_text_content.cpp @@ -100,7 +100,7 @@ NotificationLongTextContent *NotificationLongTextContent::FromJson(const nlohman auto pContent = new (std::nothrow) NotificationLongTextContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create longTextContent instance"); + ANS_LOGE("null pContent"); return nullptr; } diff --git a/frameworks/ans/src/notification_media_content.cpp b/frameworks/ans/src/notification_media_content.cpp index b292ccd4979b9dab8f183cb55e1d317f77818f36..30b98d87fb91a21fb0ebb9213b5ba2c330b34b02 100644 --- a/frameworks/ans/src/notification_media_content.cpp +++ b/frameworks/ans/src/notification_media_content.cpp @@ -73,7 +73,7 @@ NotificationMediaContent *NotificationMediaContent::FromJson(const nlohmann::jso auto pContent = new (std::nothrow) NotificationMediaContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create mediaContent instance"); + ANS_LOGE("null pContent"); return nullptr; } diff --git a/frameworks/ans/src/notification_multiline_content.cpp b/frameworks/ans/src/notification_multiline_content.cpp index 6f799bc60ac9f16b89b25164ddf8e6518353f437..0fa55bea95304446bf3c7ccf713da48f1f2cc73d 100644 --- a/frameworks/ans/src/notification_multiline_content.cpp +++ b/frameworks/ans/src/notification_multiline_content.cpp @@ -108,7 +108,7 @@ NotificationMultiLineContent *NotificationMultiLineContent::FromJson(const nlohm auto pContent = new (std::nothrow) NotificationMultiLineContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create multiLineContent instance"); + ANS_LOGE("null pContent"); return nullptr; } diff --git a/frameworks/ans/src/notification_normal_content.cpp b/frameworks/ans/src/notification_normal_content.cpp index 9bab465f338e1dcf04b2f21670ca72a702486d84..e29b4190d01406da3b402636c86d0b64e2a080ab 100644 --- a/frameworks/ans/src/notification_normal_content.cpp +++ b/frameworks/ans/src/notification_normal_content.cpp @@ -42,7 +42,7 @@ NotificationNormalContent *NotificationNormalContent::FromJson(const nlohmann::j auto pContent = new (std::nothrow) NotificationNormalContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create normalContent instance"); + ANS_LOGE("null pContent"); return nullptr; } diff --git a/frameworks/ans/src/notification_picture_content.cpp b/frameworks/ans/src/notification_picture_content.cpp index 5b7ff751ff5713198fe4263d72ec9fcfa795ffb2..fffa90531778bcd392bab7a047dbf1e1f8752290 100644 --- a/frameworks/ans/src/notification_picture_content.cpp +++ b/frameworks/ans/src/notification_picture_content.cpp @@ -81,7 +81,7 @@ NotificationPictureContent *NotificationPictureContent::FromJson(const nlohmann: auto pContent = new (std::nothrow) NotificationPictureContent(); if (pContent == nullptr) { - ANS_LOGE("Failed to create pictureContent instance"); + ANS_LOGE("null pContent"); return nullptr; } @@ -89,7 +89,7 @@ NotificationPictureContent *NotificationPictureContent::FromJson(const nlohmann: const auto &jsonEnd = jsonObject.cend(); if (jsonObject.find("expandedTitle") != jsonEnd && jsonObject.at("expandedTitle").is_string()) { - ANS_LOGD("Find expandedTitle success."); + ANS_LOGD("Find expandedTitle success"); pContent->expandedTitle_ = jsonObject.at("expandedTitle").get(); } diff --git a/frameworks/ans/src/notification_progress.cpp b/frameworks/ans/src/notification_progress.cpp index 068053b2dd7c509047cdd6c4e661a1630034604b..87b4ca784d9670baf1991845d327ec63b4cbeb28 100644 --- a/frameworks/ans/src/notification_progress.cpp +++ b/frameworks/ans/src/notification_progress.cpp @@ -85,7 +85,7 @@ NotificationProgress *NotificationProgress::FromJson(const nlohmann::json &jsonO NotificationProgress *progress = new (std::nothrow) NotificationProgress(); if (progress == nullptr) { - ANS_LOGE("Failed to create capsule instance"); + ANS_LOGE("null progress"); return nullptr; } diff --git a/frameworks/ans/src/notification_request.cpp b/frameworks/ans/src/notification_request.cpp index d98cbcf318ed069a981c43cde8d47a55b4273872..96f2cacb655ca49dea5e2e65065919b9da2148a0 100644 --- a/frameworks/ans/src/notification_request.cpp +++ b/frameworks/ans/src/notification_request.cpp @@ -201,7 +201,7 @@ void NotificationRequest::SetShowDeliveryTime(bool showDeliveryTime) void NotificationRequest::AddActionButton(const std::shared_ptr &actionButton) { if (!actionButton) { - ANS_LOGW("actionButton can not be null"); + ANS_LOGW("null actionButton"); return; } @@ -246,7 +246,7 @@ void NotificationRequest::SetIsAgentNotification(bool isAgent) void NotificationRequest::AddMessageUser(const std::shared_ptr &messageUser) { if (!messageUser) { - ANS_LOGE("messageUser can not be null"); + ANS_LOGE("null messageUser"); return; } @@ -906,7 +906,7 @@ NotificationRequest *NotificationRequest::FromJson(const nlohmann::json &jsonObj auto pRequest = new (std::nothrow) NotificationRequest(); if (pRequest == nullptr) { - ANS_LOGE("Failed to create request instance"); + ANS_LOGE("null pRequest"); return nullptr; } @@ -1080,7 +1080,7 @@ bool NotificationRequest::Marshalling(Parcel &parcel) const } if (!parcel.WriteUint32(collaboratedReminderFlag_)) { - ANS_LOGE("Failed to write collaborated reminderflag"); + ANS_LOGE("Failed to write collaborated reminderFlag"); return false; } @@ -1714,7 +1714,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) wantAgent_ = std::shared_ptr( parcel.ReadParcelable()); if (!wantAgent_) { - ANS_LOGE("Failed to read wantAgent"); + ANS_LOGE("null wantAgent"); return false; } } @@ -1724,7 +1724,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) removalWantAgent_ = std::shared_ptr( parcel.ReadParcelable()); if (!removalWantAgent_) { - ANS_LOGE("Failed to read removalWantAgent"); + ANS_LOGE("null removalWantAgent"); return false; } } @@ -1734,7 +1734,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) maxScreenWantAgent_ = std::shared_ptr( parcel.ReadParcelable()); if (!maxScreenWantAgent_) { - ANS_LOGE("Failed to read maxScreenWantAgent"); + ANS_LOGE("null maxScreenWantAgent"); return false; } } @@ -1743,7 +1743,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { additionalParams_ = std::shared_ptr(parcel.ReadParcelable()); if (!additionalParams_) { - ANS_LOGE("Failed to read additionalParams"); + ANS_LOGE("null additionalParams"); return false; } } @@ -1752,7 +1752,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { extendInfo_ = std::shared_ptr(parcel.ReadParcelable()); if (!extendInfo_) { - ANS_LOGE("Failed to read extendInfo"); + ANS_LOGE("null extendInfo"); return false; } } @@ -1766,7 +1766,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { bigIcon_ = std::shared_ptr(parcel.ReadParcelable()); if (!bigIcon_) { - ANS_LOGE("Failed to read bigIcon"); + ANS_LOGE("null bigIcon"); return false; } } @@ -1775,7 +1775,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { overlayIcon_ = std::shared_ptr(parcel.ReadParcelable()); if (!overlayIcon_) { - ANS_LOGE("Failed to read overlayIcon"); + ANS_LOGE("null overlayIcon"); return false; } } @@ -1784,7 +1784,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { notificationContent_ = std::shared_ptr(parcel.ReadParcelable()); if (!notificationContent_) { - ANS_LOGE("Failed to read notificationContent"); + ANS_LOGE("null notificationContent"); return false; } } @@ -1795,7 +1795,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) auto member = std::shared_ptr(parcel.ReadParcelable()); if (member == nullptr) { actionButtons_.clear(); - ANS_LOGE("Failed to read actionButton"); + ANS_LOGE("null member"); return false; } @@ -1812,7 +1812,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) for (uint64_t it = 0; it < vsize; ++it) { auto member = std::shared_ptr(parcel.ReadParcelable()); if (member == nullptr) { - ANS_LOGE("Failed to read messageUser"); + ANS_LOGE("null member"); messageUsers_.clear(); return false; } @@ -1827,7 +1827,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) auto pOpt = parcel.ReadParcelable(); if (pOpt == nullptr) { - ANS_LOGE("Failed to read distributedOptions"); + ANS_LOGE("null pOpt"); return false; } distributedOptions_ = *pOpt; @@ -1838,7 +1838,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { notificationTemplate_ = std::shared_ptr(parcel.ReadParcelable()); if (!notificationTemplate_) { - ANS_LOGE("Failed to read notificationTemplate"); + ANS_LOGE("null notificationTemplate"); return false; } } @@ -1847,7 +1847,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) if (valid) { notificationFlags_ = std::shared_ptr(parcel.ReadParcelable()); if (!notificationFlags_) { - ANS_LOGE("Failed to read notificationFlags"); + ANS_LOGE("null notificationFlags"); return false; } } @@ -1870,7 +1870,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) unifiedGroupInfo_ = std::shared_ptr(parcel.ReadParcelable()); if (!unifiedGroupInfo_) { - ANS_LOGE("Failed to read unifiedGroupInfo+"); + ANS_LOGE("null unifiedGroupInfo"); return false; } } @@ -1880,7 +1880,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) notificationBundleOption_ = std::shared_ptr(parcel.ReadParcelable()); if (!notificationBundleOption_) { - ANS_LOGE("Failed to read notificationBundleOption"); + ANS_LOGE("null notificationBundleOption"); return false; } } @@ -1890,7 +1890,7 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) agentBundle_ = std::shared_ptr(parcel.ReadParcelable()); if (!agentBundle_) { - ANS_LOGE("Failed to read agentBundle"); + ANS_LOGE("null agentBundle"); return false; } } @@ -2238,7 +2238,7 @@ void NotificationRequest::ConvertJsonToNumExt( void NotificationRequest::ConvertJsonToNum(NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return; } @@ -2298,7 +2298,7 @@ void NotificationRequest::ConvertJsonToNum(NotificationRequest *target, const nl void NotificationRequest::ConvertJsonToString(NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return; } @@ -2340,7 +2340,7 @@ void NotificationRequest::ConvertJsonToString(NotificationRequest *target, const void NotificationRequest::ConvertJsonToEnum(NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return; } @@ -2366,7 +2366,7 @@ void NotificationRequest::ConvertJsonToEnum(NotificationRequest *target, const n void NotificationRequest::ConvertJsonToBool(NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return; } @@ -2431,7 +2431,7 @@ void NotificationRequest::ConvertJsonToBoolExt(NotificationRequest *target, cons void NotificationRequest::ConvertJsonToPixelMap(NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return; } @@ -2457,7 +2457,7 @@ bool NotificationRequest::ConvertJsonToNotificationContent( NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return false; } @@ -2468,7 +2468,7 @@ bool NotificationRequest::ConvertJsonToNotificationContent( if (!contentObj.is_null()) { auto pContent = NotificationJsonConverter::ConvertFromJson(contentObj); if (pContent == nullptr) { - ANS_LOGE("Failed to parse notification content!"); + ANS_LOGE("null pContent"); return false; } @@ -2483,7 +2483,7 @@ bool NotificationRequest::ConvertJsonToNotificationActionButton( NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return false; } int32_t targetUid = -1; @@ -2499,7 +2499,7 @@ bool NotificationRequest::ConvertJsonToNotificationActionButton( for (auto &btnObj : buttonArr) { auto pBtn = NotificationActionButton::ConvertNotificationActionButton(targetUid, btnObj); if (pBtn == nullptr) { - ANS_LOGE("Failed to parse actionButton!"); + ANS_LOGE("null pBtn"); return false; } @@ -2514,7 +2514,7 @@ bool NotificationRequest::ConvertJsonToNotificationDistributedOptions( NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return false; } @@ -2525,7 +2525,7 @@ bool NotificationRequest::ConvertJsonToNotificationDistributedOptions( if (!optObj.is_null()) { auto *pOpt = NotificationJsonConverter::ConvertFromJson(optObj); if (pOpt == nullptr) { - ANS_LOGE("Failed to parse distributedOptions!"); + ANS_LOGE("null pOpt"); return false; } @@ -2541,7 +2541,7 @@ bool NotificationRequest::ConvertJsonToNotificationFlags( NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter"); + ANS_LOGE("null target"); return false; } @@ -2552,7 +2552,7 @@ bool NotificationRequest::ConvertJsonToNotificationFlags( if (!flagsObj.is_null()) { auto *pFlags = NotificationJsonConverter::ConvertFromJson(flagsObj); if (pFlags == nullptr) { - ANS_LOGE("Failed to parse notificationFlags!"); + ANS_LOGE("null pFlags"); return false; } @@ -2567,7 +2567,7 @@ bool NotificationRequest::ConvertJsonToNotificationBundleOption( NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter."); + ANS_LOGE("null target"); return false; } @@ -2578,7 +2578,7 @@ bool NotificationRequest::ConvertJsonToNotificationBundleOption( if (!bundleOptionObj.is_null()) { auto *pBundleOption = NotificationJsonConverter::ConvertFromJson(bundleOptionObj); if (pBundleOption == nullptr) { - ANS_LOGE("Failed to parse notificationBundleOption!"); + ANS_LOGE("null pBundleOption"); return false; } @@ -2593,7 +2593,7 @@ bool NotificationRequest::ConvertJsonToAgentBundle( NotificationRequest *target, const nlohmann::json &jsonObject) { if (target == nullptr) { - ANS_LOGE("Invalid input parameter."); + ANS_LOGE("null target"); return false; } @@ -2604,7 +2604,7 @@ bool NotificationRequest::ConvertJsonToAgentBundle( if (!bundleOptionObj.is_null()) { auto *pBundleOption = NotificationJsonConverter::ConvertFromJson(bundleOptionObj); if (pBundleOption == nullptr) { - ANS_LOGE("Failed to parse agentBundle!"); + ANS_LOGE("null pBundleOption"); return false; } @@ -2873,13 +2873,13 @@ ErrCode NotificationRequest::CheckImageSizeForContent() const { auto content = GetContent(); if (content == nullptr) { - ANS_LOGE("Invalid content in NotificationRequest"); + ANS_LOGE("null content"); return ERR_OK; } auto basicContent = GetContent()->GetNotificationContent(); if (basicContent == nullptr) { - ANS_LOGE("Invalid content in NotificationRequest"); + ANS_LOGE("null basicContent"); return ERR_OK; } diff --git a/frameworks/ans/src/notification_subscribe_info.cpp b/frameworks/ans/src/notification_subscribe_info.cpp index 6dbbf0093d238f7bbc8ef243eacd598f4d0acee0..feaa687a96e87814ced262990137845e4e654416 100644 --- a/frameworks/ans/src/notification_subscribe_info.cpp +++ b/frameworks/ans/src/notification_subscribe_info.cpp @@ -154,7 +154,7 @@ bool NotificationSubscribeInfo::ReadFromParcel(Parcel &parcel) //read slotTypes_ uint32_t size = 0; if (!parcel.ReadUint32(size)) { - ANS_LOGE("read slotType_ size failed."); + ANS_LOGE("Can't read size"); return false; } if (size > MAX_SLOT_SIZE) { @@ -164,7 +164,7 @@ bool NotificationSubscribeInfo::ReadFromParcel(Parcel &parcel) for (uint32_t index = 0; index < size; index++) { int32_t slotType = -1; if (!parcel.ReadInt32(slotType)) { - ANS_LOGE("read Parcelable slotType failed."); + ANS_LOGE("Can't read slotType"); return false; } slotTypes_.emplace_back(static_cast(slotType)); diff --git a/frameworks/ans/src/notification_subscriber.cpp b/frameworks/ans/src/notification_subscriber.cpp index 704ad23b64cd02f9fe01ccb4a7ba0bda914f4a2b..4d2b17b749383def0d9c7d15e6afb70216fa1895 100644 --- a/frameworks/ans/src/notification_subscriber.cpp +++ b/frameworks/ans/src/notification_subscriber.cpp @@ -48,7 +48,7 @@ bool NotificationSubscriber::ProcessSyncDecision( { sptr request = notification->GetNotificationRequestPoint(); if (request == nullptr) { - ANS_LOGE("No need to consume cause invalid reqeuest."); + ANS_LOGE("null request"); return false; } diff --git a/frameworks/ans/src/notification_template.cpp b/frameworks/ans/src/notification_template.cpp index 98a5fba3e9ef3426567df98d47ce374c53b328e1..fefaf4a4bcbb657a0dd09de4b7b119c69a707dc6 100644 --- a/frameworks/ans/src/notification_template.cpp +++ b/frameworks/ans/src/notification_template.cpp @@ -74,7 +74,7 @@ NotificationTemplate *NotificationTemplate::Unmarshalling(Parcel &parcel) { auto templ = new (std::nothrow) NotificationTemplate(); if (templ == nullptr) { - ANS_LOGE("Failed to create NotificationTemplate instance"); + ANS_LOGE("null templ"); return nullptr; } if (!templ->ReadFromParcel(parcel)) { @@ -96,7 +96,7 @@ bool NotificationTemplate::ReadFromParcel(Parcel &parcel) if (valid) { templateData_ = std::shared_ptr(parcel.ReadParcelable()); if (!templateData_) { - ANS_LOGE("Failed to read template data"); + ANS_LOGE("null templateData"); return false; } } diff --git a/frameworks/ans/src/notification_user_input.cpp b/frameworks/ans/src/notification_user_input.cpp index 53f928e0569a95f2a9310417ec9d45035c8f1041..6c1b41b3b57f5c0e4778c50828528840c7f2ec4f 100644 --- a/frameworks/ans/src/notification_user_input.cpp +++ b/frameworks/ans/src/notification_user_input.cpp @@ -61,7 +61,7 @@ std::shared_ptr NotificationUserInput::Create(const std:: auto pUserInput = new (std::nothrow) NotificationUserInput(inputKey); if (pUserInput == nullptr) { - ANS_LOGE("create NotificationUserInput object failed"); + ANS_LOGE("null pUserInput"); return {}; } @@ -98,7 +98,7 @@ std::shared_ptr NotificationUserInput::Create(const std:: auto pUserInput = new (std::nothrow) NotificationUserInput(inputKey, tag, options, permitFreeFormInput, permitMimeTypes, realAdditional, editType); if (pUserInput == nullptr) { - ANS_LOGE("create NotificationUserInput object failed"); + ANS_LOGE("null pUserInput"); return {}; } @@ -264,7 +264,7 @@ NotificationUserInput *NotificationUserInput::FromJson(const nlohmann::json &jso auto pUserInput = new (std::nothrow) NotificationUserInput(); if (pUserInput == nullptr) { - ANS_LOGE("Failed to create userInput instance"); + ANS_LOGE("null pUserInput"); return nullptr; } @@ -391,7 +391,7 @@ bool NotificationUserInput::ReadFromParcel(Parcel &parcel) if (valid) { additionalData_ = std::shared_ptr(parcel.ReadParcelable()); if (!additionalData_) { - ANS_LOGE("Failed to read additionalData"); + ANS_LOGE("null additionalData"); return false; } } diff --git a/frameworks/ans/src/push_callback_stub.cpp b/frameworks/ans/src/push_callback_stub.cpp index abee0fc3e1191caa409cbae5394709961958654e..c2fa3db03fe8b29c00fdc9226085d380a2b5e57f 100644 --- a/frameworks/ans/src/push_callback_stub.cpp +++ b/frameworks/ans/src/push_callback_stub.cpp @@ -73,7 +73,7 @@ ErrCode PushCallBackStub::ConvertPushCheckCodeToErrCode(int32_t pushCheckCode) int PushCallBackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - ANS_LOGD("called."); + ANS_LOGD("called"); if (data.ReadInterfaceToken() != GetDescriptor()) { ANS_LOGE("local descriptor is not equal to remote"); return ERR_INVALID_STATE; @@ -125,14 +125,14 @@ int32_t PushCallBackProxy::OnCheckNotification( auto remote = Remote(); if (remote == nullptr) { - ANS_LOGE("Get Remote fail."); + ANS_LOGE("null remote"); return false; } int error = remote->SendRequest(static_cast(NotificationInterfaceCode::ON_CHECK_NOTIFICATION), data, reply, option); if (error != NO_ERROR) { - ANS_LOGE("Connect done fail, error: %{public}d", error); + ANS_LOGE("error: %{public}d", error); return false; } @@ -148,12 +148,12 @@ void PushCallBackProxy::HandleEventControl( std::string eventControl, const std::shared_ptr &pushCallBackParam) { if (pushCallBackParam == nullptr) { - ANS_LOGE("pushCallBackParam is null"); + ANS_LOGE("null pushCallBackParam"); return; } std::string event = pushCallBackParam->event; if (event.empty()) { - ANS_LOGE("event is null"); + ANS_LOGE("null event"); return; } ANS_LOGI("eventControl:%{public}s,event:%{public}s", eventControl.c_str(), event.c_str()); diff --git a/frameworks/cj/ffi/src/notification_manager_impl.cpp b/frameworks/cj/ffi/src/notification_manager_impl.cpp index 9628b2f0371f09fac448fb78c40c9812978b2461..fa02f2f0bbf1af5c94c60b9f45eb07f25b31b697 100644 --- a/frameworks/cj/ffi/src/notification_manager_impl.cpp +++ b/frameworks/cj/ffi/src/notification_manager_impl.cpp @@ -128,7 +128,7 @@ namespace CJSystemapi { CNotificationSlotV2* head = reinterpret_cast(malloc(sizeof(CNotificationSlotV2) * slots.size())); if (head == nullptr) { - LOGE("malloc CNotificationSlotV2 failed"); + LOGE("null head"); return notificationSlots; } int32_t count = 0; @@ -138,7 +138,7 @@ namespace CJSystemapi { continue; } if (!SetNotificationSlotV2(*vec, head[count])) { - LOGE("SetNotificationSlotV2 is nullptr."); + LOGE("null SetNotificationSlotV2"); continue; } count++; @@ -197,7 +197,7 @@ namespace CJSystemapi { } head[count] = reinterpret_cast(malloc(sizeof(CNotificationRequestV2))); if (head[count] == nullptr) { - LOGE("NotificationManagerImplV2::GetActiveNotifications malloc CNotificationRequest failed"); + LOGE("null head[count]"); for (int32_t i = 0 ; i < count; i++) { free(head[i]); } diff --git a/frameworks/cj/ffi/src/notification_utils.cpp b/frameworks/cj/ffi/src/notification_utils.cpp index 20bfc0fa1af0bf8f568e778e06ae31715b011c37..dd3580c27b848805c345507f921ff454e0cf1768 100644 --- a/frameworks/cj/ffi/src/notification_utils.cpp +++ b/frameworks/cj/ffi/src/notification_utils.cpp @@ -268,7 +268,7 @@ namespace Notification { if (contentResult->lockscreenPicture != -1) { auto pixelMap = FFIData::GetData(contentResult->lockscreenPicture); if (pixelMap == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixelMap"); return false; } basicContent->SetLockScreenPicture(pixelMap->GetRealPixelMap()); @@ -280,7 +280,7 @@ namespace Notification { { std::shared_ptr normalContent = std::make_shared(); if (normalContent == nullptr) { - LOGE("normalContent is null"); + LOGE("null normalContent"); return false; } @@ -347,7 +347,7 @@ namespace Notification { std::shared_ptr longContent = std::make_shared(); if (longContent == nullptr) { - LOGE("longContent is null"); + LOGE("null longContent"); return false; } if (!GetNotificationLongTextContentDetailedV2(contentResult, longContent)) { @@ -397,7 +397,7 @@ namespace Notification { // picture: image.PixelMap auto pixelMap = FFIData::GetData(contentResult->picture); if (pixelMap == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixelMap"); return false; } pictureContent->SetBigPicture(pixelMap->GetRealPixelMap()); @@ -412,7 +412,7 @@ namespace Notification { std::shared_ptr pictureContent = std::make_shared(); if (pictureContent == nullptr) { - LOGE("pictureContent is null"); + LOGE("null pictureContent"); return false; } @@ -452,7 +452,7 @@ namespace Notification { std::shared_ptr multiLineContent = std::make_shared(); if (multiLineContent == nullptr) { - LOGE("multiLineContent is null"); + LOGE("null multiLineContent"); return false; } @@ -514,7 +514,7 @@ namespace Notification { if (contentResult->capsule.icon != -1) { auto pixelMap = FFIData::GetData(contentResult->capsule.icon); if (pixelMap == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixelMap"); return false; } capsule.SetIcon(pixelMap->GetRealPixelMap()); @@ -544,7 +544,7 @@ namespace Notification { int64_t id = contentResult->button.icons.head[i]; auto pixelMap = FFIData::GetData(id); if (pixelMap == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixelMap"); return false; } auto pix = pixelMap->GetRealPixelMap(); @@ -646,7 +646,7 @@ namespace Notification { std::shared_ptr localLiveViewContent = std::make_shared(); if (localLiveViewContent == nullptr) { - LOGE("localLiveViewContent is null"); + LOGE("null localLiveViewContent"); return false; } @@ -824,7 +824,7 @@ namespace Notification { if (smallIcon != -1) { auto pixelMap = FFIData::GetData(smallIcon); if (pixelMap == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixelMap"); return false; } request.SetLittleIcon(pixelMap->GetRealPixelMap()); @@ -837,7 +837,7 @@ namespace Notification { if (largeIcon != -1) { auto pixelMap = FFI::FFIData::GetData(largeIcon); if (pixelMap == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixelMap"); return false; } request.SetBigIcon(pixelMap->GetRealPixelMap()); @@ -926,7 +926,7 @@ namespace Notification { free(notificationSlot.sound); notificationSlot.desc = nullptr; notificationSlot.sound = nullptr; - LOGE("SetNotificationSlotV2 malloc vibrationValues.head failed."); + LOGE("malloc vibrationValues.head failed"); return false; } int i = 0; @@ -1081,13 +1081,13 @@ namespace Notification { if (basicContent->GetLockScreenPicture()) { std::shared_ptr pix = basicContent->GetLockScreenPicture(); if (pix == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pix"); freeNotificationBasicContent(normal); return false; } auto native = FFIData::Create(pix); if (native == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null native"); freeNotificationBasicContent(normal); return false; } @@ -1117,18 +1117,18 @@ namespace Notification { CNotificationLongTextContentV2* longText) { if (basicContent == nullptr) { - LOGE("basicContent is null."); + LOGE("null basicContent"); return false; } if (longText == nullptr) { - LOGE("malloc CNotificationLongTextContent failed, longText is null."); + LOGE("null longText"); return false; } OHOS::Notification::NotificationLongTextContent *longTextContent = static_cast(basicContent); if (longTextContent == nullptr) { - LOGE("longTextContent is null"); + LOGE("null longTextContent"); return false; } // title: string @@ -1148,13 +1148,13 @@ namespace Notification { if (longTextContent->GetLockScreenPicture()) { std::shared_ptr pix = longTextContent->GetLockScreenPicture(); if (pix == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pix"); freeNotificationLongTextContent(longText); return false; } auto native = FFIData::Create(pix); if (native == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null native"); freeNotificationLongTextContent(longText); return false; } @@ -1181,13 +1181,13 @@ namespace Notification { CNotificationPictureContentV2* picture) { if (basicContent == nullptr) { - LOGE("basicContent is null"); + LOGE("null basicContent"); return false; } OHOS::Notification::NotificationPictureContent *pictureContent = static_cast(basicContent); if (pictureContent == nullptr) { - LOGE("pictureContent is null"); + LOGE("null pictureContent"); return false; } // title、text: string @@ -1201,13 +1201,13 @@ namespace Notification { // picture: image.PixelMap std::shared_ptr pix = pictureContent->GetBigPicture(); if (pix == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pix"); freeNotificationPictureContent(picture); return false; } auto native1 = FFIData::Create(pix); if (native1 == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null native1"); freeNotificationPictureContent(picture); return false; } @@ -1217,13 +1217,13 @@ namespace Notification { if (pictureContent->GetLockScreenPicture()) { std::shared_ptr pixx = pictureContent->GetLockScreenPicture(); if (pixx == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pixx"); freeNotificationPictureContent(picture); return false; } auto native2 = FFIData::Create(pixx); if (native2 == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null native2"); freeNotificationPictureContent(picture); return false; } @@ -1258,13 +1258,13 @@ namespace Notification { CNotificationMultiLineContentV2* multiLine) { if (basicContent == nullptr) { - LOGE("basicContent is null"); + LOGE("null basicContent"); return false; } OHOS::Notification::NotificationMultiLineContent *multiLineContent = static_cast(basicContent); if (multiLineContent == nullptr) { - LOGE("multiLineContent is null"); + LOGE("null multiLineContent"); return false; } // title、text、additionalText?: string @@ -1280,7 +1280,7 @@ namespace Notification { lines.head = static_cast(malloc(sizeof(char *) * vecs.size())); lines.size = static_cast(vecs.size()); if (lines.head == nullptr) { - LOGE("multiLineContent lines malloc failed"); + LOGE("null lines.head"); freeNotificationMultiLineContent(multiLine); return false; } @@ -1294,13 +1294,13 @@ namespace Notification { if (multiLineContent->GetLockScreenPicture()) { std::shared_ptr pix = multiLineContent->GetLockScreenPicture(); if (pix == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pix"); freeNotificationMultiLineContent(multiLine); return false; } auto native2 = FFIData::Create(pix); if (native2 == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null native2"); freeNotificationMultiLineContent(multiLine); return false; } @@ -1324,7 +1324,7 @@ namespace Notification { free(cCapsule.backgroundColor); cCapsule.title = nullptr; cCapsule.backgroundColor = nullptr; - LOGE("Invalid object pixelMap of icon"); + LOGE("null native"); return false; } cCapsule.icon = native->GetID(); @@ -1341,7 +1341,7 @@ namespace Notification { names.head = static_cast(malloc(sizeof(char *) * vecs.size())); names.size = static_cast(vecs.size()); if (names.head == nullptr) { - LOGE("NotificationButton names malloc failed"); + LOGE("null names.head"); return false; } int i = 0; @@ -1358,14 +1358,14 @@ namespace Notification { if (iconsVec.size()) { icons.head = static_cast(malloc(sizeof(int64_t) * iconsVec.size())); if (icons.head == nullptr) { - LOGE("NotificationButton icons malloc failed"); + LOGE("null icons.head"); return false; } for (auto vec : iconsVec) { // buttonIcon auto native = FFIData::Create(vec); if (native == nullptr) { - LOGE("Invalid object pixelMap of buttonIcons."); + LOGE("null native"); free(icons.head); freeCArrString(cButton.names); return false; @@ -1438,7 +1438,7 @@ namespace Notification { CNotificationSystemLiveViewContentV2* systemLiveView) { if (basicContent == nullptr) { - LOGE("basicContent is null."); + LOGE("null basicContent"); return false; } if (systemLiveView == nullptr) { @@ -1448,7 +1448,7 @@ namespace Notification { OHOS::Notification::NotificationLocalLiveViewContent *localLiveViewContent = static_cast(basicContent); if (localLiveViewContent == nullptr) { - LOGE("localLiveViewContent is null"); + LOGE("null localLiveViewContent"); return false; } @@ -1469,12 +1469,12 @@ namespace Notification { if (localLiveViewContent->GetLockScreenPicture()) { std::shared_ptr pix = localLiveViewContent->GetLockScreenPicture(); if (pix == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null pix"); return false; } auto native2 = FFIData::Create(pix); if (native2 == nullptr) { - LOGE("Invalid object pixelMap"); + LOGE("null native2"); return false; } systemLiveView->lockscreenPicture = native2->GetID(); @@ -1488,7 +1488,7 @@ namespace Notification { bool ret = false; std::shared_ptr basicContent = content->GetNotificationContent(); if (basicContent == nullptr) { - LOGE("content is null"); + LOGE("null basicContent"); return ret; } switch (type) { @@ -1564,7 +1564,7 @@ namespace Notification { CNotificationFlagsV2 ¬ificationFlags) { if (flags == nullptr) { - LOGE("flags is null"); + LOGE("null flags"); return false; } notificationFlags.soundEnabled = static_cast(flags->IsSoundEnabled()); @@ -1579,7 +1579,7 @@ namespace Notification { // content: NotificationContent std::shared_ptr content = request->GetContent(); if (!content) { - LOGE("content is nullptr"); + LOGE("null content"); return false; } if (!SetNotificationContentV2(content, notificationRequest.notificationContent)) { @@ -1620,7 +1620,7 @@ namespace Notification { CNotificationRequestV2 ¬ificationRequest) { if (request == nullptr) { - LOGE("request is nullptr"); + LOGE("null request"); return false; } InitNotificationRequest(notificationRequest); diff --git a/frameworks/core/common/src/ans_convert_enum.cpp b/frameworks/core/common/src/ans_convert_enum.cpp index 8bde20522ebe7195ae2494e239d8b320dfcc0e66..1e1f92db32b3a52ccccaa52b13432b167f042cfa 100644 --- a/frameworks/core/common/src/ans_convert_enum.cpp +++ b/frameworks/core/common/src/ans_convert_enum.cpp @@ -43,7 +43,7 @@ bool AnsEnumUtil::ContentTypeJSToC(const ContentType &inType, NotificationConten outType = NotificationContent::Type::LIVE_VIEW; break; default: - ANS_LOGE("ContentType %{public}d is an invalid value", inType); + ANS_LOGE("ContentType %{public}d", inType); return false; } return true; @@ -74,7 +74,7 @@ bool AnsEnumUtil::ContentTypeCToJS(const NotificationContent::Type &inType, Cont outType = ContentType::NOTIFICATION_CONTENT_LIVE_VIEW; break; default: - ANS_LOGE("ContentType %{public}d is an invalid value", inType); + ANS_LOGE("ContentType %{public}d", inType); return false; } return true; @@ -106,7 +106,7 @@ bool AnsEnumUtil::SlotTypeJSToC(const SlotType &inType, NotificationConstant::Sl outType = NotificationConstant::SlotType::OTHER; break; default: - ANS_LOGE("SlotType %{public}d is an invalid value", inType); + ANS_LOGE("SlotType %{public}d", inType); return false; } return true; @@ -140,7 +140,7 @@ bool AnsEnumUtil::SlotTypeCToJS(const NotificationConstant::SlotType &inType, Sl outType = SlotType::OTHER_TYPES; break; default: - ANS_LOGE("SlotType %{public}d is an invalid value", inType); + ANS_LOGE("SlotType %{public}d", inType); return false; } return true; @@ -166,7 +166,7 @@ bool AnsEnumUtil::SlotLevelJSToC(const SlotLevel &inLevel, NotificationSlot::Not outLevel = NotificationSlot::NotificationLevel::LEVEL_HIGH; break; default: - ANS_LOGE("SlotLevel %{public}d is an invalid value", inLevel); + ANS_LOGE("SlotLevel %{public}d", inLevel); return false; } return true; @@ -189,7 +189,7 @@ bool AnsEnumUtil::LiveViewStatusJSToC( outType = NotificationLiveViewContent::LiveViewStatus::LIVE_VIEW_FULL_UPDATE; break; default: - ANS_LOGE("LiveViewStatus %{public}d is an invalid value", inType); + ANS_LOGE("LiveViewStatus %{public}d", inType); return false; } @@ -213,7 +213,7 @@ bool AnsEnumUtil::LiveViewTypesJSToC( outType = NotificationLocalLiveViewContent::LiveViewTypes::LIVE_VIEW_INSTANT_BANNER; break; default: - ANS_LOGE("LiveViewTypes %{public}d is an invalid value", inType); + ANS_LOGE("LiveViewTypes %{public}d", inType); return false; } @@ -240,7 +240,7 @@ bool AnsEnumUtil::SlotLevelCToJS(const NotificationSlot::NotificationLevel &inLe outLevel = SlotLevel::LEVEL_HIGH; break; default: - ANS_LOGE("SlotLevel %{public}d is an invalid value", inLevel); + ANS_LOGE("SlotLevel %{public}d", inLevel); return false; } return true; @@ -372,7 +372,7 @@ void AnsEnumUtil::ReasonCToJSSecondExt(const int &inType, int &outType) break; default: outType = static_cast(RemoveReason::APP_CANCEL_REASON_OTHER); - ANS_LOGW("Reason %{public}d is an invalid value", inType); + ANS_LOGW("Reason %{public}d", inType); break; } } @@ -393,7 +393,7 @@ bool AnsEnumUtil::DoNotDisturbTypeJSToC(const DoNotDisturbType &inType, Notifica outType = NotificationConstant::DoNotDisturbType::CLEARLY; break; default: - ANS_LOGE("DoNotDisturbType %{public}d is an invalid value", inType); + ANS_LOGE("DoNotDisturbType %{public}d", inType); return false; } return true; @@ -415,7 +415,7 @@ bool AnsEnumUtil::DoNotDisturbTypeCToJS(const NotificationConstant::DoNotDisturb outType = DoNotDisturbType::TYPE_CLEARLY; break; default: - ANS_LOGE("DoNotDisturbType %{public}d is an invalid value", inType); + ANS_LOGE("DoNotDisturbType %{public}d", inType); return false; } return true; @@ -437,7 +437,7 @@ bool AnsEnumUtil::DeviceRemindTypeCToJS(const NotificationConstant::RemindType & outType = DeviceRemindType::ACTIVE_REMIND; break; default: - ANS_LOGE("DeviceRemindType %{public}d is an invalid value", inType); + ANS_LOGE("DeviceRemindType %{public}d", inType); return false; } return true; @@ -456,7 +456,7 @@ bool AnsEnumUtil::SourceTypeCToJS(const NotificationConstant::SourceType &inType outType = SourceType::TYPE_TIMER; break; default: - ANS_LOGE("SourceType %{public}d is an invalid value", inType); + ANS_LOGE("SourceType %{public}d", inType); return false; } return true; @@ -479,7 +479,7 @@ bool AnsEnumUtil::LiveViewStatusCToJS(const NotificationLiveViewContent::LiveVie outType = LiveViewStatus::LIVE_VIEW_FULL_UPDATE; break; default: - ANS_LOGE("LiveViewStatus %{public}d is an invalid value", inType); + ANS_LOGE("LiveViewStatus %{public}d", inType); return false; } @@ -502,7 +502,7 @@ bool AnsEnumUtil::LiveViewTypesCToJS(const NotificationLocalLiveViewContent::Liv outType = LiveViewTypes::LIVE_VIEW_INSTANT_BANNER; break; default: - ANS_LOGE("LiveViewTypes %{public}d is an invalid value", inType); + ANS_LOGE("LiveViewTypes %{public}d", inType); return false; } diff --git a/frameworks/core/src/ans_image_util.cpp b/frameworks/core/src/ans_image_util.cpp index f5c2458bbae60e7d27ff957b8607eed600609c3f..01b413ad398641d2861a219c0556e623cd9bd042 100644 --- a/frameworks/core/src/ans_image_util.cpp +++ b/frameworks/core/src/ans_image_util.cpp @@ -53,7 +53,7 @@ std::string AnsImageUtil::PackImage(const std::shared_ptr &pixe } auto pbuf = new (std::nothrow) uint8_t [size]; if (pbuf == nullptr) { - ANS_LOGE("create buffer failed"); + ANS_LOGE("null pbuf"); return {}; } diff --git a/frameworks/core/src/ans_notification.cpp b/frameworks/core/src/ans_notification.cpp index f00768a4fa25bb43550eb365b28a84ab0473bab4..3c4aaa3e2c7bf5a5e33934664eae1d68d6f31d35 100644 --- a/frameworks/core/src/ans_notification.cpp +++ b/frameworks/core/src/ans_notification.cpp @@ -76,7 +76,7 @@ ErrCode AnsNotification::AddNotificationSlots(const std::vector slot = new (std::nothrow) NotificationSlot(*it); if (slot == nullptr) { - ANS_LOGE("Failed to create NotificationSlot ptr."); + ANS_LOGE("null slot"); return ERR_ANS_NO_MEMORY; } slotsSptr.emplace_back(slot); @@ -84,7 +84,7 @@ ErrCode AnsNotification::AddNotificationSlots(const std::vector MAX_SLOT_NUM) { - ANS_LOGE("[AddSlots] fail: slotsSize over max size."); + ANS_LOGE("slotsSize over max size"); return ERR_ANS_INVALID_PARAM; } @@ -93,7 +93,7 @@ ErrCode AnsNotification::AddNotificationSlots(const std::vector proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -148,7 +148,7 @@ ErrCode AnsNotification::GetNotificationSlotNumAsBundle(const NotificationBundle sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[GetSlotNumAsBundle] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetSlotNumAsBundle(bo, num); @@ -170,7 +170,7 @@ ErrCode AnsNotification::GetNotificationSlotFlagsAsBundle(const NotificationBund sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetSlotFlagsAsBundle(bo, slotFlags); @@ -194,8 +194,7 @@ ErrCode AnsNotification::SetNotificationSlotFlagsAsBundle(const NotificationBund ANS_LOGE("Invalid bundle name."); return ERR_ANS_INVALID_PARAM; } - ANS_LOGI("SetNotificationSlotFlagsAsBundle,bundleName:%{public}s, %{public}d", - bundleOption.GetBundleName().c_str(), (int)slotFlags); + ANS_LOGI("bundleName:%{public}s, %{public}d", bundleOption.GetBundleName().c_str(), (int)slotFlags); sptr proxy = GetAnsManagerProxy(); if (!proxy) { @@ -206,12 +205,12 @@ ErrCode AnsNotification::SetNotificationSlotFlagsAsBundle(const NotificationBund sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[SetSlotFlagsAsBundle] fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } if (slotFlags > MAX_SLOT_FLAGS) { - ANS_LOGE("[SetSlotFlagsAsBundle] fail: Invalid slotFlags."); + ANS_LOGE("Invalid slotFlags"); return ERR_ANS_INVALID_PARAM; } // got the LSB 6 bits as slotflags; @@ -222,7 +221,7 @@ ErrCode AnsNotification::SetNotificationSlotFlagsAsBundle(const NotificationBund ErrCode AnsNotification::PublishNotification(const NotificationRequest &request, const std::string &instanceKey) { - ANS_LOGD("enter"); + ANS_LOGD("called"); return PublishNotification(std::string(), request, instanceKey); } @@ -230,7 +229,7 @@ ErrCode AnsNotification::PublishNotification(const std::string &label, const Not const std::string &instanceKey) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGI("PublishNotification,notificationId:%{public}u", request.GetNotificationId()); + ANS_LOGI("called, notificationId:%{public}u", request.GetNotificationId()); if (request.GetContent() == nullptr || request.GetNotificationType() == NotificationContent::Type::NONE) { ANS_LOGE("Refuse to publish the notification without valid content"); @@ -266,7 +265,7 @@ ErrCode AnsNotification::PublishNotification(const std::string &label, const Not sptr reqPtr = new (std::nothrow) NotificationRequest(request); if (reqPtr == nullptr) { - ANS_LOGE("Create notificationRequest ptr fail."); + ANS_LOGE("null reqPtr"); return ERR_ANS_NO_MEMORY; } if (IsNonDistributedNotificationType(reqPtr->GetNotificationType())) { @@ -319,7 +318,7 @@ ErrCode AnsNotification::PublishNotificationForIndirectProxy(const NotificationR sptr reqPtr = new (std::nothrow) NotificationRequest(request); if (reqPtr == nullptr) { - ANS_LOGE("Create notificationRequest ptr fail."); + ANS_LOGE("null reqPtr"); return ERR_ANS_NO_MEMORY; } if (IsNonDistributedNotificationType(reqPtr->GetNotificationType())) { @@ -339,7 +338,7 @@ ErrCode AnsNotification::CancelNotification(int32_t notificationId, const std::s ErrCode AnsNotification::CancelNotification(const std::string &label, int32_t notificationId, const std::string &instanceKey) { - ANS_LOGI("enter CancelNotification,notificationId:%{public}d", notificationId); + ANS_LOGI("called, notificationId:%{public}d", notificationId); NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); sptr proxy = GetAnsManagerProxy(); if (!proxy) { @@ -351,7 +350,7 @@ ErrCode AnsNotification::CancelNotification(const std::string &label, int32_t no ErrCode AnsNotification::CancelAllNotifications(const std::string &instanceKey) { - ANS_LOGI("CancelAllNotifications called."); + ANS_LOGI("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { @@ -364,7 +363,7 @@ ErrCode AnsNotification::CancelAllNotifications(const std::string &instanceKey) ErrCode AnsNotification::CancelAsBundle( int32_t notificationId, const std::string &representativeBundle, int32_t userId) { - ANS_LOGI("enter CancelAsBundle,notificationId:%{public}d", notificationId); + ANS_LOGI("called, notificationId:%{public}d", notificationId); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -376,7 +375,7 @@ ErrCode AnsNotification::CancelAsBundle( ErrCode AnsNotification::CancelAsBundle( const NotificationBundleOption &bundleOption, int32_t notificationId) { - ANS_LOGI("enter CancelAsBundle,notificationId:%{public}d", notificationId); + ANS_LOGI("called, notificationId:%{public}d", notificationId); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -462,7 +461,7 @@ ErrCode AnsNotification::PublishNotificationAsBundle( sptr reqPtr = new (std::nothrow) NotificationRequest(request); if (reqPtr == nullptr) { - ANS_LOGE("Failed to create NotificationRequest ptr"); + ANS_LOGE("null reqPtr"); return ERR_ANS_NO_MEMORY; } if (IsNonDistributedNotificationType(reqPtr->GetNotificationType())) { @@ -507,7 +506,7 @@ ErrCode AnsNotification::IsAllowedNotify(bool &allowed) ErrCode AnsNotification::IsAllowedNotifySelf(bool &allowed) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -519,7 +518,7 @@ ErrCode AnsNotification::IsAllowedNotifySelf(bool &allowed) ErrCode AnsNotification::CanPopEnableNotificationDialog(sptr &hostClient, bool &canPop, std::string &bundleName) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -530,7 +529,7 @@ ErrCode AnsNotification::CanPopEnableNotificationDialog(sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -543,14 +542,14 @@ ErrCode AnsNotification::RequestEnableNotification(std::string &deviceId, sptr &hostClient, sptr &callerToken) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); return ERR_ANS_SERVICE_NOT_CONNECTED; } if (hostClient == nullptr) { - ANS_LOGE("[RequestEnableNotification] fail: hostClient is null"); + ANS_LOGE("null hostClient"); return ERR_ANS_INVALID_PARAM; } if (callerToken == nullptr) { @@ -561,7 +560,7 @@ ErrCode AnsNotification::RequestEnableNotification(std::string &deviceId, ErrCode AnsNotification::RequestEnableNotification(const std::string bundleName, const int32_t uid) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -608,7 +607,7 @@ ErrCode AnsNotification::SubscribeNotification(const NotificationSubscriber &sub sptr subscriberSptr = subscriber.GetImpl(); if (subscriberSptr == nullptr) { - ANS_LOGE("Failed to subscribe with SubscriberImpl null ptr."); + ANS_LOGE("null subscriberSptr"); return ERR_ANS_INVALID_PARAM; } return proxy->Subscribe(subscriberSptr); @@ -625,7 +624,7 @@ ErrCode AnsNotification::SubscribeNotificationSelf(const NotificationSubscriber sptr subscriberSptr = subscriber.GetImpl(); if (subscriberSptr == nullptr) { - ANS_LOGE("Failed to subscribeSelf with SubscriberImpl null ptr."); + ANS_LOGE("null subscriberSptr"); return ERR_ANS_INVALID_PARAM; } return proxy->SubscribeSelf(subscriberSptr); @@ -643,7 +642,7 @@ ErrCode AnsNotification::SubscribeLocalLiveViewNotification(const NotificationLo sptr subscriberSptr = subscriber.GetImpl(); if (subscriberSptr == nullptr) { - ANS_LOGE("Failed to subscribe with SubscriberImpl null ptr."); + ANS_LOGE("null subscriberSptr"); return ERR_ANS_INVALID_PARAM; } return proxy->SubscribeLocalLiveView(subscriberSptr, isNative); @@ -661,13 +660,13 @@ ErrCode AnsNotification::SubscribeNotification( sptr sptrInfo = new (std::nothrow) NotificationSubscribeInfo(subscribeInfo); if (sptrInfo == nullptr) { - ANS_LOGE("Failed to create NotificationSubscribeInfo ptr."); + ANS_LOGE("null sptrInfo"); return ERR_ANS_NO_MEMORY; } sptr subscriberSptr = subscriber.GetImpl(); if (subscriberSptr == nullptr) { - ANS_LOGE("Failed to subscribe with SubscriberImpl null ptr."); + ANS_LOGE("null subscriberSptr"); return ERR_ANS_INVALID_PARAM; } if (!subscribeInfo.GetDeviceType().empty()) { @@ -687,7 +686,7 @@ ErrCode AnsNotification::UnSubscribeNotification(NotificationSubscriber &subscri sptr subscriberSptr = subscriber.GetImpl(); if (subscriberSptr == nullptr) { - ANS_LOGE("Failed to unsubscribe with SubscriberImpl null ptr."); + ANS_LOGE("null subscriberSptr"); return ERR_ANS_INVALID_PARAM; } return proxy->Unsubscribe(subscriberSptr); @@ -705,13 +704,13 @@ ErrCode AnsNotification::UnSubscribeNotification( sptr sptrInfo = new (std::nothrow) NotificationSubscribeInfo(subscribeInfo); if (sptrInfo == nullptr) { - ANS_LOGE("Failed to create NotificationSubscribeInfo ptr."); + ANS_LOGE("null sptrInfo"); return ERR_ANS_NO_MEMORY; } sptr subscriberSptr = subscriber.GetImpl(); if (subscriberSptr == nullptr) { - ANS_LOGE("Failed to unsubscribe with SubscriberImpl null ptr."); + ANS_LOGE("null subscriberSptr"); return ERR_ANS_INVALID_PARAM; } return proxy->Unsubscribe(subscriberSptr, sptrInfo); @@ -727,7 +726,7 @@ ErrCode AnsNotification::SubscribeNotificationSelf(const std::shared_ptr listener = nullptr; CreateSubscribeListener(subscriber, listener); if (listener == nullptr) { - ANS_LOGE("Failed to subscribe due to create subscriber listener failed."); + ANS_LOGE("null listener"); return ERR_ANS_NO_MEMORY; } DelayedSingleton::GetInstance()->SubscribeSAManager(); @@ -752,7 +751,7 @@ ErrCode AnsNotification::SubscribeNotification(const std::shared_ptr listener = nullptr; CreateSubscribeListener(subscriber, listener); if (listener == nullptr) { - ANS_LOGE("Failed to subscribe due to create subscriber listener failed."); + ANS_LOGE("null listener"); return ERR_ANS_NO_MEMORY; } if (subscribeInfo != nullptr && !subscribeInfo->GetDeviceType().empty()) { @@ -790,7 +789,7 @@ ErrCode AnsNotification::UnSubscribeNotification(const std::shared_ptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); sptr button(new (std::nothrow) NotificationButtonOption(buttonOption)); if (bo == nullptr) { - ANS_LOGE("[TriggerLocalLiveView] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->TriggerLocalLiveView(bo, notificationId, button); @@ -847,8 +846,7 @@ ErrCode AnsNotification::TriggerLocalLiveView(const NotificationBundleOption &bu ErrCode AnsNotification::RemoveNotification(const std::string &key, int32_t removeReason) { - ANS_LOGI("enter RemoveNotification,key:%{public}s,removeReason:%{public}d", - key.c_str(), removeReason); + ANS_LOGI("called, key:%{public}s,removeReason:%{public}d", key.c_str(), removeReason); NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (key.empty()) { ANS_LOGW("Input key is empty."); @@ -866,7 +864,7 @@ ErrCode AnsNotification::RemoveNotification(const std::string &key, int32_t remo ErrCode AnsNotification::RemoveNotification(const NotificationBundleOption &bundleOption, const int32_t notificationId, const std::string &label, int32_t removeReason) { - ANS_LOGI("enter RemoveNotification,bundle:%{public}s,Id:%{public}d,reason:%{public}d label:%{public}s", + ANS_LOGI("called, bundle:%{public}s,Id:%{public}d,reason:%{public}d label:%{public}s", bundleOption.GetBundleName().c_str(), notificationId, removeReason, label.c_str()); NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (bundleOption.GetBundleName().empty()) { @@ -882,7 +880,7 @@ ErrCode AnsNotification::RemoveNotification(const NotificationBundleOption &bund sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[RemoveNotification] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->RemoveNotification(bo, notificationId, label, removeReason); @@ -890,7 +888,7 @@ ErrCode AnsNotification::RemoveNotification(const NotificationBundleOption &bund ErrCode AnsNotification::RemoveAllNotifications(const NotificationBundleOption &bundleOption) { - ANS_LOGI("enter RemoveAllNotifications,bundleName:%{public}s", bundleOption.GetBundleName().c_str()); + ANS_LOGI("called, bundleName:%{public}s", bundleOption.GetBundleName().c_str()); if (bundleOption.GetBundleName().empty()) { ANS_LOGE("Invalid bundle name."); return ERR_ANS_INVALID_PARAM; @@ -904,7 +902,7 @@ ErrCode AnsNotification::RemoveAllNotifications(const NotificationBundleOption & sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[RemoveAllNotifications] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->RemoveAllNotifications(bo); @@ -912,7 +910,7 @@ ErrCode AnsNotification::RemoveAllNotifications(const NotificationBundleOption & ErrCode AnsNotification::RemoveNotifications(const std::vector hashcodes, int32_t removeReason) { - ANS_LOGI("enter RemoveNotifications,removeReason:%{public}d", removeReason); + ANS_LOGI("called, removeReason:%{public}d", removeReason); if (hashcodes.empty()) { ANS_LOGE("Hashcodes is empty"); return ERR_ANS_INVALID_PARAM; @@ -929,7 +927,7 @@ ErrCode AnsNotification::RemoveNotifications(const std::vector hash ErrCode AnsNotification::RemoveNotificationsByBundle(const NotificationBundleOption &bundleOption) { - ANS_LOGI("enter RemoveNotificationsByBundle,bundleName:%{public}s", bundleOption.GetBundleName().c_str()); + ANS_LOGI("called, bundleName:%{public}s", bundleOption.GetBundleName().c_str()); if (bundleOption.GetBundleName().empty()) { ANS_LOGE("Invalid bundle name."); return ERR_ANS_INVALID_PARAM; @@ -943,7 +941,7 @@ ErrCode AnsNotification::RemoveNotificationsByBundle(const NotificationBundleOpt sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[DeleteByBundle] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->DeleteByBundle(bo); @@ -975,7 +973,7 @@ ErrCode AnsNotification::GetNotificationSlotsForBundle( sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[GetSlotsByBundle] fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetSlotsByBundle(bo, slots); @@ -998,7 +996,7 @@ ErrCode AnsNotification::GetNotificationSlotForBundle( sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[GetSlotByBundle] fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetSlotByBundle(bo, slotType, slot); @@ -1021,18 +1019,18 @@ ErrCode AnsNotification::UpdateNotificationSlots( sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } if (slots.empty()) { - ANS_LOGE("Fail: slots is empty."); + ANS_LOGE("empty slots"); return ERR_ANS_INVALID_PARAM; } size_t slotSize = slots.size(); if (slotSize > MAX_SLOT_NUM) { - ANS_LOGE("[UpdateSlots] fail: slotSize over max size."); + ANS_LOGE("slotSize over max size"); return ERR_ANS_INVALID_PARAM; } @@ -1058,7 +1056,7 @@ ErrCode AnsNotification::GetAllActiveNotifications( return ERR_ANS_SERVICE_NOT_CONNECTED; } if (key.empty()) { - ANS_LOGE("[GetSpecialActiveNotifications] fail: key is empty."); + ANS_LOGE("empty key"); return ERR_ANS_INVALID_PARAM; } return proxy->GetSpecialActiveNotifications(key, notification); @@ -1084,7 +1082,7 @@ ErrCode AnsNotification::GetActiveNotificationByFilter(const LiveViewFilter &fil sptr bo(new (std::nothrow) NotificationBundleOption(filter.bundle)); if (bo == nullptr) { - ANS_LOGE("[GetActiveNotificationByFilter] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetActiveNotificationByFilter(bo, filter.notificationKey.id, filter.notificationKey.label, @@ -1106,7 +1104,7 @@ ErrCode AnsNotification::IsAllowedNotify(const NotificationBundleOption &bundleO sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundle is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->IsSpecialBundleAllowedNotify(bo, allowed); @@ -1149,7 +1147,7 @@ ErrCode AnsNotification::SetNotificationsEnabledForSpecifiedBundle( sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundle is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->SetNotificationsEnabledForSpecialBundle(deviceId, bo, enabled, true); @@ -1170,7 +1168,7 @@ ErrCode AnsNotification::SetShowBadgeEnabledForBundle(const NotificationBundleOp sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundle is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->SetShowBadgeEnabledForBundle(bo, enabled); @@ -1191,7 +1189,7 @@ ErrCode AnsNotification::GetShowBadgeEnabledForBundle(const NotificationBundleOp sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundle is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetShowBadgeEnabledForBundle(bo, enabled); @@ -1210,7 +1208,7 @@ ErrCode AnsNotification::GetShowBadgeEnabled(bool &enabled) ErrCode AnsNotification::CancelGroup(const std::string &groupName, const std::string &instanceKey) { - ANS_LOGI("enter CancelGroup,groupName:%{public}s", groupName.c_str()); + ANS_LOGI("called,groupName:%{public}s", groupName.c_str()); if (groupName.empty()) { ANS_LOGE("Invalid group name."); return ERR_ANS_INVALID_PARAM; @@ -1227,7 +1225,7 @@ ErrCode AnsNotification::CancelGroup(const std::string &groupName, const std::st ErrCode AnsNotification::RemoveGroupByBundle( const NotificationBundleOption &bundleOption, const std::string &groupName) { - ANS_LOGI("enter RemoveGroupByBundle,bundleName:%{public}s", bundleOption.GetBundleName().c_str()); + ANS_LOGI("called, bundleName:%{public}s", bundleOption.GetBundleName().c_str()); if (bundleOption.GetBundleName().empty() || groupName.empty()) { ANS_LOGE("Invalid parameter."); return ERR_ANS_INVALID_PARAM; @@ -1253,13 +1251,13 @@ ErrCode AnsNotification::SetDoNotDisturbDate(const NotificationDoNotDisturbDate auto dndDatePtr = new (std::nothrow) NotificationDoNotDisturbDate(doNotDisturbDate); if (dndDatePtr == nullptr) { - ANS_LOGE("Create notificationDoNotDisturbDate failed."); + ANS_LOGE("null dndDatePtr"); return ERR_ANS_NO_MEMORY; } sptr dndDate(dndDatePtr); if (dndDate == nullptr) { - ANS_LOGE("Fail: dndDate is nullptr."); + ANS_LOGE("null dndDate"); return ERR_ANS_INVALID_PARAM; } return proxy->SetDoNotDisturbDate(dndDate); @@ -1383,7 +1381,7 @@ ErrCode AnsNotification::PublishContinuousTaskNotification(const NotificationReq auto pReq = new (std::nothrow) NotificationRequest(request); if (pReq == nullptr) { - ANS_LOGE("Failed to create NotificationRequest ptr."); + ANS_LOGE("null pReq"); return ERR_ANS_NO_MEMORY; } @@ -1392,7 +1390,7 @@ ErrCode AnsNotification::PublishContinuousTaskNotification(const NotificationReq sptrReq->SetDistributed(false); } if (sptrReq == nullptr) { - ANS_LOGE("[PublishContinuousTaskNotification] fail: notification request is null ptr."); + ANS_LOGE("null sptrReq"); return ERR_ANS_INVALID_PARAM; } return proxy->PublishContinuousTaskNotification(sptrReq); @@ -1400,7 +1398,7 @@ ErrCode AnsNotification::PublishContinuousTaskNotification(const NotificationReq ErrCode AnsNotification::CancelContinuousTaskNotification(const std::string &label, int32_t notificationId) { - ANS_LOGI("enter CancelContinuousTaskNotification,notificationId:%{public}d", notificationId); + ANS_LOGI("called, notificationId:%{public}d", notificationId); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -1442,7 +1440,7 @@ ErrCode AnsNotification::EnableDistributedByBundle(const NotificationBundleOptio sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundle is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->EnableDistributedByBundle(bo, enabled); @@ -1469,7 +1467,7 @@ ErrCode AnsNotification::IsDistributedEnableByBundle(const NotificationBundleOpt sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundle is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->IsDistributedEnableByBundle(bo, enabled); @@ -1493,7 +1491,7 @@ void AnsNotification::ResetAnsManagerProxy() void AnsNotification::Reconnect() { - ANS_LOGD("enter"); + ANS_LOGD("called"); for (int32_t i = 0; i < MAX_RETRY_TIME; i++) { // try to connect ans sptr proxy = GetAnsManagerProxy(); @@ -1546,7 +1544,7 @@ bool AnsNotification::CanPublishMediaContent(const NotificationRequest &request) auto media = std::static_pointer_cast(request.GetContent()->GetNotificationContent()); if (media == nullptr) { - ANS_LOGE("Failed to get media content."); + ANS_LOGE("null media"); return false; } @@ -1577,7 +1575,7 @@ bool AnsNotification::CanPublishLiveViewContent(const NotificationRequest &reque auto content = request.GetContent()->GetNotificationContent(); auto liveView = std::static_pointer_cast(content); if (liveView == nullptr) { - ANS_LOGE("Failed to get live view content."); + ANS_LOGE("null liveView"); return false; } @@ -1723,13 +1721,13 @@ ErrCode AnsNotification::SetDoNotDisturbDate(const int32_t &userId, auto dndDatePtr = new (std::nothrow) NotificationDoNotDisturbDate(doNotDisturbDate); if (dndDatePtr == nullptr) { - ANS_LOGE("create DoNotDisturbDate failed."); + ANS_LOGE("null dndDatePtr"); return ERR_ANS_NO_MEMORY; } sptr dndDate(dndDatePtr); if (dndDate == nullptr) { - ANS_LOGE("Fail: dndDate is nullptr."); + ANS_LOGE("null dndDate"); return ERR_ANS_INVALID_PARAM; } return proxy->SetDoNotDisturbDate(dndDate); @@ -1781,7 +1779,7 @@ ErrCode AnsNotification::SetEnabledForBundleSlot(const NotificationBundleOption sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->SetEnabledForBundleSlot(bo, slotType, enabled, isForceControl); @@ -1803,7 +1801,7 @@ ErrCode AnsNotification::GetEnabledForBundleSlot( sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("[GetEnabledForBundleSlot] fail: bundle is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->GetEnabledForBundleSlot(bo, slotType, enabled); @@ -1889,7 +1887,7 @@ ErrCode AnsNotification::SetBadgeNumberByBundle(const NotificationBundleOption & sptr bundleInfo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bundleInfo == nullptr) { - ANS_LOGE("Unable to create new bundle info."); + ANS_LOGE("null bundleInfo"); return ERR_ANS_NO_MEMORY; } return proxy->SetBadgeNumberByBundle(bundleInfo, badgeNumber); @@ -1914,7 +1912,7 @@ ErrCode AnsNotification::SetBadgeNumberForDhByBundle( sptr bundleInfo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bundleInfo == nullptr) { - ANS_LOGE("Unable to create new bundle info."); + ANS_LOGE("null bundleInfo"); return ERR_ANS_NO_MEMORY; } return proxy->SetBadgeNumberForDhByBundle(bundleInfo, badgeNumber); @@ -1992,7 +1990,7 @@ ErrCode AnsNotification::SetAdditionConfig(const std::string &key, const std::st ErrCode AnsNotification::SetDistributedEnabledByBundle(const NotificationBundleOption &bundleOption, const std::string &deviceType, const bool enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (bundleOption.GetBundleName().empty() || deviceType.empty()) { ANS_LOGE("Invalid bundle name."); return ERR_ANS_INVALID_PARAM; @@ -2006,7 +2004,7 @@ ErrCode AnsNotification::SetDistributedEnabledByBundle(const NotificationBundleO sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->SetDistributedEnabledByBundle(bo, deviceType, enabled); @@ -2014,7 +2012,7 @@ ErrCode AnsNotification::SetDistributedEnabledByBundle(const NotificationBundleO ErrCode AnsNotification::SetDistributedEnabled(const std::string &deviceType, const bool &enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (deviceType.empty()) { ANS_LOGE("Invalid deviceType."); return ERR_ANS_INVALID_PARAM; @@ -2031,7 +2029,7 @@ ErrCode AnsNotification::SetDistributedEnabled(const std::string &deviceType, co ErrCode AnsNotification::IsDistributedEnabled(const std::string &deviceType, bool &enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (deviceType.empty()) { ANS_LOGE("Invalid deviceType."); return ERR_ANS_INVALID_PARAM; @@ -2048,7 +2046,7 @@ ErrCode AnsNotification::IsDistributedEnabled(const std::string &deviceType, boo ErrCode AnsNotification::GetDistributedAbility(int32_t &abilityId) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2061,7 +2059,7 @@ ErrCode AnsNotification::GetDistributedAbility(int32_t &abilityId) ErrCode AnsNotification::GetDistributedAuthStatus( const std::string &deviceType, const std::string &deviceId, int32_t userId, bool &isAuth) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (deviceType.empty() || deviceId.empty()) { ANS_LOGE("Invalid deviceType or deviceId."); return ERR_ANS_INVALID_PARAM; @@ -2079,7 +2077,7 @@ ErrCode AnsNotification::GetDistributedAuthStatus( ErrCode AnsNotification::SetDistributedAuthStatus( const std::string &deviceType, const std::string &deviceId, int32_t userId, bool isAuth) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (deviceType.empty() || deviceId.empty()) { ANS_LOGE("Invalid deviceType or deviceId."); return ERR_ANS_INVALID_PARAM; @@ -2097,7 +2095,7 @@ ErrCode AnsNotification::SetDistributedAuthStatus( ErrCode AnsNotification::IsDistributedEnabledByBundle(const NotificationBundleOption &bundleOption, const std::string &deviceType, bool &enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (bundleOption.GetBundleName().empty() || deviceType.empty()) { ANS_LOGE("Invalid bundle name."); return ERR_ANS_INVALID_PARAM; @@ -2111,7 +2109,7 @@ ErrCode AnsNotification::IsDistributedEnabledByBundle(const NotificationBundleOp sptr bo(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bo == nullptr) { - ANS_LOGE("Fail: bundleOption is empty."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } return proxy->IsDistributedEnabledByBundle(bo, deviceType, enabled); @@ -2119,7 +2117,7 @@ ErrCode AnsNotification::IsDistributedEnabledByBundle(const NotificationBundleOp ErrCode AnsNotification::SetSmartReminderEnabled(const std::string &deviceType, const bool enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2132,7 +2130,7 @@ ErrCode AnsNotification::SetSmartReminderEnabled(const std::string &deviceType, ErrCode AnsNotification::SetDistributedEnabledBySlot( const NotificationConstant::SlotType &slotType, const std::string &deviceType, const bool enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2145,7 +2143,7 @@ ErrCode AnsNotification::SetDistributedEnabledBySlot( ErrCode AnsNotification::IsDistributedEnabledBySlot( const NotificationConstant::SlotType &slotType, const std::string &deviceType, bool &enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2157,7 +2155,7 @@ ErrCode AnsNotification::IsDistributedEnabledBySlot( ErrCode AnsNotification::CancelAsBundleWithAgent(const NotificationBundleOption &bundleOption, const int32_t id) { - ANS_LOGI("enter CancelAsBundleWithAgent,bundleName:%{public}s,id:%{public}d", + ANS_LOGI("called, bundleName:%{public}s,id:%{public}d", bundleOption.GetBundleName().c_str(), id); sptr proxy = GetAnsManagerProxy(); if (!proxy) { @@ -2167,7 +2165,7 @@ ErrCode AnsNotification::CancelAsBundleWithAgent(const NotificationBundleOption sptr bundle(new (std::nothrow) NotificationBundleOption(bundleOption)); if (bundle == nullptr) { - ANS_LOGE("Bundle is empty."); + ANS_LOGE("null bundle"); return ERR_ANS_INVALID_PARAM; } return proxy->CancelAsBundleWithAgent(bundle, id); @@ -2175,7 +2173,7 @@ ErrCode AnsNotification::CancelAsBundleWithAgent(const NotificationBundleOption ErrCode AnsNotification::IsSmartReminderEnabled(const std::string &deviceType, bool &enabled) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2188,7 +2186,7 @@ ErrCode AnsNotification::IsSmartReminderEnabled(const std::string &deviceType, b ErrCode AnsNotification::SetTargetDeviceStatus(const std::string &deviceType, const uint32_t status, const std::string deviceId) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2201,7 +2199,7 @@ ErrCode AnsNotification::SetTargetDeviceStatus(const std::string &deviceType, co ErrCode AnsNotification::SetTargetDeviceStatus(const std::string &deviceType, const uint32_t status, const uint32_t controlFlag, const std::string deviceId, int32_t userId) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2235,7 +2233,7 @@ ErrCode AnsNotification::SetTargetDeviceSwitch(const std::string& deviceType, co ErrCode AnsNotification::GetTargetDeviceStatus(const std::string &deviceType, int32_t &status) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("UnregisterPushCallback fail."); @@ -2280,7 +2278,7 @@ ErrCode AnsNotification::GetDoNotDisturbProfile(int64_t id, sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("Fail to GetAnsManagerProxy."); @@ -2318,7 +2316,7 @@ void AnsNotification::OnServiceDied() #ifdef NOTIFICATION_SMART_REMINDER_SUPPORTED ErrCode AnsNotification::RegisterSwingCallback(const std::function swingCbFunc) { - ANS_LOGD("enter"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("RegisterSwingCallback fail."); @@ -2326,7 +2324,7 @@ ErrCode AnsNotification::RegisterSwingCallback(const std::functionRegisterSwingCallback(swingCallBackService_->AsObject()); @@ -2345,7 +2343,7 @@ ErrCode AnsNotification::UpdateNotificationTimerByUid(const int32_t uid, const b ErrCode AnsNotification::DisableNotificationFeature(const NotificationDisable ¬ificationDisable) { - ANS_LOGD("enter DisableNotificationFeature"); + ANS_LOGD("called"); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("DisableNotificationFeature fail"); @@ -2353,7 +2351,7 @@ ErrCode AnsNotification::DisableNotificationFeature(const NotificationDisable &n } sptr reqPtr = new (std::nothrow) NotificationDisable(notificationDisable); if (reqPtr == nullptr) { - ANS_LOGE("failed to create NotificationDisable ptr"); + ANS_LOGE("null reqPtr"); return ERR_ANS_NO_MEMORY; } return proxy->DisableNotificationFeature(reqPtr); @@ -2364,7 +2362,7 @@ ErrCode AnsNotification::DistributeOperation(sptr& op { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (operationInfo == nullptr || callback == nullptr) { - ANS_LOGE("Input hashCode is empty."); + ANS_LOGE("null operationInfo or callback"); return ERR_ANS_INVALID_PARAM; } @@ -2405,7 +2403,7 @@ ErrCode AnsNotification::GetNotificationRequestByHashCode( ErrCode AnsNotification::SetHashCodeRule( const uint32_t type) { - ANS_LOGI("SetHashCodeRule type = %{public}d", type); + ANS_LOGI("called, type = %{public}d", type); NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); sptr proxy = GetAnsManagerProxy(); diff --git a/frameworks/core/src/listener/ans_subscriber_listener.cpp b/frameworks/core/src/listener/ans_subscriber_listener.cpp index 5dd8a780fbcf1e32abf9fc43f560e636f7fdfc26..f70f06d93a1ac092587e1b8f051f93031f190c64 100644 --- a/frameworks/core/src/listener/ans_subscriber_listener.cpp +++ b/frameworks/core/src/listener/ans_subscriber_listener.cpp @@ -34,7 +34,7 @@ ErrCode SubscriberListener::OnConnected() NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnConnected(); @@ -46,7 +46,7 @@ ErrCode SubscriberListener::OnDisconnected() NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnDisconnected(); @@ -59,11 +59,11 @@ ErrCode SubscriberListener::OnConsumed( NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } if (notificationMap == nullptr) { - ANS_LOGE("OnConsumed fail cause notificationMap is null."); + ANS_LOGE("null notificationMap"); return ERR_INVALID_DATA; } std::shared_ptr sharedNotification = std::make_shared(*notification); @@ -116,7 +116,7 @@ ErrCode SubscriberListener::OnCanceled( NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } if (notificationMap == nullptr) { @@ -150,7 +150,7 @@ void SubscriberListener::OnBatchCanceled(const std::vector> & { auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return; } std::vector> notificationList; @@ -172,7 +172,7 @@ ErrCode SubscriberListener::OnCanceledList(const std::vector> NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } if (subscriber->HasOnBatchCancelCallback()) { @@ -195,7 +195,7 @@ ErrCode SubscriberListener::OnUpdated(const sptr ¬ifi { auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnUpdate(std::make_shared(*notificationMap)); @@ -206,7 +206,7 @@ ErrCode SubscriberListener::OnDoNotDisturbDateChange(const sptrOnDoNotDisturbDateChange(std::make_shared(*date)); @@ -219,7 +219,7 @@ ErrCode SubscriberListener::OnEnabledNotificationChanged( NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnEnabledNotificationChanged(std::make_shared(*callbackData)); @@ -231,7 +231,7 @@ ErrCode SubscriberListener::OnBadgeChanged(const sptr & NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnBadgeChanged(std::make_shared(*badgeData)); @@ -244,7 +244,7 @@ ErrCode SubscriberListener::OnBadgeEnabledChanged( NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnBadgeEnabledChanged(callbackData); @@ -254,10 +254,10 @@ ErrCode SubscriberListener::OnBadgeEnabledChanged( ErrCode SubscriberListener::OnApplicationInfoNeedChanged(const std::string& bundleName) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGW("OnApplicationInfoNeedChanged SubscriberListener 1."); + ANS_LOGD("called"); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGE("Subscriber is nullptr"); + ANS_LOGE("null subscriber"); return ERR_INVALID_DATA; } subscriber->OnApplicationInfoNeedChanged(bundleName); @@ -270,7 +270,7 @@ ErrCode SubscriberListener::OnOperationResponse( NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); auto subscriber = subscriber_.lock(); if (subscriber == nullptr) { - ANS_LOGW("Subscriber is nullptr"); + ANS_LOGW("null subscriber"); return ERR_OK; } std::shared_ptr sharedNotification = diff --git a/frameworks/js/napi/src/ans_template.cpp b/frameworks/js/napi/src/ans_template.cpp index 44ead0a6ca1dfe99fc8e9c6abe14f7a6ccac0aeb..f1f6d1d055fca0ca94ff6da47048e6540155a2d5 100644 --- a/frameworks/js/napi/src/ans_template.cpp +++ b/frameworks/js/napi/src/ans_template.cpp @@ -22,7 +22,7 @@ const int IS_TEMPLATE_MAX_PARA = 2; napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, TemplateName& params) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = IS_TEMPLATE_MAX_PARA; napi_value argv[IS_TEMPLATE_MAX_PARA] = {nullptr}; @@ -73,7 +73,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value IsSupportTemplate(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); TemplateName params; if (ParseParameters(env, info, params) == nullptr) { @@ -83,7 +83,7 @@ napi_value IsSupportTemplate(napi_env env, napi_callback_info info) AsyncCallbackInfoTemplate *asyncCallbackinfo = new (std::nothrow) AsyncCallbackInfoTemplate {.env = env, .asyncWork = nullptr, .params = params}; if (!asyncCallbackinfo) { - ANS_LOGD("AsyncCallbackinfo is nullptr."); + ANS_LOGD("null asyncCallbackinfo"); return Common::JSParaError(env, params.callback); } napi_value promise = nullptr; diff --git a/frameworks/js/napi/src/cancel.cpp b/frameworks/js/napi/src/cancel.cpp index 162f391c1e6df0671cfee82c46062bb67db95433..97f5541975a5c98bdd51d7e8dd2babc8877f2703 100644 --- a/frameworks/js/napi/src/cancel.cpp +++ b/frameworks/js/napi/src/cancel.cpp @@ -27,7 +27,7 @@ constexpr int8_t CANCEL_AS_BUNDLEOPTION_MAX_PARA = 2; napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, ParametersInfoCancel ¶s) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = CANCEL_MAX_PARA; napi_value argv[CANCEL_MAX_PARA] = {nullptr}; @@ -54,7 +54,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, } else { auto retValue = Common::GetBundleOption(env, argv[PARAM0], paras.option); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed."); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -116,7 +116,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, ParametersInfoCancelGroup ¶s) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = CANCEL_GROUP_MAX_PARA; napi_value argv[CANCEL_GROUP_MAX_PARA] = {nullptr}; @@ -167,7 +167,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value Cancel(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoCancel paras; if (ParseParameters(env, info, paras) == nullptr) { @@ -177,7 +177,7 @@ napi_value Cancel(napi_env env, napi_callback_info info) AsyncCallbackInfoCancel *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoCancel {.env = env, .asyncWork = nullptr, .id = paras.id, .label = paras.label}; if (!asynccallbackinfo) { - ANS_LOGD("AsyncCallbackinfo is nullptr."); + ANS_LOGD("null asyncCallbackinfo"); return Common::JSParaError(env, paras.callback); } napi_value promise = nullptr; @@ -220,7 +220,7 @@ napi_value Cancel(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("cancel callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -229,7 +229,7 @@ napi_value Cancel(napi_env env, napi_callback_info info) napi_value CancelAll(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { @@ -238,7 +238,7 @@ napi_value CancelAll(napi_env env, napi_callback_info info) auto asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoCancel {.env = env, .asyncWork = nullptr}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, callback); } napi_value promise = nullptr; @@ -279,7 +279,7 @@ napi_value CancelAll(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("CancelAll callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -288,7 +288,7 @@ napi_value CancelAll(napi_env env, napi_callback_info info) napi_value CancelGroup(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoCancelGroup params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -342,7 +342,7 @@ napi_value CancelGroup(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("CancelGroup callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -351,7 +351,7 @@ napi_value CancelGroup(napi_env env, napi_callback_info info) napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, ParametersInfoCancelAsBundle ¶s) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = CANCEL_AS_BUNDLE_MAX_PARA; napi_value argv[CANCEL_AS_BUNDLE_MAX_PARA] = {nullptr}; @@ -436,7 +436,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value CancelAsBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoCancelAsBundle paras; if (ParseParameters(env, info, paras) == nullptr) { @@ -450,7 +450,7 @@ napi_value CancelAsBundle(napi_env env, napi_callback_info info) .userId = paras.userId }; if (!asynccallbackinfo) { - ANS_LOGD("AsyncCallbackinfo is nullptr."); + ANS_LOGD("null asyncCallbackinfo"); return Common::JSParaError(env, paras.callback); } napi_value promise = nullptr; @@ -493,7 +493,7 @@ napi_value CancelAsBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("CancelAsBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/common.cpp b/frameworks/js/napi/src/common.cpp index 705e85d65fbe8f4ce2cd0e2d0924927f2d246ffe..ffad83374061e947652bdc48ce210b2ea5d3cee8 100644 --- a/frameworks/js/napi/src/common.cpp +++ b/frameworks/js/napi/src/common.cpp @@ -43,9 +43,9 @@ Common::~Common() napi_value Common::SetNotificationSortingMap( const napi_env &env, const std::shared_ptr &sortingMap, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (sortingMap == nullptr) { - ANS_LOGD("sortingMap is null"); + ANS_LOGD("null sortingMap"); return NapiGetBoolean(env, false); } if (sortingMap->GetKey().size() == 0) { @@ -88,7 +88,7 @@ napi_value Common::SetNotificationSortingMap( napi_value Common::SetNotificationSorting(const napi_env &env, NotificationSorting &sorting, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // slot: NotificationSlot napi_value slotResult = nullptr; @@ -133,7 +133,7 @@ napi_value Common::SetNotificationSorting(const napi_env &env, NotificationSorti napi_value Common::SetNotificationSlot(const napi_env &env, const NotificationSlot &slot, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; // type: SlotType @@ -215,7 +215,7 @@ napi_value Common::SetNotificationSlot(const napi_env &env, const NotificationSl napi_value Common::SetDoNotDisturbDate( const napi_env &env, const NotificationDoNotDisturbDate &date, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); DoNotDisturbType outType = DoNotDisturbType::TYPE_NONE; if (!AnsEnumUtil::DoNotDisturbTypeCToJS(date.GetDoNotDisturbType(), outType)) { return NapiGetBoolean(env, false); @@ -244,7 +244,7 @@ napi_value Common::SetDoNotDisturbDate( napi_value Common::SetEnabledNotificationCallbackData(const napi_env &env, const EnabledNotificationCallbackData &data, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // bundle: string napi_value bundleNapi = nullptr; napi_create_string_utf8(env, data.GetBundle().c_str(), NAPI_AUTO_LENGTH, &bundleNapi); @@ -266,7 +266,7 @@ napi_value Common::SetEnabledNotificationCallbackData(const napi_env &env, const napi_value Common::SetBadgeCallbackData(const napi_env &env, const BadgeNumberCallbackData &data, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // bundle: string napi_value bundleNapi = nullptr; napi_create_string_utf8(env, data.GetBundle().c_str(), NAPI_AUTO_LENGTH, &bundleNapi); @@ -298,7 +298,7 @@ napi_value Common::SetBadgeCallbackData(const napi_env &env, const BadgeNumberCa napi_value Common::GetNotificationSubscriberInfo( const napi_env &env, const napi_value &value, NotificationSubscribeInfo &subscriberInfo) { - ANS_LOGD("enter"); + ANS_LOGD("called"); uint32_t length = 0; size_t strLen = 0; bool hasProperty = false; @@ -433,7 +433,7 @@ napi_value Common::GetNotificationSubscriberInfo( napi_value Common::GetNotificationUserInput( const napi_env &env, const napi_value &actionButton, std::shared_ptr &pActionButton) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value userInputResult = nullptr; bool hasProperty = false; @@ -461,7 +461,7 @@ napi_value Common::GetNotificationUserInput( napi_value Common::GetNotificationUserInputByInputKey( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value value = nullptr; bool hasProperty = false; @@ -494,7 +494,7 @@ napi_value Common::GetNotificationUserInputByInputKey( napi_value Common::GetNotificationUserInputByTag( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value value = nullptr; @@ -527,7 +527,7 @@ napi_value Common::GetNotificationUserInputByTag( napi_value Common::GetNotificationUserInputByOptions( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value value = nullptr; @@ -579,7 +579,7 @@ napi_value Common::GetNotificationUserInputByOptions( napi_value Common::GetNotificationUserInputByPermitMimeTypes( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value value = nullptr; @@ -626,7 +626,7 @@ napi_value Common::GetNotificationUserInputByPermitMimeTypes( napi_value Common::GetNotificationUserInputByPermitFreeFormInput( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -656,7 +656,7 @@ napi_value Common::GetNotificationUserInputByPermitFreeFormInput( napi_value Common::GetNotificationUserInputByEditType( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -686,7 +686,7 @@ napi_value Common::GetNotificationUserInputByEditType( napi_value Common::GetNotificationUserInputByAdditionalData( const napi_env &env, const napi_value &userInputResult, std::shared_ptr &userInput) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -719,7 +719,7 @@ napi_value Common::GetNotificationUserInputByAdditionalData( napi_value Common::GetNotificationContentType(const napi_env &env, const napi_value &result, int32_t &type) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value contentResult = nullptr; napi_valuetype valuetype = napi_undefined; @@ -764,7 +764,7 @@ napi_value Common::GetNotificationContentType(const napi_env &env, const napi_va napi_value Common::GetNotificationSlot(const napi_env &env, const napi_value &value, NotificationSlot &slot) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value nobj = nullptr; napi_valuetype valuetype = napi_undefined; @@ -824,7 +824,7 @@ napi_value Common::GetNotificationSlot(const napi_env &env, const napi_value &va napi_value Common::GetNotificationSlotByString(const napi_env &env, const napi_value &value, NotificationSlot &slot) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value nobj = nullptr; napi_valuetype valuetype = napi_undefined; @@ -874,7 +874,7 @@ napi_value Common::GetNotificationSlotByString(const napi_env &env, const napi_v napi_value Common::GetNotificationSlotByBool(const napi_env &env, const napi_value &value, NotificationSlot &slot) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value nobj = nullptr; napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -935,7 +935,7 @@ napi_value Common::GetNotificationSlotByBool(const napi_env &env, const napi_val napi_value Common::GetNotificationSlotByNumber(const napi_env &env, const napi_value &value, NotificationSlot &slot) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value nobj = nullptr; napi_valuetype valuetype = napi_undefined; @@ -1001,7 +1001,7 @@ napi_value Common::GetNotificationSlotByNumber(const napi_env &env, const napi_v napi_value Common::GetNotificationSlotByVibration(const napi_env &env, const napi_value &value, NotificationSlot &slot) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value nobj = nullptr; napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -1061,7 +1061,7 @@ napi_value Common::GetNotificationSlotByVibration(const napi_env &env, const nap napi_value Common::GetBundleOption(const napi_env &env, const napi_value &value, NotificationBundleOption &option) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty {false}; napi_valuetype valuetype = napi_undefined; @@ -1105,7 +1105,7 @@ napi_value Common::GetBundleOption(const napi_env &env, const napi_value &value, napi_value Common::GetButtonOption(const napi_env &env, const napi_value &value, NotificationButtonOption &option) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty {false}; napi_valuetype valuetype = napi_undefined; @@ -1135,7 +1135,7 @@ napi_value Common::GetButtonOption(const napi_env &env, const napi_value &value, napi_value Common::GetHashCodes(const napi_env &env, const napi_value &value, std::vector &hashCodes) { - ANS_LOGD("enter"); + ANS_LOGD("called"); uint32_t length = 0; napi_get_array_length(env, value, &length); if (length == 0) { @@ -1162,7 +1162,7 @@ napi_value Common::GetHashCodes(const napi_env &env, const napi_value &value, st napi_value Common::GetNotificationKey(const napi_env &env, const napi_value &value, NotificationKey &key) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty {false}; napi_valuetype valuetype = napi_undefined; @@ -1244,7 +1244,7 @@ __attribute__((no_sanitize("cfi"))) napi_value Common::CreateWantAgentByJS(const napi_value Common::GetNotificationTemplate(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1314,7 +1314,7 @@ napi_value Common::GetNotificationBundleOption( napi_value Common::GetNotificationTemplateInfo(const napi_env &env, const napi_value &value, std::shared_ptr &templ) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1366,7 +1366,7 @@ napi_value Common::GetNotificationTemplateInfo(const napi_env &env, const napi_v napi_value Common::SetNotificationTemplateInfo( const napi_env &env, const std::shared_ptr &templ, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (templ == nullptr) { ANS_LOGE("templ is null"); @@ -1409,7 +1409,7 @@ napi_value Common::SetNotificationEnableStatus( napi_value Common::SetNotificationFlags( const napi_env &env, const std::shared_ptr &flags, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (flags == nullptr) { ANS_LOGE("flags is null"); @@ -1436,7 +1436,7 @@ napi_value Common::SetNotificationFlags( napi_value Common::SetAgentBundle( const napi_env &env, const std::shared_ptr &agentBundle, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (agentBundle == nullptr) { ANS_LOGE("agentBundle is null"); @@ -1459,7 +1459,7 @@ napi_value Common::SetAgentBundle( napi_value Common::SetNotificationUnifiedGroupInfo( const napi_env &env, const std::shared_ptr &info, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (info == nullptr) { ANS_LOGE("info is null"); @@ -1512,7 +1512,7 @@ napi_value Common::SetBundleOption(const napi_env &env, const NotificationBundle napi_value Common::SetDoNotDisturbProfile(const napi_env &env, const NotificationDoNotDisturbProfile &data, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; // id: number napi_create_int64(env, data.GetProfileId(), &value); diff --git a/frameworks/js/napi/src/common_convert_content.cpp b/frameworks/js/napi/src/common_convert_content.cpp index e77e49c6fc1687b9ec631ce1261ac36923372675..02cb2ab5348239db2ee69051fe863f1c5bcd7963 100644 --- a/frameworks/js/napi/src/common_convert_content.cpp +++ b/frameworks/js/napi/src/common_convert_content.cpp @@ -56,16 +56,16 @@ const char *Common::GetPropertyNameByContentType(ContentType type) napi_value Common::SetNotificationContentDetailed(const napi_env &env, const ContentType &type, const std::shared_ptr &content, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value ret = NapiGetBoolean(env, false); if (!content) { - ANS_LOGE("content is null"); + ANS_LOGE("null content"); return ret; } std::shared_ptr basicContent = content->GetNotificationContent(); if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return ret; } @@ -108,10 +108,10 @@ napi_value Common::SetNotificationContentDetailed(const napi_env &env, const Con napi_value Common::SetNotificationContent( const napi_env &env, const std::shared_ptr &content, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (content == nullptr) { - ANS_LOGE("content is null"); + ANS_LOGE("null content"); return NapiGetBoolean(env, false); } @@ -135,10 +135,10 @@ napi_value Common::SetNotificationContent( napi_value Common::SetNotificationBasicContent( const napi_env &env, const NotificationBasicContent *basicContent, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return NapiGetBoolean(env, false); } @@ -161,17 +161,17 @@ napi_value Common::SetNotificationBasicContent( napi_value Common::SetNotificationLongTextContent( const napi_env &env, NotificationBasicContent *basicContent, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return NapiGetBoolean(env, false); } OHOS::Notification::NotificationLongTextContent *longTextContent = static_cast(basicContent); if (longTextContent == nullptr) { - ANS_LOGE("longTextContent is null"); + ANS_LOGE("null longTextContent"); return NapiGetBoolean(env, false); } @@ -198,16 +198,16 @@ napi_value Common::SetNotificationLongTextContent( napi_value Common::SetNotificationPictureContent( const napi_env &env, NotificationBasicContent *basicContent, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return NapiGetBoolean(env, false); } OHOS::Notification::NotificationPictureContent *pictureContent = static_cast(basicContent); if (pictureContent == nullptr) { - ANS_LOGE("pictureContent is null"); + ANS_LOGE("null pictureContent"); return NapiGetBoolean(env, false); } @@ -244,16 +244,16 @@ napi_value Common::SetNotificationPictureContent( napi_value Common::SetNotificationConversationalContent(const napi_env &env, NotificationBasicContent *basicContent, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return NapiGetBoolean(env, false); } OHOS::Notification::NotificationConversationalContent *conversationalContent = static_cast(basicContent); if (conversationalContent == nullptr) { - ANS_LOGE("conversationalContent is null"); + ANS_LOGE("null conversationalContent"); return NapiGetBoolean(env, false); } @@ -293,16 +293,16 @@ napi_value Common::SetNotificationConversationalContent(const napi_env &env, napi_value Common::SetNotificationMultiLineContent( const napi_env &env, NotificationBasicContent *basicContent, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return NapiGetBoolean(env, false); } OHOS::Notification::NotificationMultiLineContent *multiLineContent = static_cast(basicContent); if (multiLineContent == nullptr) { - ANS_LOGE("multiLineContent is null"); + ANS_LOGE("null multiLineContent"); return NapiGetBoolean(env, false); } @@ -347,7 +347,7 @@ napi_value Common::SetNotificationMultiLineContent( napi_value Common::SetMessageUser(const napi_env &env, const MessageUser &messageUser, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; // name: string @@ -390,9 +390,9 @@ napi_value Common::SetMessageUser(const napi_env &env, const MessageUser &messag napi_value Common::SetConversationalMessages(const napi_env &env, const OHOS::Notification::NotificationConversationalContent *conversationalContent, napi_value &arr) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!conversationalContent) { - ANS_LOGE("conversationalContent is null"); + ANS_LOGE("null conversationalContent"); return NapiGetBoolean(env, false); } @@ -419,10 +419,10 @@ napi_value Common::SetConversationalMessages(const napi_env &env, napi_value Common::SetConversationalMessage(const napi_env &env, const std::shared_ptr &conversationalMessage, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (conversationalMessage == nullptr) { - ANS_LOGE("conversationalMessage is null"); + ANS_LOGE("null conversationalMessage"); return NapiGetBoolean(env, false); } @@ -456,11 +456,11 @@ napi_value Common::SetConversationalMessage(const napi_env &env, napi_value Common::GetNotificationContent(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value result = AppExecFwk::GetPropertyValueByPropertyName(env, value, "content", napi_object); if (result == nullptr) { - ANS_LOGE("No content."); + ANS_LOGE("null result"); return nullptr; } @@ -518,7 +518,7 @@ napi_value Common::GetNotificationContent(const napi_env &env, const napi_value napi_value Common::GetNotificationBasicContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value contentResult = nullptr; @@ -539,7 +539,7 @@ napi_value Common::GetNotificationBasicContent( std::shared_ptr normalContent = std::make_shared(); if (normalContent == nullptr) { - ANS_LOGE("normalContent is null"); + ANS_LOGE("null normalContent"); return nullptr; } @@ -555,7 +555,7 @@ napi_value Common::GetNotificationBasicContent( napi_value Common::GetNotificationBasicContentDetailed( const napi_env &env, const napi_value &contentResult, std::shared_ptr basicContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty = false; char commonStr[COMMON_TEXT_SIZE] = {0}; @@ -565,7 +565,7 @@ napi_value Common::GetNotificationBasicContentDetailed( // title: string auto value = AppExecFwk::GetPropertyValueByPropertyName(env, contentResult, "title", napi_string); if (value == nullptr) { - ANS_LOGE("Failed to get title from js."); + ANS_LOGE("null value"); std::string msg = "Incorrect parameter types. The type of title must be string."; Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; @@ -583,7 +583,7 @@ napi_value Common::GetNotificationBasicContentDetailed( // text: string value = AppExecFwk::GetPropertyValueByPropertyName(env, contentResult, "text", napi_string); if (value == nullptr) { - ANS_LOGE("Failed to get text from js."); + ANS_LOGE("null value"); std::string msg = "Incorrect parameter types. The type of text must be string."; Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; @@ -603,7 +603,7 @@ napi_value Common::GetNotificationBasicContentDetailed( if (hasProperty) { value = AppExecFwk::GetPropertyValueByPropertyName(env, contentResult, "additionalText", napi_string); if (value == nullptr) { - ANS_LOGE("Failed to get additionalText from js."); + ANS_LOGE("null value"); std::string msg = "Incorrect parameter types. The type of additionalText must be string."; Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; @@ -620,7 +620,7 @@ napi_value Common::GetNotificationBasicContentDetailed( napi_value Common::GetNotificationLongTextContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value contentResult = nullptr; @@ -644,7 +644,7 @@ napi_value Common::GetNotificationLongTextContent( std::shared_ptr longContent = std::make_shared(); if (longContent == nullptr) { - ANS_LOGE("longContent is null"); + ANS_LOGE("null longContent"); return nullptr; } @@ -661,7 +661,7 @@ napi_value Common::GetNotificationLongTextContentDetailed( const napi_env &env, const napi_value &contentResult, std::shared_ptr &longContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value longContentResult = nullptr; @@ -746,7 +746,7 @@ napi_value Common::GetNotificationLongTextContentDetailed( napi_value Common::GetNotificationPictureContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value contentResult = nullptr; @@ -769,7 +769,7 @@ napi_value Common::GetNotificationPictureContent( std::shared_ptr pictureContent = std::make_shared(); if (pictureContent == nullptr) { - ANS_LOGE("pictureContent is null"); + ANS_LOGE("null pictureContent"); return nullptr; } if (GetNotificationPictureContentDetailed(env, contentResult, pictureContent) == nullptr) { @@ -784,7 +784,7 @@ napi_value Common::GetNotificationPictureContent( napi_value Common::GetNotificationPictureContentDetailed(const napi_env &env, const napi_value &contentResult, std::shared_ptr &pictureContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value pictureContentResult = nullptr; @@ -855,7 +855,7 @@ napi_value Common::GetNotificationPictureContentDetailed(const napi_env &env, std::shared_ptr pixelMap = nullptr; pixelMap = Media::PixelMapNapi::GetPixelMap(env, pictureContentResult); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } pictureContent->SetBigPicture(pixelMap); @@ -866,7 +866,7 @@ napi_value Common::GetNotificationPictureContentDetailed(const napi_env &env, napi_value Common::GetNotificationConversationalContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value contentResult = nullptr; @@ -894,7 +894,7 @@ napi_value Common::GetNotificationConversationalContent( std::shared_ptr conversationalContent = std::make_shared(user); if (conversationalContent == nullptr) { - ANS_LOGE("conversationalContent is null"); + ANS_LOGE("null conversationalContent"); return nullptr; } @@ -919,7 +919,7 @@ napi_value Common::GetNotificationConversationalContent( napi_value Common::GetNotificationConversationalContentByUser( const napi_env &env, const napi_value &contentResult, MessageUser &user) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -948,7 +948,7 @@ napi_value Common::GetNotificationConversationalContentByUser( napi_value Common::GetMessageUser(const napi_env &env, const napi_value &result, MessageUser &messageUser) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (GetMessageUserByString(env, result, messageUser) == nullptr) { return nullptr; @@ -967,7 +967,7 @@ napi_value Common::GetMessageUser(const napi_env &env, const napi_value &result, napi_value Common::GetMessageUserByString(const napi_env &env, const napi_value &result, MessageUser &messageUser) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -1036,7 +1036,7 @@ napi_value Common::GetMessageUserByString(const napi_env &env, const napi_value napi_value Common::GetMessageUserByBool(const napi_env &env, const napi_value &result, MessageUser &messageUser) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -1085,7 +1085,7 @@ napi_value Common::GetMessageUserByBool(const napi_env &env, const napi_value &r napi_value Common::GetMessageUserByCustom(const napi_env &env, const napi_value &result, MessageUser &messageUser) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -1105,7 +1105,7 @@ napi_value Common::GetMessageUserByCustom(const napi_env &env, const napi_value std::shared_ptr pixelMap = nullptr; pixelMap = Media::PixelMapNapi::GetPixelMap(env, iconResult); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } messageUser.SetPixelMap(pixelMap); @@ -1118,7 +1118,7 @@ napi_value Common::GetNotificationConversationalContentTitle( const napi_env &env, const napi_value &contentResult, std::shared_ptr &conversationalContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value conversationalContentResult = nullptr; bool hasProperty = false; @@ -1149,7 +1149,7 @@ napi_value Common::GetNotificationConversationalContentGroup( const napi_env &env, const napi_value &contentResult, std::shared_ptr &conversationalContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value conversationalContentResult = nullptr; bool hasProperty = false; @@ -1178,7 +1178,7 @@ napi_value Common::GetNotificationConversationalContentMessages( const napi_env &env, const napi_value &contentResult, std::shared_ptr &conversationalContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value conversationalContentResult = nullptr; bool hasProperty = false; @@ -1223,7 +1223,7 @@ napi_value Common::GetNotificationConversationalContentMessages( napi_value Common::GetConversationalMessage(const napi_env &env, const napi_value &conversationalMessage, std::shared_ptr &message) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (GetConversationalMessageBasicInfo(env, conversationalMessage, message) == nullptr) { return nullptr; @@ -1237,7 +1237,7 @@ napi_value Common::GetConversationalMessage(const napi_env &env, const napi_valu napi_value Common::GetConversationalMessageBasicInfo(const napi_env &env, const napi_value &conversationalMessage, std::shared_ptr &message) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -1309,7 +1309,7 @@ napi_value Common::GetConversationalMessageBasicInfo(const napi_env &env, const napi_value Common::GetConversationalMessageOtherInfo(const napi_env &env, const napi_value &conversationalMessage, std::shared_ptr &message) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; @@ -1358,7 +1358,7 @@ napi_value Common::GetConversationalMessageOtherInfo(const napi_env &env, const napi_value Common::GetNotificationMultiLineContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value contentResult = nullptr; @@ -1382,7 +1382,7 @@ napi_value Common::GetNotificationMultiLineContent( std::shared_ptr multiLineContent = std::make_shared(); if (multiLineContent == nullptr) { - ANS_LOGE("multiLineContent is null"); + ANS_LOGE("null multiLineContent"); return nullptr; } @@ -1457,7 +1457,7 @@ napi_value Common::GetNotificationMultiLineContent( napi_value Common::GetNotificationMultiLineContentLines(const napi_env &env, const napi_value &result, std::shared_ptr &multiLineContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool isArray = false; napi_valuetype valuetype = napi_undefined; @@ -1497,7 +1497,7 @@ napi_value Common::GetNotificationMultiLineContentLines(const napi_env &env, con napi_value Common::GetNotificationContentLineWantAgents(const napi_env &env, const napi_value &result, std::shared_ptr &multiLineContent) { - ANS_LOGD("GetNotificationContentLineWantAgents enter"); + ANS_LOGD("called"); bool hasProperty; bool isArray; @@ -1531,7 +1531,7 @@ napi_value Common::GetNotificationContentLineWantAgents(const napi_env &env, con AbilityRuntime::WantAgent::WantAgent *wantAgent = nullptr; napi_unwrap(env, wantAgentValue, (void **)&wantAgent); if (wantAgent == nullptr) { - ANS_LOGE("Invalid object lineWantAgents"); + ANS_LOGE("null wantAgent"); return nullptr; } lineWantAgents.push_back(std::make_shared(*wantAgent)); @@ -1550,14 +1550,14 @@ napi_value Common::GetLockScreenPicture( if (hasProperty) { auto value = AppExecFwk::GetPropertyValueByPropertyName(env, contentResult, "lockscreenPicture", napi_object); if (value == nullptr) { - ANS_LOGE("Failed to get lockScreenPicture from js."); + ANS_LOGE("null value"); std::string msg = "Incorrect parameter types. The type of lockscreenPicture must be object."; Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; } auto pixelMap = Media::PixelMapNapi::GetPixelMap(env, value); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } basicContent->SetLockScreenPicture(pixelMap); diff --git a/frameworks/js/napi/src/common_convert_liveview.cpp b/frameworks/js/napi/src/common_convert_liveview.cpp index cf591495cc523e389f66a4d302991dc2f42b5bcf..e974bceac38394a40ffc73a7f2f3fa4029289a9a 100644 --- a/frameworks/js/napi/src/common_convert_liveview.cpp +++ b/frameworks/js/napi/src/common_convert_liveview.cpp @@ -35,16 +35,16 @@ namespace NotificationNapi { napi_value Common::SetNotificationLocalLiveViewContent( const napi_env &env, NotificationBasicContent *basicContent, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (basicContent == nullptr) { - ANS_LOGE("basicContent is null"); + ANS_LOGE("null basicContent"); return NapiGetBoolean(env, false); } OHOS::Notification::NotificationLocalLiveViewContent *localLiveViewContent = static_cast(basicContent); if (localLiveViewContent == nullptr) { - ANS_LOGE("localLiveViewContent is null"); + ANS_LOGE("null localLiveViewContent"); return NapiGetBoolean(env, false); } @@ -128,7 +128,7 @@ napi_value Common::SetNotificationLocalLiveViewContent( napi_value Common::SetCapsule(const napi_env &env, const NotificationCapsule &capsule, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; // title: string @@ -176,7 +176,7 @@ napi_value Common::SetCapsule(const napi_env &env, const NotificationCapsule &ca napi_value Common::SetProgress(const napi_env &env, const NotificationProgress &progress, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; // currentValue: int32_t @@ -197,7 +197,7 @@ napi_value Common::SetProgress(const napi_env &env, const NotificationProgress & napi_value Common::SetTime(const napi_env &env, const NotificationTime &time, napi_value &result, bool isInitialTimeExist) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; // initialTime: int32_t @@ -276,7 +276,7 @@ napi_value Common::SetResourceObject(napi_env env, const std::shared_ptr buttons, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); int iconCount = 0; napi_value value = nullptr; @@ -385,22 +385,22 @@ napi_value Common::SetCardButton(const napi_env &env, const std::vector(basicContent); if (liveViewContent == nullptr) { - ANS_LOGE("LiveViewContent is null"); + ANS_LOGE("null liveViewContent"); return NapiGetBoolean(env, false); } @@ -432,7 +432,7 @@ napi_value Common::SetNotificationLiveViewContent( napi_value pictureMapObj = SetLiveViewPictureInfo(env, liveViewContent->GetPicture()); if (pictureMapObj == nullptr) { - ANS_LOGE("Set live view picture map failed."); + ANS_LOGE("null pictureMapObj"); return NapiGetBoolean(env, false); } napi_set_named_property(env, result, "pictureInfo", pictureMapObj); @@ -443,7 +443,7 @@ napi_value Common::SetNotificationLiveViewContent( napi_value Common::SetLiveViewPictureInfo( const napi_env &env, const std::map>> &pictureMap) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value pictureMapObj = nullptr; NAPI_CALL(env, napi_create_object(env, &pictureMapObj)); @@ -469,7 +469,7 @@ napi_value Common::SetLiveViewPictureInfo( napi_value Common::GetNotificationLocalLiveViewContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value contentResult = nullptr; @@ -489,7 +489,7 @@ napi_value Common::GetNotificationLocalLiveViewContent( std::shared_ptr localLiveViewContent = std::make_shared(); if (localLiveViewContent == nullptr) { - ANS_LOGE("localLiveViewContent is null"); + ANS_LOGE("null localLiveViewContent"); return nullptr; } @@ -518,7 +518,7 @@ napi_value Common::GetNotificationLocalLiveViewCapsule( napi_value result = nullptr; int32_t intValue; - ANS_LOGD("enter"); + ANS_LOGD("called"); NAPI_CALL(env, napi_has_named_property(env, contentResult, "capsule", &hasProperty)); @@ -589,7 +589,7 @@ napi_value Common::GetNotificationLocalLiveViewCapsule( } pixelMap = Media::PixelMapNapi::GetPixelMap(env, result); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } capsule.SetIcon(pixelMap); @@ -634,7 +634,7 @@ napi_value Common::GetNotificationLocalLiveViewCardButton( { napi_value buttonResult = nullptr; - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_get_named_property(env, contentResult, "cardButtons", &buttonResult); // 解析iconbutton数组 @@ -652,7 +652,7 @@ napi_value Common::GetNotificationLocalLiveViewCapsuleCardButton( const napi_env &env, const napi_value &capsuletResult, OHOS::Notification::NotificationCapsule &capsule) { - ANS_LOGD("enter"); + ANS_LOGD("called"); std::vector cardButtons; if (GetNotificationIconButton(env, capsuletResult, cardButtons, CAPSULE_BTN_MAX_SIZE) == nullptr) { return nullptr; @@ -679,7 +679,7 @@ napi_value Common::GetNotificationIconButton( char str[STR_MAX_SIZE] = {0}; bool hasProperty = false; - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_is_array(env, buttonResult, &isArray); if (!isArray) { ANS_LOGE("Property names is expected to be an array."); @@ -742,7 +742,7 @@ napi_value Common::GetNotificationIconButton( // icon?: image.PixelMap auto pixelMap = Media::PixelMapNapi::GetPixelMap(env, iconResource); if (pixelMap == nullptr) { - ANS_LOGE("Invalid pixelMap object is null."); + ANS_LOGE("null pixelMap"); } else { button.SetIconImage(pixelMap); } @@ -847,7 +847,7 @@ napi_value Common::GetNotificationLocalLiveViewButton( char str[STR_MAX_SIZE] = {0}; size_t strLen = 0; - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_get_named_property(env, contentResult, "button", &buttonResult); NAPI_CALL(env, napi_typeof(env, buttonResult, &valuetype)); @@ -953,7 +953,7 @@ napi_value Common::GetNotificationLocalLiveViewProgress(const napi_env &env, con bool boolValue = false; napi_value progressResult = nullptr; - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_get_named_property(env, contentResult, "progress", &progressResult); NAPI_CALL(env, napi_typeof(env, progressResult, &valuetype)); @@ -1025,7 +1025,7 @@ napi_value Common::GetNotificationLocalLiveViewTime(const napi_env &env, const n bool boolValue = false; napi_value timeResult = nullptr; - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_get_named_property(env, contentResult, "time", &timeResult); NAPI_CALL(env, napi_typeof(env, timeResult, &valuetype)); @@ -1112,7 +1112,7 @@ napi_value Common::GetNotificationLocalLiveViewContentDetailed( napi_value result = nullptr; napi_valuetype valuetype = napi_undefined; - ANS_LOGD("enter"); + ANS_LOGD("called"); //title, text if (GetNotificationBasicContentDetailed(env, contentResult, content) == nullptr) { @@ -1185,17 +1185,17 @@ napi_value Common::GetNotificationLocalLiveViewContentDetailed( napi_value Common::GetNotificationLiveViewContent( const napi_env &env, const napi_value &result, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value contentResult = AppExecFwk::GetPropertyValueByPropertyName(env, result, "liveView", napi_object); if (contentResult == nullptr) { - ANS_LOGE("Property liveView expected."); + ANS_LOGE("null contentResult"); return nullptr; } std::shared_ptr liveViewContent = std::make_shared(); if (liveViewContent == nullptr) { - ANS_LOGE("LiveViewContent is null"); + ANS_LOGE("null liveViewContent"); return nullptr; } @@ -1212,11 +1212,11 @@ napi_value Common::GetNotificationLiveViewContentDetailed( const napi_env &env, const napi_value &contentResult, std::shared_ptr &liveViewContent) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // lockScreenPicture?: pixelMap if (GetLockScreenPicture(env, contentResult, liveViewContent) == nullptr) { - ANS_LOGE("Failed to get lockScreenPicture from liveView content."); + ANS_LOGE("null lockScreenPicture"); return nullptr; } @@ -1261,13 +1261,13 @@ napi_value Common::GetNotificationLiveViewContentDetailed( // pictureInfo?: {[key, string]: Array} jsValue = AppExecFwk::GetPropertyValueByPropertyName(env, contentResult, "pictureInfo", napi_object); if (jsValue == nullptr) { - ANS_LOGI("No picture maps."); + ANS_LOGE("null jsValue"); return NapiGetNull(env); } std::map>> pictureMap; if (GetLiveViewPictureInfo(env, jsValue, pictureMap) == nullptr) { - ANS_LOGE("Failed to get picture map from liveView content."); + ANS_LOGE("null LiveViewPictureInfo"); return nullptr; } liveViewContent->SetPicture(pictureMap); @@ -1279,7 +1279,7 @@ napi_value Common::GetLiveViewPictures( const napi_env &env, const napi_value &picturesObj, std::vector> &pictures) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool isArray = false; napi_is_array(env, picturesObj, &isArray); @@ -1305,7 +1305,7 @@ napi_value Common::GetLiveViewPictures( std::shared_ptr pixelMap = Media::PixelMapNapi::GetPixelMap(env, pictureObj); if (pixelMap == nullptr) { - ANS_LOGE("Invalid pixelMap."); + ANS_LOGE("null pixelMap"); break; } @@ -1319,7 +1319,7 @@ napi_value Common::GetLiveViewPictureInfo( const napi_env &env, const napi_value &pictureMapObj, std::map>> &pictureMap) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value pictureNamesObj = nullptr; uint32_t length = 0; diff --git a/frameworks/js/napi/src/common_convert_notification.cpp b/frameworks/js/napi/src/common_convert_notification.cpp index 0fa3fb302f4be171a8b6750faa58cfdb88a1a5f8..84e5ac7219b8f1485c3ac7698205a0654518b35a 100644 --- a/frameworks/js/napi/src/common_convert_notification.cpp +++ b/frameworks/js/napi/src/common_convert_notification.cpp @@ -33,9 +33,9 @@ namespace NotificationNapi { napi_value Common::SetNotificationByDistributedOptions( const napi_env &env, const OHOS::Notification::Notification *notification, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (notification == nullptr) { - ANS_LOGE("notification is nullptr"); + ANS_LOGE("null notification"); return NapiGetBoolean(env, false); } @@ -91,10 +91,10 @@ napi_value Common::SetNotificationByDistributedOptions( napi_value Common::SetNotification( const napi_env &env, const OHOS::Notification::Notification *notification, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (notification == nullptr) { - ANS_LOGE("notification is nullptr"); + ANS_LOGE("null notification"); return NapiGetBoolean(env, false); } napi_value value = nullptr; @@ -167,7 +167,7 @@ napi_value Common::SetNotification( napi_value Common::GetNotificationRequestDistributedOptions(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; bool hasProperty = false; @@ -206,7 +206,7 @@ napi_value Common::GetNotificationRequestDistributedOptions(const napi_env &env, napi_value Common::GetNotificationIsDistributed( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; diff --git a/frameworks/js/napi/src/common_convert_request.cpp b/frameworks/js/napi/src/common_convert_request.cpp index 26a06dba431e6a427f18c1f397946b801e4653c5..51275b5be9fae068662c61814527ad58c713bffe 100644 --- a/frameworks/js/napi/src/common_convert_request.cpp +++ b/frameworks/js/napi/src/common_convert_request.cpp @@ -33,12 +33,12 @@ namespace NotificationNapi { napi_value Common::SetNotificationRequestByString( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } @@ -76,12 +76,12 @@ napi_value Common::SetNotificationRequestByString( napi_value Common::SetNotificationRequestByNumber( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } @@ -137,12 +137,12 @@ napi_value Common::SetNotificationRequestByNumber( napi_value Common::SetNotificationRequestByBool( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_value value = nullptr; if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } // isOngoing?: boolean @@ -191,9 +191,9 @@ napi_value Common::SetNotificationRequestByBool( napi_value Common::SetNotificationRequestByWantAgent( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } // wantAgent?: WantAgent @@ -232,10 +232,10 @@ napi_value Common::SetNotificationRequestByWantAgent( napi_value Common::SetNotificationRequestByPixelMap( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } @@ -290,10 +290,10 @@ napi_value Common::SetNotificationRequestByPixelMap( napi_value Common::SetNotificationRequestByCustom( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } @@ -308,7 +308,7 @@ napi_value Common::SetNotificationRequestByCustom( } napi_set_named_property(env, result, "content", contentResult); } else { - ANS_LOGE("content is nullptr"); + ANS_LOGE("null content"); return NapiGetBoolean(env, false); } @@ -400,9 +400,9 @@ napi_value Common::SetNotificationRequestByCustom( napi_value Common::SetNotificationActionButton( const napi_env &env, const std::shared_ptr &actionButton, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (actionButton == nullptr) { - ANS_LOGE("actionButton is null"); + ANS_LOGE("null actionButton"); return NapiGetBoolean(env, false); } @@ -415,7 +415,7 @@ napi_value Common::SetNotificationActionButton( // wantAgent: WantAgent std::shared_ptr agent = actionButton->GetWantAgent(); if (agent == nullptr) { - ANS_LOGE("wantAgent is null"); + ANS_LOGE("null agent"); napi_set_named_property(env, result, "wantAgent", NapiGetNull(env)); return NapiGetBoolean(env, false); } else { @@ -457,9 +457,9 @@ napi_value Common::SetNotificationActionButton( napi_value Common::SetNotificationActionButtonByExtras( const napi_env &env, const std::shared_ptr &actionButton, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!actionButton) { - ANS_LOGE("actionButton is null"); + ANS_LOGE("null actionButton"); return NapiGetBoolean(env, false); } // extras?: {[key: string]: any} @@ -475,7 +475,7 @@ napi_value Common::SetNotificationActionButtonByExtras( napi_value Common::SetNotificationActionButtonByUserInput( const napi_env &env, const std::shared_ptr &userInput, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!userInput) { return NapiGetBoolean(env, false); @@ -538,10 +538,10 @@ napi_value Common::SetNotificationActionButtonByUserInput( napi_value Common::SetNotificationRequest( const napi_env &env, const OHOS::Notification::NotificationRequest *request, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (request == nullptr) { - ANS_LOGE("request is nullptr"); + ANS_LOGE("null request"); return NapiGetBoolean(env, false); } @@ -571,7 +571,7 @@ napi_value Common::SetNotificationRequest( napi_value Common::GetNotificationRequestByNumber( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // id?: number if (GetNotificationId(env, value, request) == nullptr) { return nullptr; @@ -607,7 +607,7 @@ napi_value Common::GetNotificationRequestByNumber( napi_value Common::GetNotificationRequestByString( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // classification?: string if (GetNotificationClassification(env, value, request) == nullptr) { return nullptr; @@ -638,7 +638,7 @@ napi_value Common::GetNotificationRequestByString( napi_value Common::GetNotificationRequestByBool( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // isOngoing?: boolean if (GetNotificationIsOngoing(env, value, request) == nullptr) { return nullptr; @@ -694,7 +694,7 @@ napi_value Common::GetNotificationRequestByBool( napi_value Common::GetNotificationRequestByCustom( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); // content: NotificationContent if (GetNotificationContent(env, value, request) == nullptr) { return nullptr; @@ -756,7 +756,7 @@ napi_value Common::GetNotificationRequestByCustom( napi_value Common::GetNotificationRequest(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!GetNotificationRequestByNumber(env, value, request)) { return nullptr; } @@ -774,7 +774,7 @@ napi_value Common::GetNotificationRequest(const napi_env &env, const napi_value napi_value Common::GetNotificationSmallIcon(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -793,7 +793,7 @@ napi_value Common::GetNotificationSmallIcon(const napi_env &env, const napi_valu std::shared_ptr pixelMap = nullptr; pixelMap = Media::PixelMapNapi::GetPixelMap(env, result); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } Common::PictureScale(pixelMap); @@ -805,7 +805,7 @@ napi_value Common::GetNotificationSmallIcon(const napi_env &env, const napi_valu napi_value Common::GetNotificationLargeIcon(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -824,7 +824,7 @@ napi_value Common::GetNotificationLargeIcon(const napi_env &env, const napi_valu std::shared_ptr pixelMap = nullptr; pixelMap = Media::PixelMapNapi::GetPixelMap(env, result); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } Common::PictureScale(pixelMap); @@ -837,7 +837,7 @@ napi_value Common::GetNotificationLargeIcon(const napi_env &env, const napi_valu napi_value Common::GetNotificationOverlayIcon( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -856,7 +856,7 @@ napi_value Common::GetNotificationOverlayIcon( std::shared_ptr pixelMap = nullptr; pixelMap = Media::PixelMapNapi::GetPixelMap(env, result); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } Common::PictureScale(pixelMap); @@ -869,7 +869,7 @@ napi_value Common::GetNotificationOverlayIcon( napi_value Common::GetNotificationSupportDisplayDevices( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool isArray = false; bool hasProperty = false; @@ -914,7 +914,7 @@ napi_value Common::GetNotificationSupportDisplayDevices( napi_value Common::GetNotificationSupportOperateDevices( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool isArray = false; bool hasProperty = false; @@ -959,7 +959,7 @@ napi_value Common::GetNotificationSupportOperateDevices( napi_value Common::GetNotificationId(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -988,7 +988,7 @@ napi_value Common::GetNotificationId(const napi_env &env, const napi_value &valu napi_value Common::GetNotificationSlotType(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1045,7 +1045,7 @@ napi_value Common::GetNotificationSlotType(const napi_env &env, const napi_value napi_value Common::GetNotificationIsOngoing(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1072,7 +1072,7 @@ napi_value Common::GetNotificationIsOngoing(const napi_env &env, const napi_valu napi_value Common::GetNotificationIsUnremovable( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1099,7 +1099,7 @@ napi_value Common::GetNotificationIsUnremovable( napi_value Common::GetNotificationDeliveryTime( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1126,7 +1126,7 @@ napi_value Common::GetNotificationDeliveryTime( napi_value Common::GetNotificationtapDismissed( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1152,7 +1152,7 @@ napi_value Common::GetNotificationtapDismissed( napi_value Common::GetNotificationWantAgent(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty = false; AbilityRuntime::WantAgent::WantAgent *wantAgent = nullptr; @@ -1171,7 +1171,7 @@ napi_value Common::GetNotificationWantAgent(const napi_env &env, const napi_valu } napi_unwrap(env, result, (void **)&wantAgent); if (wantAgent == nullptr) { - ANS_LOGE("Invalid object wantAgent"); + ANS_LOGE("null wantAgent"); return nullptr; } std::shared_ptr sWantAgent = @@ -1184,7 +1184,7 @@ napi_value Common::GetNotificationWantAgent(const napi_env &env, const napi_valu napi_value Common::GetNotificationExtraInfo(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1214,7 +1214,7 @@ napi_value Common::GetNotificationExtraInfo(const napi_env &env, const napi_valu napi_value Common::GetNotificationGroupName(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1242,7 +1242,7 @@ napi_value Common::GetNotificationGroupName(const napi_env &env, const napi_valu napi_value Common::GetNotificationRemovalWantAgent( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty = false; AbilityRuntime::WantAgent::WantAgent *wantAgent = nullptr; @@ -1261,7 +1261,7 @@ napi_value Common::GetNotificationRemovalWantAgent( } napi_unwrap(env, result, (void **)&wantAgent); if (wantAgent == nullptr) { - ANS_LOGE("Invalid object removalWantAgent"); + ANS_LOGE("null wantAgent"); return nullptr; } std::shared_ptr removeWantAgent = @@ -1285,7 +1285,7 @@ napi_value Common::GetNotificationRemovalWantAgent( napi_value Common::GetNotificationMaxScreenWantAgent( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty = false; AbilityRuntime::WantAgent::WantAgent *wantAgent = nullptr; @@ -1304,7 +1304,7 @@ napi_value Common::GetNotificationMaxScreenWantAgent( } napi_unwrap(env, result, (void **)&wantAgent); if (wantAgent == nullptr) { - ANS_LOGE("Invalid object maxScreenWantAgent"); + ANS_LOGE("null wantAgent"); return nullptr; } std::shared_ptr maxScreenWantAgent = @@ -1318,7 +1318,7 @@ napi_value Common::GetNotificationMaxScreenWantAgent( napi_value Common::GetNotificationAutoDeletedTime( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1345,7 +1345,7 @@ napi_value Common::GetNotificationAutoDeletedTime( napi_value Common::GetNotificationClassification( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1403,7 +1403,7 @@ napi_value Common::GetNotificationSound( auto soundValue = AppExecFwk::GetPropertyValueByPropertyName(env, value, "sound", napi_string); if (soundValue == nullptr) { - ANS_LOGE("Wrong argument type. String sound expected."); + ANS_LOGE("null soundValue"); std::string msg = "Incorrect parameter types. The type of sound must be string."; Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; @@ -1416,7 +1416,7 @@ napi_value Common::GetNotificationSound( napi_value Common::GetNotificationColor(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1447,7 +1447,7 @@ napi_value Common::GetNotificationColor(const napi_env &env, const napi_value &v napi_value Common::GetNotificationColorEnabled( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1474,7 +1474,7 @@ napi_value Common::GetNotificationColorEnabled( napi_value Common::GetNotificationIsAlertOnce( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1501,7 +1501,7 @@ napi_value Common::GetNotificationIsAlertOnce( napi_value Common::GetNotificationIsStopwatch( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1528,7 +1528,7 @@ napi_value Common::GetNotificationIsStopwatch( napi_value Common::GetNotificationIsCountDown( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1555,7 +1555,7 @@ napi_value Common::GetNotificationIsCountDown( napi_value Common::GetNotificationStatusBarText( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1582,7 +1582,7 @@ napi_value Common::GetNotificationStatusBarText( napi_value Common::GetNotificationLabel(const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1610,7 +1610,7 @@ napi_value Common::GetNotificationLabel(const napi_env &env, const napi_value &v napi_value Common::GetNotificationBadgeIconStyle( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1637,7 +1637,7 @@ napi_value Common::GetNotificationBadgeIconStyle( napi_value Common::GetNotificationShowDeliveryTime( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1689,7 +1689,7 @@ napi_value Common::GetNotificationIsUpdateOnly( napi_value Common::GetNotificationIsRemoveAllowed( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1716,7 +1716,7 @@ napi_value Common::GetNotificationIsRemoveAllowed( napi_value Common::GetNotificationForceDistributed( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1743,7 +1743,7 @@ napi_value Common::GetNotificationForceDistributed( napi_value Common::GetNotificationIsNotDistributed( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; @@ -1770,7 +1770,7 @@ napi_value Common::GetNotificationIsNotDistributed( napi_value Common::GetNotificationActionButtons( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool isArray = false; napi_valuetype valuetype = napi_undefined; @@ -1819,7 +1819,7 @@ napi_value Common::GetNotificationActionButtons( napi_value Common::GetNotificationActionButtonsDetailed( const napi_env &env, const napi_value &actionButton, std::shared_ptr &pActionButton) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!GetNotificationActionButtonsDetailedBasicInfo(env, actionButton, pActionButton)) { return nullptr; @@ -1836,7 +1836,7 @@ napi_value Common::GetNotificationActionButtonsDetailed( napi_value Common::GetNotificationActionButtonsDetailedBasicInfo( const napi_env &env, const napi_value &actionButton, std::shared_ptr &pActionButton) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; bool hasProperty = false; char str[STR_MAX_SIZE] = {0}; @@ -1884,7 +1884,7 @@ napi_value Common::GetNotificationActionButtonsDetailedBasicInfo( } napi_unwrap(env, value, (void **)&wantAgentPtr); if (wantAgentPtr == nullptr) { - ANS_LOGE("Invalid object wantAgent"); + ANS_LOGE("null wantAgent"); return nullptr; } wantAgent = std::make_shared(*wantAgentPtr); @@ -1902,7 +1902,7 @@ napi_value Common::GetNotificationActionButtonsDetailedBasicInfo( } pixelMap = Media::PixelMapNapi::GetPixelMap(env, value); if (pixelMap == nullptr) { - ANS_LOGE("Invalid object pixelMap"); + ANS_LOGE("null pixelMap"); return nullptr; } } @@ -1914,14 +1914,14 @@ napi_value Common::GetNotificationActionButtonsDetailedBasicInfo( napi_value Common::GetNotificationActionButtonsDetailedByExtras( const napi_env &env, const napi_value &actionButton, std::shared_ptr &pActionButton) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; bool hasProperty = false; if (!pActionButton) { - ANS_LOGE("pActionButton is nullptr"); + ANS_LOGE("null pActionButton"); return nullptr; } @@ -1948,7 +1948,7 @@ napi_value Common::GetNotificationActionButtonsDetailedByExtras( napi_value Common::GetNotificationBadgeNumber( const napi_env &env, const napi_value &value, NotificationRequest &request) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; napi_value result = nullptr; diff --git a/frameworks/js/napi/src/common_utils.cpp b/frameworks/js/napi/src/common_utils.cpp index 1023b19bac8025e1ae472f90c3e53ebda76e8c2b..5078ae20729f335e503590262862a08fd15ed9ec 100644 --- a/frameworks/js/napi/src/common_utils.cpp +++ b/frameworks/js/napi/src/common_utils.cpp @@ -54,7 +54,7 @@ napi_value Common::NapiGetUndefined(napi_env env) napi_value Common::CreateErrorValue(napi_env env, int32_t errCode, bool newType) { - ANS_LOGI("enter, errorCode[%{public}d]", errCode); + ANS_LOGI("called, errorCode[%{public}d]", errCode); napi_value error = Common::NapiGetNull(env); if (errCode == ERR_OK && newType) { return error; @@ -74,7 +74,7 @@ napi_value Common::CreateErrorValue(napi_env env, int32_t errCode, bool newType) napi_value Common::CreateErrorValue(napi_env env, int32_t errCode, std::string &msg) { - ANS_LOGI("enter, errorCode[%{public}d]", errCode); + ANS_LOGD("called, errorCode[%{public}d]", errCode); napi_value error = Common::NapiGetNull(env); if (errCode == ERR_OK) { return error; @@ -94,14 +94,14 @@ napi_value Common::CreateErrorValue(napi_env env, int32_t errCode, std::string & void Common::NapiThrow(napi_env env, int32_t errCode) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_throw(env, CreateErrorValue(env, errCode, true)); } void Common::NapiThrow(napi_env env, int32_t errCode, std::string &msg) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_throw(env, CreateErrorValue(env, errCode, msg)); } @@ -119,10 +119,10 @@ napi_value Common::GetCallbackErrorValue(napi_env env, int32_t errCode) void Common::PaddingCallbackPromiseInfo( const napi_env &env, const napi_ref &callback, CallbackPromiseInfo &info, napi_value &promise) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (callback) { - ANS_LOGD("Callback is not nullptr."); + ANS_LOGD("null callback"); info.callback = callback; info.isCallback = true; } else { @@ -135,7 +135,7 @@ void Common::PaddingCallbackPromiseInfo( void Common::ReturnCallbackPromise(const napi_env &env, const CallbackPromiseInfo &info, const napi_value &result) { - ANS_LOGD("enter errorCode=%{public}d", info.errorCode); + ANS_LOGD("start, errorCode=%{public}d", info.errorCode); if (info.isCallback) { SetCallback(env, info.callback, info.errorCode, result, false); } else { @@ -147,7 +147,7 @@ void Common::ReturnCallbackPromise(const napi_env &env, const CallbackPromiseInf void Common::SetCallback( const napi_env &env, const napi_ref &callbackIn, const int32_t &errorCode, const napi_value &result, bool newType) { - ANS_LOGD("enter"); + ANS_LOGD("start"); napi_value undefined = nullptr; napi_get_undefined(env, &undefined); @@ -162,13 +162,13 @@ void Common::SetCallback( ANS_LOGE("napi_call_function failed, result = %{public}d", napi_result); } NAPI_CALL_RETURN_VOID(env, napi_result); - ANS_LOGI("end"); + ANS_LOGD("end"); } void Common::SetCallback( const napi_env &env, const napi_ref &callbackIn, const napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("start"); napi_value undefined = nullptr; napi_get_undefined(env, &undefined); @@ -180,13 +180,13 @@ void Common::SetCallback( ANS_LOGE("napi_call_function failed, result = %{public}d", napi_result); } NAPI_CALL_RETURN_VOID(env, napi_result); - ANS_LOGI("end"); + ANS_LOGD("end"); } void Common::SetCallbackArg2( const napi_env &env, const napi_ref &callbackIn, const napi_value &result0, const napi_value &result1) { - ANS_LOGD("enter"); + ANS_LOGD("start"); napi_value result[ARGS_TWO] = {result0, result1}; napi_value undefined = nullptr; napi_get_undefined(env, &undefined); @@ -199,13 +199,13 @@ void Common::SetCallbackArg2( ANS_LOGE("napi_call_function failed, result = %{public}d", napi_result); } NAPI_CALL_RETURN_VOID(env, napi_result); - ANS_LOGI("end"); + ANS_LOGD("end"); } void Common::SetPromise(const napi_env &env, const napi_deferred &deferred, const int32_t &errorCode, const napi_value &result, bool newType) { - ANS_LOGD("enter"); + ANS_LOGD("start"); if (errorCode == ERR_OK) { napi_resolve_deferred(env, deferred, result); } else { @@ -228,7 +228,7 @@ napi_value Common::JSParaError(const napi_env &env, const napi_ref &callback) napi_value Common::ParseParaOnlyCallback(const napi_env &env, const napi_callback_info &info, napi_ref &callback) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = ONLY_CALLBACK_MAX_PARA; napi_value argv[ONLY_CALLBACK_MAX_PARA] = {nullptr}; @@ -256,7 +256,7 @@ napi_value Common::ParseParaOnlyCallback(const napi_env &env, const napi_callbac void Common::CreateReturnValue(const napi_env &env, const CallbackPromiseInfo &info, const napi_value &result) { - ANS_LOGD("enter errorCode=%{public}d", info.errorCode); + ANS_LOGD("start, errorCode=%{public}d", info.errorCode); int32_t errorCode = info.errorCode == ERR_OK ? ERR_OK : ErrorToExternal(info.errorCode); if (info.isCallback) { SetCallback(env, info.callback, errorCode, result, true); diff --git a/frameworks/js/napi/src/constant.cpp b/frameworks/js/napi/src/constant.cpp index 84aa7a05a22e880818e6fd773b0e189c2fb6b01d..ea63e8069a65d877afa985e30a034c20d4092988 100644 --- a/frameworks/js/napi/src/constant.cpp +++ b/frameworks/js/napi/src/constant.cpp @@ -29,7 +29,7 @@ void SetNamedPropertyByInteger(napi_env env, napi_value dstObj, int32_t objName, napi_value RemoveReasonInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -47,7 +47,7 @@ napi_value RemoveReasonInit(napi_env env, napi_value exports) napi_value SlotTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -72,7 +72,7 @@ napi_value SlotTypeInit(napi_env env, napi_value exports) napi_value SlotLevelInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -93,7 +93,7 @@ napi_value SlotLevelInit(napi_env env, napi_value exports) napi_value SemanticActionButtonInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -127,7 +127,7 @@ napi_value SemanticActionButtonInit(napi_env env, napi_value exports) napi_value InputsSourceInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -145,7 +145,7 @@ napi_value InputsSourceInit(napi_env env, napi_value exports) napi_value DoNotDisturbMode(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -166,7 +166,7 @@ napi_value DoNotDisturbMode(napi_env env, napi_value exports) napi_value InputEditTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -185,7 +185,7 @@ napi_value InputEditTypeInit(napi_env env, napi_value exports) napi_value ContentTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -215,7 +215,7 @@ napi_value ContentTypeInit(napi_env env, napi_value exports) napi_value DoNotDisturbTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -235,7 +235,7 @@ napi_value DoNotDisturbTypeInit(napi_env env, napi_value exports) napi_value DeviceRemindTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -255,7 +255,7 @@ napi_value DeviceRemindTypeInit(napi_env env, napi_value exports) napi_value SourceTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -274,7 +274,7 @@ napi_value SourceTypeInit(napi_env env, napi_value exports) napi_value NotificationControlFlagStatusInit(napi_env env, napi_value exports) { - ANS_LOGD("Called."); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -308,7 +308,7 @@ napi_value NotificationControlFlagStatusInit(napi_env env, napi_value exports) napi_value NotificationFlagTypeInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); @@ -327,7 +327,7 @@ napi_value NotificationFlagTypeInit(napi_env env, napi_value exports) napi_value LiveViewStatusInit(napi_env env, napi_value exports) { - ANS_LOGD("%{public}s, called", __func__); + ANS_LOGD("called"); napi_value obj = nullptr; napi_create_object(env, &obj); diff --git a/frameworks/js/napi/src/disable_notification.cpp b/frameworks/js/napi/src/disable_notification.cpp index fde2792ca35064fbc18c28e1118b1d35ca92930f..e2f10b252c93faff90c36933ef15d91f9c4243a2 100644 --- a/frameworks/js/napi/src/disable_notification.cpp +++ b/frameworks/js/napi/src/disable_notification.cpp @@ -22,7 +22,7 @@ constexpr int8_t DISABLE_MAX_PARA = 2; bool ParseDisabledParameters(const napi_env &env, const napi_value &value, bool &disabled) { - ANS_LOGD("parse disabled"); + ANS_LOGD("called"); napi_valuetype valuetype = napi_undefined; NAPI_CALL_BASE(env, napi_typeof(env, value, &valuetype), false); if (valuetype != napi_boolean) { @@ -37,7 +37,7 @@ bool ParseDisabledParameters(const napi_env &env, const napi_value &value, bool bool ParseBundleListParameters(const napi_env &env, const napi_value &value, std::vector &bundleList) { - ANS_LOGD("parse bundle list"); + ANS_LOGD("called"); bool isArray = false; napi_is_array(env, value, &isArray); if (!isArray) { @@ -82,7 +82,7 @@ bool ParseBundleListParameters(const napi_env &env, const napi_value &value, std bool ParseDisableNotificationParameters( const napi_env &env, const napi_callback_info &info, NotificationDisable ¶m) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = DISABLE_MAX_PARA; napi_value argv[DISABLE_MAX_PARA] = {nullptr}; napi_value thisVar = nullptr; diff --git a/frameworks/js/napi/src/display_badge.cpp b/frameworks/js/napi/src/display_badge.cpp index 7b74a609fea210003aa475282cd2d47e3530dd56..89ea5d5fbffbb1ec357b0de168776d52e1e769d6 100644 --- a/frameworks/js/napi/src/display_badge.cpp +++ b/frameworks/js/napi/src/display_badge.cpp @@ -25,7 +25,7 @@ const int IS_DISPLAY_BADGE_MIN_PARA = 1; napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, EnableBadgeParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = ENABLE_BADGE_DISPLAYED_MAX_PARA; napi_value argv[ENABLE_BADGE_DISPLAYED_MAX_PARA] = {nullptr}; @@ -49,7 +49,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, auto retValue = Common::GetBundleOption(env, argv[PARAM0], params.option); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed"); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -79,7 +79,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, IsDisplayBadgeParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = IS_DISPLAY_BADGE_MAX_PARA; napi_value argv[IS_DISPLAY_BADGE_MAX_PARA] = {nullptr}; @@ -106,7 +106,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, if (valuetype == napi_object) { auto retValue = Common::GetBundleOption(env, argv[PARAM0], params.option); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed."); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -130,7 +130,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value DisplayBadge(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnableBadgeParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -140,7 +140,7 @@ napi_value DisplayBadge(napi_env env, napi_callback_info info) AsyncCallbackInfoEnableBadge *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoEnableBadge {.env = env, .asyncWork = nullptr, .params = params}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, params.callback); } napi_value promise = nullptr; @@ -163,7 +163,7 @@ napi_value DisplayBadge(napi_env env, napi_callback_info info) asynccallbackinfo->params.enable); asynccallbackinfo->info.errorCode = NotificationHelper::SetShowBadgeEnabledForBundle( asynccallbackinfo->params.option, asynccallbackinfo->params.enable); - ANS_LOGI("asynccallbackinfo->info.errorCode : %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGI("errorCode : %{public}d", asynccallbackinfo->info.errorCode); } }, [](napi_env env, napi_status status, void *data) { @@ -187,7 +187,7 @@ napi_value DisplayBadge(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("DisplayBadge callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -196,9 +196,9 @@ napi_value DisplayBadge(napi_env env, napi_callback_info info) void AsyncCompleteCallbackIsBadgeDisplayed(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalidity async callback data"); + ANS_LOGE("null data"); return; } AsyncCallbackInfoIsDisplayBadge *asynccallbackinfo = static_cast(data); @@ -217,7 +217,7 @@ void AsyncCompleteCallbackIsBadgeDisplayed(napi_env env, napi_status status, voi napi_value IsBadgeDisplayed(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsDisplayBadgeParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -228,7 +228,7 @@ napi_value IsBadgeDisplayed(napi_env env, napi_callback_info info) AsyncCallbackInfoIsDisplayBadge *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoIsDisplayBadge {.env = env, .asyncWork = nullptr, .params = params}; if (!asynccallbackinfo) { - ANS_LOGD("Create asynccallbackinfo fail."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, params.callback); } napi_value promise = nullptr; @@ -255,7 +255,7 @@ napi_value IsBadgeDisplayed(napi_env env, napi_callback_info info) asynccallbackinfo->info.errorCode = NotificationHelper::GetShowBadgeEnabled( asynccallbackinfo->enabled); } - ANS_LOGI("asynccallbackinfo->info.errorCode : %{public}d, enabled : %{public}d", + ANS_LOGI("errorCode : %{public}d, enabled : %{public}d", asynccallbackinfo->info.errorCode, asynccallbackinfo->enabled); } }, @@ -266,7 +266,7 @@ napi_value IsBadgeDisplayed(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("IsBadgeDisplayed callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/distributed.cpp b/frameworks/js/napi/src/distributed.cpp index bec1594eb43bb5ed597f4932682e59728df82ea4..359298665fe5ae9a476d9589b19fe15cb9599e59 100644 --- a/frameworks/js/napi/src/distributed.cpp +++ b/frameworks/js/napi/src/distributed.cpp @@ -33,7 +33,7 @@ const int32_t DISTURB_MODE_FLAG = 2; napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, DeviceStatus ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SET_STATUS_PARA_NUM; napi_value argv[SET_STATUS_PARA_NUM] = {nullptr}; napi_value thisVar = nullptr; @@ -85,7 +85,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, EnabledParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = ENABLED_MAX_PARA; napi_value argv[ENABLED_MAX_PARA] = {nullptr}; @@ -123,7 +123,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, EnabledByBundleParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = ENABLED_BUNDLE_MAX_PARA; napi_value argv[ENABLED_BUNDLE_MAX_PARA] = {nullptr}; @@ -176,7 +176,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, IsEnabledByBundleParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = IS_ENABLED_BUNDLE_MAX_PARA; napi_value argv[IS_ENABLED_BUNDLE_MAX_PARA] = {nullptr}; @@ -232,7 +232,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, void AsyncCompleteCallbackIsDistributedEnabled(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data."); return; @@ -259,7 +259,7 @@ void AsyncCompleteCallbackIsDistributedEnabled(napi_env env, napi_status status, napi_value IsDistributedEnabled(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { @@ -308,7 +308,7 @@ napi_value IsDistributedEnabled(napi_env env, napi_callback_info info) napi_value EnableDistributed(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -370,7 +370,7 @@ napi_value EnableDistributed(napi_env env, napi_callback_info info) napi_value EnableDistributedByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledByBundleParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -432,7 +432,7 @@ napi_value EnableDistributedByBundle(napi_env env, napi_callback_info info) napi_value EnableDistributedSelf(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -494,7 +494,7 @@ napi_value EnableDistributedSelf(napi_env env, napi_callback_info info) void AsyncCompleteCallbackIsDistributedEnableByBundle(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -521,7 +521,7 @@ void AsyncCompleteCallbackIsDistributedEnableByBundle(napi_env env, napi_status napi_value IsDistributedEnableByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsEnabledByBundleParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -569,7 +569,7 @@ napi_value IsDistributedEnableByBundle(napi_env env, napi_callback_info info) void AsyncCompleteCallbackGetDeviceRemindType(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalidity async callback data"); return; @@ -602,7 +602,7 @@ void AsyncCompleteCallbackGetDeviceRemindType(napi_env env, napi_status status, napi_value GetDeviceRemindType(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { @@ -649,7 +649,7 @@ napi_value GetDeviceRemindType(napi_env env, napi_callback_info info) napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, EnabledWithoutAppParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = ENABLED_SYNC_MAX_PARA; napi_value argv[ENABLED_SYNC_MAX_PARA] = {nullptr}; @@ -702,7 +702,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value SetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledWithoutAppParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -764,7 +764,7 @@ napi_value SetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_info napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, GetEnabledWithoutAppParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = ENABLED_SYNC_MIN_PARA; napi_value argv[ENABLED_SYNC_MIN_PARA] = {nullptr}; @@ -807,7 +807,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value GetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); GetEnabledWithoutAppParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -868,7 +868,7 @@ napi_value GetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_info napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("GetSyncNotificationEnabledWithoutApp callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } return promise; diff --git a/frameworks/js/napi/src/distributed_operation_callback.cpp b/frameworks/js/napi/src/distributed_operation_callback.cpp index 288c46aaabbc665382a74d19eab3b2cdcd8e3cfd..74368d0cc5548679404ac5ce09dbb3a9af979d7a 100644 --- a/frameworks/js/napi/src/distributed_operation_callback.cpp +++ b/frameworks/js/napi/src/distributed_operation_callback.cpp @@ -32,7 +32,7 @@ ErrCode DistributedOperationCallback::OnOperationCallback(const int32_t operatio { OperationOnCallBack *operationOnCallBack = new (std::nothrow) OperationOnCallBack(); if (operationOnCallBack == nullptr) { - ANS_LOGE("new operationOnCallBack failed"); + ANS_LOGE("null operationOnCallBack"); return ERR_INVALID_DATA; } @@ -45,7 +45,7 @@ ErrCode DistributedOperationCallback::OnOperationCallback(const int32_t operatio operationOnCallBack->deferred = asyncCallbackInfo_.deferred; bool bRet = UvQueue::Call(asyncCallbackInfo_.env, operationOnCallBack, UvWorkOnCallBack); if (!bRet) { - ANS_LOGE("DistributedOperationCallback::OnCallBack failed"); + ANS_LOGE("OnCallBack failed"); } return ERR_OK; } @@ -53,12 +53,12 @@ ErrCode DistributedOperationCallback::OnOperationCallback(const int32_t operatio void DistributedOperationCallback::UvWorkOnCallBack(uv_work_t *work, int32_t status) { if (work == nullptr) { - ANS_LOGE("UvWorkOnCallBack, work is null"); + ANS_LOGE("null work"); return; } OperationOnCallBack *callBackPtr = static_cast(work->data); if (callBackPtr == nullptr) { - ANS_LOGE("UvWorkOnCallBack, callBackPtr is null"); + ANS_LOGE("null callBackPtr"); if (work != nullptr) { delete work; work = nullptr; @@ -81,7 +81,7 @@ void DistributedOperationCallback::UvWorkOnCallBack(uv_work_t *work, int32_t sta delete work; work = nullptr; } - ANS_LOGD("UvWorkOnCallBack end"); + ANS_LOGD("end"); } } // namespace NotificationNapi } // namespace OHOS diff --git a/frameworks/js/napi/src/manager/init_module.cpp b/frameworks/js/napi/src/manager/init_module.cpp index 57478fc46228c1da3ef39a4132b22f0c3a254258..c047d0524bec92137535b0a6881ca3c62308555f 100644 --- a/frameworks/js/napi/src/manager/init_module.cpp +++ b/frameworks/js/napi/src/manager/init_module.cpp @@ -47,7 +47,7 @@ static napi_value NapiPushInit(napi_env env, napi_value exports) { ANS_LOGD("called"); if (env == nullptr || exports == nullptr) { - ANS_LOGE("Invalid input parameters"); + ANS_LOGE("null env or exports"); return nullptr; } @@ -67,7 +67,7 @@ static napi_value NapiPushInit(napi_env env, napi_value exports) napi_value NotificationManagerInit(napi_env env, napi_value exports) { - ANS_LOGD("NotificationManagerInit start"); + ANS_LOGD("called"); napi_property_descriptor desc[] = { DECLARE_NAPI_FUNCTION("publish", NapiPublish), diff --git a/frameworks/js/napi/src/manager/local_live_view_subscribe.cpp b/frameworks/js/napi/src/manager/local_live_view_subscribe.cpp index 285c4248377e108f6902887572ac3a78070d8be3..d46978730a1fcabe4174e53912cecd215219204f 100644 --- a/frameworks/js/napi/src/manager/local_live_view_subscribe.cpp +++ b/frameworks/js/napi/src/manager/local_live_view_subscribe.cpp @@ -44,31 +44,31 @@ LocalLiveViewSubscriberInstance::~LocalLiveViewSubscriberInstance() void LocalLiveViewSubscriberInstance::OnDied() { - ANS_LOGD("enter"); + ANS_LOGD("called"); } void LocalLiveViewSubscriberInstance::OnConnected() { - ANS_LOGD("enter"); + ANS_LOGD("called"); } void LocalLiveViewSubscriberInstance::OnDisconnected() { - ANS_LOGD("enter"); + ANS_LOGD("called"); } void UvQueueWorkOnResponse(uv_work_t *work, int status) { - ANS_LOGI("OnResponse uv_work_t start"); + ANS_LOGD("called"); if (work == nullptr) { - ANS_LOGE("work is nullptr"); + ANS_LOGE("null work"); return; } auto dataWorkerData = reinterpret_cast(work->data); if (dataWorkerData == nullptr) { - ANS_LOGD("dataWorkerData is null."); + ANS_LOGD("null dataWorkerData"); delete work; work = nullptr; return; @@ -79,7 +79,7 @@ void UvQueueWorkOnResponse(uv_work_t *work, int status) napi_value notificationId = nullptr; napi_open_handle_scope(dataWorkerData->env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } @@ -101,31 +101,31 @@ void UvQueueWorkOnResponse(uv_work_t *work, int status) void LocalLiveViewSubscriberInstance::OnResponse(int32_t notificationId, sptr buttonOption) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (responseCallbackInfo_.ref == nullptr) { - ANS_LOGI("response callback unset"); + ANS_LOGE("null ref"); return; } if (buttonOption == nullptr) { - ANS_LOGE("buttonOption is null"); + ANS_LOGE("null buttonOption"); return; } - ANS_LOGI("OnResponse NotificationId = %{public}d", notificationId); - ANS_LOGI("OnResponse buttonOption size = %{public}s", buttonOption->GetButtonName().c_str()); + ANS_LOGI("id = %{public}d", notificationId); + ANS_LOGI("button = %{public}s", buttonOption->GetButtonName().c_str()); uv_loop_s *loop = nullptr; napi_get_uv_event_loop(responseCallbackInfo_.env, &loop); if (loop == nullptr) { - ANS_LOGE("loop instance is nullptr"); + ANS_LOGE("null loop"); return; } LocalLiveViewReceiveDataWorker *dataWorker = new (std::nothrow) LocalLiveViewReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("DataWorker is nullptr."); + ANS_LOGE("null dataWorker"); return; } @@ -136,7 +136,7 @@ void LocalLiveViewSubscriberInstance::OnResponse(int32_t notificationId, sptr lock(mutex_); @@ -240,9 +240,9 @@ bool AddSubscriberInstancesInfo(const napi_env &env, const LocalLiveViewSubscrib bool DelSubscriberInstancesInfo(const napi_env &env, const LocalLiveViewSubscriberInstance *subscriber) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (subscriber == nullptr) { - ANS_LOGE("subscriber is null"); + ANS_LOGE("null subscriber"); return false; } @@ -264,7 +264,7 @@ bool DelSubscriberInstancesInfo(const napi_env &env, const LocalLiveViewSubscrib napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, LocalLiveViewSubscriberInstance *&subscriber, napi_ref &callback) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SUBSRIBE_MAX_PARA; napi_value argv[SUBSRIBE_MAX_PARA] = {nullptr}; diff --git a/frameworks/js/napi/src/manager/napi_cancel.cpp b/frameworks/js/napi/src/manager/napi_cancel.cpp index 96baa784eb8ed858aa5dcceb8eb4f336fb4cce14..70b0ce336af4c864a6cc0be2564941638afbcd61 100644 --- a/frameworks/js/napi/src/manager/napi_cancel.cpp +++ b/frameworks/js/napi/src/manager/napi_cancel.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace NotificationNapi { napi_value NapiCancel(napi_env env, napi_callback_info info) { - ANS_LOGI("enter"); + ANS_LOGD("called"); ParametersInfoCancel paras; if (ParseParameters(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -87,7 +87,7 @@ napi_value NapiCancel(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiCancel callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -96,7 +96,7 @@ napi_value NapiCancel(napi_env env, napi_callback_info info) napi_value NapiCancelAll(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -148,7 +148,7 @@ napi_value NapiCancelAll(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiCancelAll callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -157,7 +157,7 @@ napi_value NapiCancelAll(napi_env env, napi_callback_info info) napi_value NapiCancelGroup(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoCancelGroup params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -212,7 +212,7 @@ napi_value NapiCancelGroup(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiCancelGroup callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -221,7 +221,7 @@ napi_value NapiCancelGroup(napi_env env, napi_callback_info info) napi_value NapiCancelAsBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoCancelAsBundle paras; if (ParseParameters(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -285,7 +285,7 @@ napi_value NapiCancelAsBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiCancelAsBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_disable_notification.cpp b/frameworks/js/napi/src/manager/napi_disable_notification.cpp index eb80040acfc72076d1ad35ff3f0469a72e93dd9d..8fa795121f4973d163d937da5910417aba532865 100644 --- a/frameworks/js/napi/src/manager/napi_disable_notification.cpp +++ b/frameworks/js/napi/src/manager/napi_disable_notification.cpp @@ -23,7 +23,7 @@ namespace NotificationNapi { napi_value NapiDisableNotificationFeature(napi_env env, napi_callback_info info) { #ifdef DISABLE_NOTIFICATION_FEATURE_ENABLE - ANS_LOGD("enter NapiDisableNotificationFeature"); + ANS_LOGD("called"); NotificationDisable paras; if (!ParseDisableNotificationParameters(env, info, paras)) { Common::NapiThrow(env, ERROR_PARAM_INVALID); diff --git a/frameworks/js/napi/src/manager/napi_display_badge.cpp b/frameworks/js/napi/src/manager/napi_display_badge.cpp index 8bbced666e63d0523ffd333e97f58772a7986908..098e832a5f5a4cc3ecc3ae027faa6e333f57cdca 100644 --- a/frameworks/js/napi/src/manager/napi_display_badge.cpp +++ b/frameworks/js/napi/src/manager/napi_display_badge.cpp @@ -26,7 +26,7 @@ const int32_t SET_BADGE_NUMBER_BY_BUNDLE_PARA = 2; napi_value NapiDisplayBadge(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnableBadgeParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -83,7 +83,7 @@ napi_value NapiDisplayBadge(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiDisplayBadge callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -92,7 +92,7 @@ napi_value NapiDisplayBadge(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiIsBadgeDisplayed(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -113,7 +113,7 @@ void AsyncCompleteCallbackNapiIsBadgeDisplayed(napi_env env, napi_status status, napi_value NapiIsBadgeDisplayed(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsDisplayBadgeParams params {}; if (ParseParameters(env, info, params) == nullptr) { ANS_LOGE("Failed to parse params!"); @@ -150,7 +150,7 @@ napi_value NapiIsBadgeDisplayed(napi_env env, napi_callback_info info) asynccallbackinfo->info.errorCode = NotificationHelper::GetShowBadgeEnabled( asynccallbackinfo->enabled); } - ANS_LOGI("asynccallbackinfo->info.errorCode = %{public}d, enabled = %{public}d", + ANS_LOGI("errorCode = %{public}d, enabled = %{public}d", asynccallbackinfo->info.errorCode, asynccallbackinfo->enabled); } }, @@ -162,7 +162,7 @@ napi_value NapiIsBadgeDisplayed(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiIsBadgeDisplayed callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -171,7 +171,7 @@ napi_value NapiIsBadgeDisplayed(napi_env env, napi_callback_info info) napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, SetBadgeNumberParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SET_BADGE_NUMBER_MAX_PARA; napi_value argv[SET_BADGE_NUMBER_MAX_PARA] = {nullptr}; @@ -230,7 +230,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, void AsyncCompleteCallbackNapiSetBadgeNumber(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -247,7 +247,7 @@ void AsyncCompleteCallbackNapiSetBadgeNumber(napi_env env, napi_status status, v napi_value NapiSetBadgeNumber(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); SetBadgeNumberParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -273,7 +273,7 @@ napi_value NapiSetBadgeNumber(napi_env env, napi_callback_info info) ANS_LOGD("NapiSetBadgeNumber work excute."); AsyncCallbackSetBadgeNumber *asynccallbackinfo = static_cast(data); if (asynccallbackinfo) { - ANS_LOGI("option.badgeNumber: %{public}d", asynccallbackinfo->params.badgeNumber); + ANS_LOGI("badgeNumber: %{public}d", asynccallbackinfo->params.badgeNumber); std::string instanceKey = Common::GetAppInstanceKey(); asynccallbackinfo->info.errorCode = NotificationHelper::SetBadgeNumber( asynccallbackinfo->params.badgeNumber, instanceKey); @@ -287,7 +287,7 @@ napi_value NapiSetBadgeNumber(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSetBadgeNumber callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -296,7 +296,7 @@ napi_value NapiSetBadgeNumber(napi_env env, napi_callback_info info) napi_value NapiSetBadgeNumberByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("Enter."); + ANS_LOGD("called"); SetBadgeNumberParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -338,7 +338,7 @@ napi_value NapiSetBadgeNumberByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asyncCallbackInfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("Callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_distributed.cpp b/frameworks/js/napi/src/manager/napi_distributed.cpp index 1455c1dd8350e53c3b93a7cd7865851edabea036..c771a73bf6dfaf14f4d08dbb6729c9aa2bfe853d 100644 --- a/frameworks/js/napi/src/manager/napi_distributed.cpp +++ b/frameworks/js/napi/src/manager/napi_distributed.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace NotificationNapi { void AsyncCompleteCallbackNapiIsDistributedEnabled(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -49,7 +49,7 @@ void AsyncCompleteCallbackNapiIsDistributedEnabled(napi_env env, napi_status sta napi_value NapiIsDistributedEnabled(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { @@ -89,7 +89,7 @@ napi_value NapiIsDistributedEnabled(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiIsDistributedEnabled callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -98,11 +98,11 @@ napi_value NapiIsDistributedEnabled(napi_env env, napi_callback_info info) napi_value NapiEnableDistributed(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledParams params {}; if (ParseParameters(env, info, params) == nullptr) { - ANS_LOGD("ParseParameters is nullptr."); + ANS_LOGD("null ParseParameters"); Common::NapiThrow(env, ERROR_PARAM_INVALID); return Common::NapiGetUndefined(env); } @@ -155,7 +155,7 @@ napi_value NapiEnableDistributed(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiEnableDistributed callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -164,7 +164,7 @@ napi_value NapiEnableDistributed(napi_env env, napi_callback_info info) napi_value NapiEnableDistributedByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledByBundleParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -217,7 +217,7 @@ napi_value NapiEnableDistributedByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiEnableDistributedByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -226,7 +226,7 @@ napi_value NapiEnableDistributedByBundle(napi_env env, napi_callback_info info) napi_value NapiEnableDistributedSelf(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -281,7 +281,7 @@ napi_value NapiEnableDistributedSelf(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiEnableDistributedSelf callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -290,7 +290,7 @@ napi_value NapiEnableDistributedSelf(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiIsDistributedEnableByBundle(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -317,7 +317,7 @@ void AsyncCompleteCallbackNapiIsDistributedEnableByBundle(napi_env env, napi_sta napi_value NapiIsDistributedEnableByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsEnabledByBundleParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -364,7 +364,7 @@ napi_value NapiIsDistributedEnableByBundle(napi_env env, napi_callback_info info napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiIsDistributedEnableByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -373,7 +373,7 @@ napi_value NapiIsDistributedEnableByBundle(napi_env env, napi_callback_info info void AsyncCompleteCallbackNapiGetDeviceRemindType(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -405,7 +405,7 @@ void AsyncCompleteCallbackNapiGetDeviceRemindType(napi_env env, napi_status stat napi_value NapiGetDeviceRemindType(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { @@ -444,7 +444,7 @@ napi_value NapiGetDeviceRemindType(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetDeviceRemindType callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -453,7 +453,7 @@ napi_value NapiGetDeviceRemindType(napi_env env, napi_callback_info info) napi_value NapiSetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnabledWithoutAppParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -509,7 +509,7 @@ napi_value NapiSetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_ napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSetSyncNotificationEnabledWithoutApp callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -518,7 +518,7 @@ napi_value NapiSetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_ napi_value NapiGetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); GetEnabledWithoutAppParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -581,7 +581,7 @@ napi_value NapiGetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_ napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSyncNotificationEnabledWithoutApp callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -590,7 +590,7 @@ napi_value NapiGetSyncNotificationEnabledWithoutApp(napi_env env, napi_callback_ napi_value NapiSetTargetDeviceStatus(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); DeviceStatus paras; if (ParseParameters(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -635,7 +635,7 @@ napi_value NapiSetTargetDeviceStatus(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("NapiSetTargetDeviceStatus callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_distributed_enable.cpp b/frameworks/js/napi/src/manager/napi_distributed_enable.cpp index 782b15e692a49dee7301cbc1198a774039ebe219..9d57fc87a8059c6638866d4737bef44b7cd438b5 100644 --- a/frameworks/js/napi/src/manager/napi_distributed_enable.cpp +++ b/frameworks/js/napi/src/manager/napi_distributed_enable.cpp @@ -31,7 +31,7 @@ static const std::set DEVICE_TYPES = {"headset", "liteWearable", "w napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, DistributedEnableParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SET_DISTRIBUTED_ENABLE_MAX_PARA; napi_value argv[SET_DISTRIBUTED_ENABLE_MAX_PARA] = {nullptr}; @@ -54,7 +54,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, } auto retValue = Common::GetBundleOption(env, argv[PARAM0], params.option); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed."); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -94,7 +94,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, void AsyncCompleteCallbackNapiSetDistributedEnabledByBundle(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -114,7 +114,7 @@ void AsyncCompleteCallbackNapiSetDistributedEnabledByBundle(napi_env env, napi_s napi_value NapiSetDistributedEnabledByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); DistributedEnableParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -143,7 +143,7 @@ napi_value NapiSetDistributedEnabledByBundle(napi_env env, napi_callback_info in std::string deviceType = asynccallbackinfo->params.deviceType; asynccallbackinfo->info.errorCode = NotificationHelper::SetDistributedEnabledByBundle( asynccallbackinfo->params.option, deviceType, asynccallbackinfo->params.enable); - ANS_LOGI("asynccallbackinfo->info.errorCode = %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGI("errorCode = %{public}d", asynccallbackinfo->info.errorCode); } }, AsyncCompleteCallbackNapiSetDistributedEnabledByBundle, @@ -157,7 +157,7 @@ napi_value NapiSetDistributedEnabledByBundle(napi_env env, napi_callback_info in void AsyncCompleteCallbackNapiSetSmartReminderEnabled(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -177,7 +177,7 @@ void AsyncCompleteCallbackNapiSetSmartReminderEnabled(napi_env env, napi_status napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, SmartReminderEnabledParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SET_SMART_REMINDER_ENABLE_MAX_PARA; napi_value argv[SET_SMART_REMINDER_ENABLE_MAX_PARA] = {nullptr}; @@ -225,7 +225,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value NapiSetSmartReminderEnabled(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); SmartReminderEnabledParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -254,7 +254,7 @@ napi_value NapiSetSmartReminderEnabled(napi_env env, napi_callback_info info) if (asynccallbackinfo) { asynccallbackinfo->info.errorCode = NotificationHelper::SetSmartReminderEnabled( asynccallbackinfo->params.deviceType, asynccallbackinfo->params.enable); - ANS_LOGD("asynccallbackinfo->info.errorCode = %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGD("errorCode = %{public}d", asynccallbackinfo->info.errorCode); } }, AsyncCompleteCallbackNapiSetSmartReminderEnabled, @@ -267,7 +267,7 @@ napi_value NapiSetSmartReminderEnabled(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiIsSmartReminderEnabled(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -294,7 +294,7 @@ void AsyncCompleteCallbackNapiIsSmartReminderEnabled(napi_env env, napi_status s napi_value NapiIsSmartReminderEnabled(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); SmartReminderEnabledParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -323,7 +323,7 @@ napi_value NapiIsSmartReminderEnabled(napi_env env, napi_callback_info info) if (asynccallbackinfo) { asynccallbackinfo->info.errorCode = NotificationHelper::IsSmartReminderEnabled( asynccallbackinfo->params.deviceType, asynccallbackinfo->params.enable); - ANS_LOGD("asynccallbackinfo->info.errorCode = %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGD("errorCode = %{public}d", asynccallbackinfo->info.errorCode); } }, AsyncCompleteCallbackNapiIsSmartReminderEnabled, @@ -337,7 +337,7 @@ napi_value NapiIsSmartReminderEnabled(napi_env env, napi_callback_info info) napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, DistributedEnableBySlotParams ¶ms, bool setOperation) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SET_DISTRIBUTED_ENABLE_BY_SLOT_PARA; napi_value argv[SET_DISTRIBUTED_ENABLE_BY_SLOT_PARA] = {nullptr}; napi_value thisVar = nullptr; @@ -408,7 +408,7 @@ napi_value ParseParameters(const napi_env &env, void AsyncCompleteCallbackNapiSetDistributedEnabledBySlot(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -428,7 +428,7 @@ void AsyncCompleteCallbackNapiSetDistributedEnabledBySlot(napi_env env, napi_sta napi_value NapiSetDistributedEnabledBySlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); DistributedEnableBySlotParams params {}; if (ParseParameters(env, info, params, true) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -459,7 +459,7 @@ napi_value NapiSetDistributedEnabledBySlot(napi_env env, napi_callback_info info asynccallbackinfo->params.slot, asynccallbackinfo->params.deviceType, asynccallbackinfo->params.enable); - ANS_LOGI("asynccallbackinfo->info.errorCode = %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGI("errorCode = %{public}d", asynccallbackinfo->info.errorCode); } }, AsyncCompleteCallbackNapiSetDistributedEnabledBySlot, @@ -473,7 +473,7 @@ napi_value NapiSetDistributedEnabledBySlot(napi_env env, napi_callback_info info void AsyncCompleteCallbackNapiIsDistributedEnabledBySlot(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -500,7 +500,7 @@ void AsyncCompleteCallbackNapiIsDistributedEnabledBySlot(napi_env env, napi_stat napi_value NapiIsDistributedEnabledBySlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); DistributedEnableBySlotParams params {}; if (ParseParameters(env, info, params, false) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -531,7 +531,7 @@ napi_value NapiIsDistributedEnabledBySlot(napi_env env, napi_callback_info info) asynccallbackinfo->params.slot, asynccallbackinfo->params.deviceType, asynccallbackinfo->params.enable); - ANS_LOGD("asynccallbackinfo->info.errorCode = %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGD("errorCode = %{public}d", asynccallbackinfo->info.errorCode); } }, AsyncCompleteCallbackNapiIsDistributedEnabledBySlot, diff --git a/frameworks/js/napi/src/manager/napi_disturb_mode.cpp b/frameworks/js/napi/src/manager/napi_disturb_mode.cpp index 15252415db2b0586309a4fc4512dc4f90726c8c7..322b66af888d75905c5f8890714463a3d7033b7c 100644 --- a/frameworks/js/napi/src/manager/napi_disturb_mode.cpp +++ b/frameworks/js/napi/src/manager/napi_disturb_mode.cpp @@ -21,7 +21,7 @@ namespace OHOS { namespace NotificationNapi { napi_value NapiSetDoNotDisturbDate(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); SetDoNotDisturbDateParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -79,7 +79,7 @@ napi_value NapiSetDoNotDisturbDate(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSetDoNotDisturbDate callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -88,7 +88,7 @@ napi_value NapiSetDoNotDisturbDate(napi_env env, napi_callback_info info) napi_value NapiAddDoNotDisturbProfiles(napi_env env, napi_callback_info info) { - ANS_LOGD("Called."); + ANS_LOGD("called"); std::vector> profiles; if (!ParseProfilesParameters(env, info, profiles)) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -134,7 +134,7 @@ napi_value NapiAddDoNotDisturbProfiles(napi_env env, napi_callback_info info) napi_value NapiRemoveDoNotDisturbProfiles(napi_env env, napi_callback_info info) { - ANS_LOGD("Called."); + ANS_LOGD("called"); std::vector> profiles; if (!ParseProfilesParameters(env, info, profiles)) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -180,7 +180,7 @@ napi_value NapiRemoveDoNotDisturbProfiles(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetDoNotDisturbDate(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -206,7 +206,7 @@ void AsyncCompleteCallbackNapiGetDoNotDisturbDate(napi_env env, napi_status stat napi_value NapiGetDoNotDisturbDate(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); GetDoNotDisturbDateParams params {}; if (ParseParameters(env, info, params) == nullptr) { @@ -255,7 +255,7 @@ napi_value NapiGetDoNotDisturbDate(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetDoNotDisturbDate callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -264,7 +264,7 @@ napi_value NapiGetDoNotDisturbDate(napi_env env, napi_callback_info info) napi_value NapiSupportDoNotDisturbMode(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { @@ -325,7 +325,7 @@ napi_value NapiSupportDoNotDisturbMode(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSupportDoNotDisturbMode callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -334,7 +334,7 @@ napi_value NapiSupportDoNotDisturbMode(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetDoNotDisturbProfile(napi_env env, napi_status status, void *data) { - ANS_LOGD("GetDoNotDisturbProfile complete enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data."); return; @@ -368,7 +368,7 @@ void AsyncCompleteCallbackNapiGetDoNotDisturbProfile(napi_env env, napi_status s napi_value NapiGetDoNotDisturbProfile(napi_env env, napi_callback_info info) { - ANS_LOGD("NapiGetDoNotDisturbProfile enter"); + ANS_LOGD("called"); GetDoNotDisturbProfileParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -406,7 +406,7 @@ napi_value NapiGetDoNotDisturbProfile(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("NapiGetDoNotDisturbProfile callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_enable_notification.cpp b/frameworks/js/napi/src/manager/napi_enable_notification.cpp index c59f7278e1b3ae7be0a65e0975b764d44fb3b9e8..cb2baf0cfa2aed8a8ff370d7a83544191e28ce47 100644 --- a/frameworks/js/napi/src/manager/napi_enable_notification.cpp +++ b/frameworks/js/napi/src/manager/napi_enable_notification.cpp @@ -28,7 +28,7 @@ namespace NotificationNapi { const int IS_NOTIFICATION_ENABLE_MAX_PARA = 2; void AsyncCompleteCallbackNapiEnableNotification(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -48,7 +48,7 @@ void AsyncCompleteCallbackNapiEnableNotification(napi_env env, napi_status statu napi_value NapiEnableNotification(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); EnableParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -77,7 +77,7 @@ napi_value NapiEnableNotification(napi_env env, napi_callback_info info) std::string deviceId {""}; asynccallbackinfo->info.errorCode = NotificationHelper::SetNotificationsEnabledForSpecifiedBundle( asynccallbackinfo->params.option, deviceId, asynccallbackinfo->params.enable); - ANS_LOGI("asynccallbackinfo->info.errorCode = %{public}d", asynccallbackinfo->info.errorCode); + ANS_LOGI("errorCode = %{public}d", asynccallbackinfo->info.errorCode); } }, AsyncCompleteCallbackNapiEnableNotification, @@ -88,7 +88,7 @@ napi_value NapiEnableNotification(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiEnableNotification callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -97,7 +97,7 @@ napi_value NapiEnableNotification(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiIsNotificationEnabled(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -118,10 +118,10 @@ void AsyncCompleteCallbackNapiIsNotificationEnabled(napi_env env, napi_status st __attribute__((no_sanitize("cfi"))) napi_value NapiIsNotificationEnabled(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsEnableParams params {}; if (ParseParameters(env, info, params) == nullptr) { - ANS_LOGD("ParseParameters is nullptr."); + ANS_LOGD("null ParseParameters"); Common::NapiThrow(env, ERROR_PARAM_INVALID); return Common::NapiGetUndefined(env); } @@ -129,7 +129,7 @@ __attribute__((no_sanitize("cfi"))) napi_value NapiIsNotificationEnabled(napi_en AsyncCallbackInfoIsEnable *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoIsEnable {.env = env, .asyncWork = nullptr, .params = params}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); Common::NapiThrow(env, ERROR_INTERNAL_ERROR); return Common::JSParaError(env, params.callback); } @@ -160,7 +160,7 @@ __attribute__((no_sanitize("cfi"))) napi_value NapiIsNotificationEnabled(napi_en asynccallbackinfo->info.errorCode = NotificationHelper::IsAllowedNotifySelf( asynccallbackinfo->allowed); } - ANS_LOGI("asynccallbackinfo->info.errorCode:%{public}d, allowed:%{public}d", + ANS_LOGI("errorCode:%{public}d, allowed:%{public}d", asynccallbackinfo->info.errorCode, asynccallbackinfo->allowed); } }, @@ -172,7 +172,7 @@ __attribute__((no_sanitize("cfi"))) napi_value NapiIsNotificationEnabled(napi_en napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiIsNotificationEnabled callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -181,7 +181,7 @@ __attribute__((no_sanitize("cfi"))) napi_value NapiIsNotificationEnabled(napi_en napi_value NapiIsNotificationEnabledSelf(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsEnableParams params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -191,7 +191,7 @@ napi_value NapiIsNotificationEnabledSelf(napi_env env, napi_callback_info info) AsyncCallbackInfoIsEnable *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoIsEnable {.env = env, .asyncWork = nullptr, .params = params}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is null."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, params.callback); } napi_value promise = nullptr; @@ -213,7 +213,7 @@ napi_value NapiIsNotificationEnabledSelf(napi_env env, napi_callback_info info) asynccallbackinfo->info.errorCode = NotificationHelper::IsAllowedNotifySelf(asynccallbackinfo->allowed); } - ANS_LOGD("asynccallbackinfo->info.errorCode:%{public}d, allowed:%{public}d", + ANS_LOGD("errorCode: %{public}d, allowed:%{public}d", asynccallbackinfo->info.errorCode, asynccallbackinfo->allowed); } }, @@ -225,7 +225,7 @@ napi_value NapiIsNotificationEnabledSelf(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiIsNotificationEnabledSelf callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -234,9 +234,9 @@ napi_value NapiIsNotificationEnabledSelf(napi_env env, napi_callback_info info) void NapiAsyncCompleteCallbackRequestEnableNotification(napi_env env, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (data == nullptr) { - ANS_LOGE("Invalid async callback data."); + ANS_LOGE("null data"); return; } auto* asynccallbackinfo = static_cast(data); @@ -252,7 +252,7 @@ void NapiAsyncCompleteCallbackRequestEnableNotification(napi_env env, void *data napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) { - ANS_LOGI("NapiRequestEnableNotification enter"); + ANS_LOGD("called"); IsEnableParams params {}; if (ParseRequestEnableParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -272,9 +272,9 @@ napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) napi_create_string_latin1(env, "RequestEnableNotification", NAPI_AUTO_LENGTH, &resourceName); auto ipcCall = [](napi_env env, void* data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (data == nullptr) { - ANS_LOGE("data is invalid"); + ANS_LOGE("null data"); return; } auto* asynccallbackinfo = static_cast(data); @@ -291,8 +291,7 @@ napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) bool canPop = false; std::string bundleName {""}; ErrCode errCode = NotificationHelper::CanPopEnableNotificationDialog(client, canPop, bundleName); - ANS_LOGI("CanPopEnableNotificationDialog result, errCode:%{public}d, canPop:%{public}d", - errCode, canPop); + ANS_LOGI("errCode:%{public}d, canPop:%{public}d", errCode, canPop); if (canPop == false) { asynccallbackinfo->info.errorCode = errCode; return; @@ -305,12 +304,12 @@ napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) NotificationHelper::RequestEnableNotification(deviceId, client, asynccallbackinfo->params.callerToken); } - ANS_LOGI("done, code is %{public}d.", asynccallbackinfo->info.errorCode); + ANS_LOGI("errorCode: %{public}d", asynccallbackinfo->info.errorCode); }; auto jsCb = [](napi_env env, napi_status status, void* data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (data == nullptr) { - ANS_LOGE("data is nullptr"); + ANS_LOGE("null data"); return; } auto* asynccallbackinfo = static_cast(data); @@ -325,7 +324,7 @@ napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) } ErrCode errCode = asynccallbackinfo->info.errorCode; if (errCode != ERR_ANS_DIALOG_POP_SUCCEEDED) { - ANS_LOGE("error, code is %{public}d.", errCode); + ANS_LOGE("errCode: %{public}d", errCode); NapiAsyncCompleteCallbackRequestEnableNotification(env, static_cast(asynccallbackinfo)); return; } @@ -354,7 +353,7 @@ napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiRequestEnableNotification callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -363,7 +362,7 @@ napi_value NapiRequestEnableNotification(napi_env env, napi_callback_info info) napi_value ParseRequestEnableParameters(const napi_env &env, const napi_callback_info &info, IsEnableParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = IS_NOTIFICATION_ENABLE_MAX_PARA; napi_value argv[IS_NOTIFICATION_ENABLE_MAX_PARA] = {nullptr}; @@ -410,7 +409,7 @@ napi_value ParseRequestEnableParameters(const napi_env &env, const napi_callback void AsyncCompleteCallbackNapiGetAllNotificationEnableStatus(napi_env env, napi_status status, void *data) { - ANS_LOGD("Called."); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data"); return; @@ -418,7 +417,7 @@ void AsyncCompleteCallbackNapiGetAllNotificationEnableStatus(napi_env env, napi_ napi_value result = nullptr; AsyncCallbackInfoEnableStatus *asynccallbackinfo = static_cast(data); if (asynccallbackinfo == nullptr) { - ANS_LOGE("asynccallbackinfo is nullptr"); + ANS_LOGE("null asynccallbackinfo"); return; } if (asynccallbackinfo->info.errorCode != ERR_OK) { @@ -447,12 +446,12 @@ void AsyncCompleteCallbackNapiGetAllNotificationEnableStatus(napi_env env, napi_ napi_value NapiGetAllNotificationEnabledBundles(napi_env env, napi_callback_info info) { - ANS_LOGD("Called"); + ANS_LOGD("called"); napi_ref callback = nullptr; AsyncCallbackInfoEnableStatus *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoEnableStatus{ .env = env, .asyncWork = nullptr }; if (asynccallbackinfo == nullptr) { - ANS_LOGE("asynccallbackinfo is nullptr"); + ANS_LOGE("null asynccallbackinfo"); Common::NapiThrow(env, ERROR_INTERNAL_ERROR); return Common::NapiGetUndefined(env); } @@ -487,7 +486,7 @@ napi_value NapiGetAllNotificationEnabledBundles(napi_env env, napi_callback_info } if (isCallback) { - ANS_LOGD("Callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -496,10 +495,10 @@ napi_value NapiGetAllNotificationEnabledBundles(napi_env env, napi_callback_info napi_value NapiIsNotificationEnabledSync(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); IsEnableParams params {}; if (ParseParameters(env, info, params) == nullptr) { - ANS_LOGD("ParseParameters is nullptr."); + ANS_LOGD("null ParseParameters"); Common::NapiThrow(env, ERROR_PARAM_INVALID); return Common::NapiGetUndefined(env); } @@ -514,19 +513,19 @@ napi_value NapiIsNotificationEnabledSync(napi_env env, napi_callback_info info) bool CreateUIExtension(std::shared_ptr context, std::string &bundleName) { if (context == nullptr) { - ANS_LOGE("Get context failed"); + ANS_LOGE("null context"); return false; } std::shared_ptr abilityContext = OHOS::AbilityRuntime::Context::ConvertTo(context); if (abilityContext == nullptr) { - ANS_LOGE("abilityContext is null"); + ANS_LOGE("null abilityContext"); return false; } auto uiContent = abilityContext->GetUIContent(); if (uiContent == nullptr) { - ANS_LOGE("uiContent is null"); + ANS_LOGE("null uiContent"); return false; } @@ -557,7 +556,7 @@ bool CreateUIExtension(std::shared_ptr context, s config.isProhibitBack = true; int32_t sessionId = uiContent->CreateModalUIExtension(want, uiExtensionCallbacks, config); - ANS_LOGI("Create end, sessionId: %{public}d", sessionId); + ANS_LOGI("sessionId: %{public}d", sessionId); if (sessionId == 0) { ANS_LOGE("Create component failed, sessionId is 0"); return false; @@ -590,7 +589,7 @@ ModalExtensionCallback::~ModalExtensionCallback() */ void ModalExtensionCallback::OnResult(int32_t resultCode, const AAFwk::Want& result) { - ANS_LOGD("OnResult"); + ANS_LOGD("called"); } /* @@ -598,7 +597,7 @@ void ModalExtensionCallback::OnResult(int32_t resultCode, const AAFwk::Want& res */ void ModalExtensionCallback::OnReceive(const AAFwk::WantParams& receive) { - ANS_LOGD("OnReceive"); + ANS_LOGD("called"); } /* @@ -607,7 +606,7 @@ void ModalExtensionCallback::OnReceive(const AAFwk::WantParams& receive) */ void ModalExtensionCallback::OnRelease(int32_t releaseCode) { - ANS_LOGI("OnRelease"); + ANS_LOGI("called"); ReleaseOrErrorHandle(releaseCode); } @@ -616,7 +615,7 @@ void ModalExtensionCallback::OnRelease(int32_t releaseCode) */ void ModalExtensionCallback::OnError(int32_t code, const std::string& name, const std::string& message) { - ANS_LOGE("OnError, name = %{public}s, message = %{public}s", name.c_str(), message.c_str()); + ANS_LOGD("called, name = %{public}s, message = %{public}s", name.c_str(), message.c_str()); ReleaseOrErrorHandle(code); NotificationHelper::RemoveEnableNotificationDialog(); } @@ -627,7 +626,7 @@ void ModalExtensionCallback::OnError(int32_t code, const std::string& name, cons */ void ModalExtensionCallback::OnRemoteReady(const std::shared_ptr& uiProxy) { - ANS_LOGD("OnRemoteReady"); + ANS_LOGD("called"); } /* @@ -635,7 +634,7 @@ void ModalExtensionCallback::OnRemoteReady(const std::shared_ptrabilityContext_->GetUIContent(); if (uiContent == nullptr) { - ANS_LOGE("uiContent is null"); + ANS_LOGE("null uiContent"); return; } uiContent->CloseModalUIExtension(this->sessionId_); - ANS_LOGD("ReleaseOrErrorHandle end"); + ANS_LOGD("end"); return; } diff --git a/frameworks/js/napi/src/manager/napi_get_active.cpp b/frameworks/js/napi/src/manager/napi_get_active.cpp index 2e1ff088ead220643ac997a9fd1e702260cf8d42..7656024c1c5580bc1558277d28f75727ff57ad72 100644 --- a/frameworks/js/napi/src/manager/napi_get_active.cpp +++ b/frameworks/js/napi/src/manager/napi_get_active.cpp @@ -25,7 +25,7 @@ namespace OHOS { namespace NotificationNapi { void AsyncCompleteCallbackNapiGetAllActiveNotifications(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { ANS_LOGE("Invalid async callback data."); return; @@ -75,17 +75,17 @@ void AsyncCompleteCallbackNapiGetAllActiveNotifications(napi_env env, napi_statu napi_value NapiGetAllActiveNotifications(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { - ANS_LOGD("ParseParaOnlyCallback is nullptr."); + ANS_LOGD("null ParseParaOnlyCallback"); Common::NapiThrow(env, ERROR_PARAM_INVALID); return Common::NapiGetUndefined(env); } auto asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoActive {.env = env, .asyncWork = nullptr}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); Common::NapiThrow(env, ERROR_INTERNAL_ERROR); return Common::JSParaError(env, callback); } @@ -115,7 +115,7 @@ napi_value NapiGetAllActiveNotifications(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetAllActiveNotifications callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -173,10 +173,10 @@ void AsyncCompleteCallbackNapiGetActiveNotifications(napi_env env, napi_status s napi_value NapiGetActiveNotifications(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { - ANS_LOGD("Callback is nullptr."); + ANS_LOGD("null ParseParaOnlyCallback"); Common::NapiThrow(env, ERROR_PARAM_INVALID); return Common::NapiGetUndefined(env); } @@ -215,7 +215,7 @@ napi_value NapiGetActiveNotifications(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetActiveNotifications callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -251,7 +251,7 @@ void AsyncCompleteCallbackNapiGetActiveNotificationCount(napi_env env, napi_stat napi_value NapiGetActiveNotificationCount(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -289,7 +289,7 @@ napi_value NapiGetActiveNotificationCount(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetActiveNotificationCount callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -301,24 +301,24 @@ napi_value ParseGetLiveViewFilter(const napi_env &env, const napi_value &obj, Li // bundle napi_value result = AppExecFwk::GetPropertyValueByPropertyName(env, obj, "bundle", napi_object); if (result == nullptr) { - ANS_LOGE("Failed to get bundle from params."); + ANS_LOGE("null result"); return nullptr; } auto retValue = Common::GetBundleOption(env, result, filter.bundle); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed"); + ANS_LOGE("null retValue"); return nullptr; } // notificationKey result = AppExecFwk::GetPropertyValueByPropertyName(env, obj, "notificationKey", napi_object); if (result == nullptr) { - ANS_LOGE("Failed to get notificationKeys from params."); + ANS_LOGE("null result"); return nullptr; } retValue = Common::GetNotificationKey(env, result, filter.notificationKey); if (retValue == nullptr) { - ANS_LOGE("GetNotificationKey failed"); + ANS_LOGE("null retValue"); return nullptr; } @@ -339,7 +339,7 @@ napi_value ParseGetLiveViewFilter(const napi_env &env, const napi_value &obj, Li napi_value ParseGetLiveViewParams(const napi_env &env, const napi_callback_info &info, LiveViewFilter &filter, napi_ref &callback) { - ANS_LOGD("enter"); + ANS_LOGD("start"); size_t argc = ARGS_TWO; napi_value argv[ARGS_TWO] = {nullptr}; @@ -378,7 +378,7 @@ napi_value ParseGetLiveViewParams(const napi_env &env, const napi_callback_info void AsyncGetLiveViewExecute(napi_env env, void *data) { - ANS_LOGD("NapiGetActiveNotificationByFilter work excute."); + ANS_LOGD("called"); auto asyncLiveViewCallBackInfo = static_cast(data); if (asyncLiveViewCallBackInfo) { @@ -389,11 +389,11 @@ void AsyncGetLiveViewExecute(napi_env env, void *data) void AsyncGetLiveViewComplete(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); auto asyncCallbackinfo = static_cast(data); if (asyncCallbackinfo == nullptr) { - ANS_LOGE("Invalid async live view callback data."); + ANS_LOGE("null asyncCallbackinfo"); return; } @@ -424,17 +424,17 @@ void AsyncGetLiveViewComplete(napi_env env, napi_status status, void *data) napi_value NapiGetActiveNotificationByFilter(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); auto asyncLiveViewCallBackInfo = new (std::nothrow) AsyncLiveViewCallBackInfo {.env = env, .asyncWork = nullptr}; if (asyncLiveViewCallBackInfo == nullptr) { - ANS_LOGE("asyncLiveViewCallBackInfo is nullptr."); + ANS_LOGE("null asyncLiveViewCallBackInfo"); Common::NapiThrow(env, ERROR_PARAM_INVALID); return Common::NapiGetUndefined(env); } napi_ref callback = nullptr; if (ParseGetLiveViewParams(env, info, asyncLiveViewCallBackInfo->filter, callback) == nullptr) { - ANS_LOGE("ParseGetLiveViewParams is nullptr."); + ANS_LOGE("null ParseGetLiveViewParams"); delete asyncLiveViewCallBackInfo; asyncLiveViewCallBackInfo = nullptr; Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -453,7 +453,7 @@ napi_value NapiGetActiveNotificationByFilter(napi_env env, napi_callback_info in napi_queue_async_work_with_qos(env, asyncLiveViewCallBackInfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("NapiGetActiveNotificationByFilter callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } diff --git a/frameworks/js/napi/src/manager/napi_local_live_view.cpp b/frameworks/js/napi/src/manager/napi_local_live_view.cpp index 4ba18a5e6b3b18b8787fe5d8e3e0bee69fa830af..e40f4a1cab742c839dec046f7da5551c2d09051e 100644 --- a/frameworks/js/napi/src/manager/napi_local_live_view.cpp +++ b/frameworks/js/napi/src/manager/napi_local_live_view.cpp @@ -24,7 +24,7 @@ const int32_t TRIGGER_PARA = 3; napi_value NapiSubscriteLocalAcitvity(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; LocalLiveViewSubscriberInstance *objectInfo = nullptr; if (ParseParameters(env, info, objectInfo, callback) == nullptr) { @@ -93,7 +93,7 @@ napi_value NapiSubscriteLocalAcitvity(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSubscribeLocalLiveView callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -108,7 +108,7 @@ napi_value NapiUnsubscriteLocalLiveView(napi_env env, napi_callback_info info) napi_value ParseTriggerParameters(const napi_env &env, const napi_callback_info &info, AsyncCallbackInfoSubscribeLocalLiveView *asynccallbackinfo, napi_ref &callback) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = TRIGGER_PARA; napi_value argv[TRIGGER_PARA] = {nullptr, nullptr}; @@ -128,7 +128,7 @@ napi_value ParseTriggerParameters(const napi_env &env, const napi_callback_info // argv[0]:BundleOption auto retValue = Common::GetBundleOption(env, argv[PARAM0], asynccallbackinfo->bundleOption); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed"); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -148,7 +148,7 @@ napi_value ParseTriggerParameters(const napi_env &env, const napi_callback_info // argv[2]:buttonOption retValue = Common::GetButtonOption(env, argv[PARAM2], asynccallbackinfo->buttonOption); if (retValue == nullptr) { - ANS_LOGE("GetButtonOption failed"); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -157,7 +157,7 @@ napi_value ParseTriggerParameters(const napi_env &env, const napi_callback_info napi_value NapiTriggerLocalLiveView(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; AsyncCallbackInfoSubscribeLocalLiveView *asynccallbackinfo = @@ -222,7 +222,7 @@ napi_value NapiTriggerLocalLiveView(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSubscribeLocalLiveView callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_open_settings.cpp b/frameworks/js/napi/src/manager/napi_open_settings.cpp index 84c3dab59fcc09779298c7116a3ddc25cea6eba2..dce85c0931577b4e178fab243ed913022c1fc538 100644 --- a/frameworks/js/napi/src/manager/napi_open_settings.cpp +++ b/frameworks/js/napi/src/manager/napi_open_settings.cpp @@ -28,9 +28,9 @@ static std::atomic isExist = false; void NapiAsyncCompleteCallbackOpenSettings(napi_env env, void *data) { - ANS_LOGD("enter NapiAsyncCompleteCallbackOpenSettings"); + ANS_LOGD("called"); if (data == nullptr) { - ANS_LOGE("Invalid async callback data."); + ANS_LOGE("null data"); return; } auto* asynccallbackinfo = static_cast(data); @@ -57,7 +57,7 @@ void NapiAsyncCompleteCallbackOpenSettings(napi_env env, void *data) napi_value NapiOpenNotificationSettings(napi_env env, napi_callback_info info) { - ANS_LOGD("NapiOpenNotificationSettings start"); + ANS_LOGD("start"); OpenSettingsParams params {}; if (ParseOpenSettingsParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -78,16 +78,16 @@ napi_value NapiOpenNotificationSettings(napi_env env, napi_callback_info info) auto createExtension = [](napi_env env, void* data) { }; auto jsCb = [](napi_env env, napi_status status, void* data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (data == nullptr) { - ANS_LOGE("data is invalid"); + ANS_LOGE("null data"); return; } auto* asynccallbackinfo = static_cast(data); CreateExtension(asynccallbackinfo); ErrCode errCode = asynccallbackinfo->info.errorCode; if (errCode != ERR_ANS_DIALOG_POP_SUCCEEDED) { - ANS_LOGE("error, code is %{public}d.", errCode); + ANS_LOGE("errCode: %{public}d.", errCode); NapiAsyncCompleteCallbackOpenSettings(env, static_cast(asynccallbackinfo)); if (errCode != ERROR_SETTING_WINDOW_EXIST) { isExist.store(false); @@ -113,13 +113,13 @@ napi_value NapiOpenNotificationSettings(napi_env env, napi_callback_info info) &asynccallbackinfo->asyncWork); napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); - ANS_LOGD("NapiOpenNotificationSettings end"); + ANS_LOGD("end"); return promise; } napi_value ParseOpenSettingsParameters(const napi_env &env, const napi_callback_info &info, OpenSettingsParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = OPEN_NOTIFICATION_SETTINGS_MAX_PARA; napi_value argv[OPEN_NOTIFICATION_SETTINGS_MAX_PARA] = {nullptr}; @@ -157,19 +157,19 @@ napi_value ParseOpenSettingsParameters(const napi_env &env, const napi_callback_ bool CreateSettingsUIExtension(std::shared_ptr context, std::string &bundleName) { if (context == nullptr) { - ANS_LOGE("Get context failed"); + ANS_LOGE("null context"); return false; } std::shared_ptr abilityContext = OHOS::AbilityRuntime::Context::ConvertTo(context); if (abilityContext == nullptr) { - ANS_LOGE("abilityContext is null"); + ANS_LOGE("null abilityContex"); return false; } auto uiContent = abilityContext->GetUIContent(); if (uiContent == nullptr) { - ANS_LOGE("uiContent is null"); + ANS_LOGE("null uiContent"); return false; } @@ -215,7 +215,7 @@ bool CreateSettingsUIExtension(std::shared_ptr co bool Init(napi_env env, AsyncCallbackInfoOpenSettings* callbackInfo, JsAnsCallbackComplete complete) { - ANS_LOGD("enter JsAnsCallback::Init"); + ANS_LOGD("called"); if (env == nullptr || callbackInfo == nullptr || complete == nullptr) { ANS_LOGE("invalid data"); return false; @@ -228,7 +228,7 @@ bool Init(napi_env env, AsyncCallbackInfoOpenSettings* callbackInfo, void ProcessStatusChanged(int32_t code) { - ANS_LOGD("enter"); + ANS_LOGD("called"); std::unique_ptr callbackInfo(callbackInfo_); if (env_ == nullptr || callbackInfo == nullptr || complete_ == nullptr) { ANS_LOGE("invalid data"); @@ -240,7 +240,7 @@ void ProcessStatusChanged(int32_t code) uv_loop_s* loop = nullptr; napi_get_uv_event_loop(env_, &loop); if (loop == nullptr) { - ANS_LOGE("loop is nullptr"); + ANS_LOGE("null loop"); return; } @@ -257,7 +257,7 @@ void ProcessStatusChanged(int32_t code) work->data = static_cast(workData.get()); auto jsCb = [](uv_work_t* work, int status) { - ANS_LOGD("enter ProcessStatusChanged jsCb"); + ANS_LOGD("called jsCb"); std::unique_ptr workSP(work); if (work == nullptr || work->data == nullptr) { ANS_LOGE("invalid data"); @@ -308,7 +308,7 @@ void CreateExtension(AsyncCallbackInfoOpenSettings* asynccallbackinfo) } else { ANS_LOGD("un stage mode"); } - ANS_LOGI("done, code is %{public}d.", asynccallbackinfo->info.errorCode); + ANS_LOGI("errorCode: %{public}d", asynccallbackinfo->info.errorCode); } SettingsModalExtensionCallback::SettingsModalExtensionCallback() @@ -323,7 +323,7 @@ SettingsModalExtensionCallback::~SettingsModalExtensionCallback() */ void SettingsModalExtensionCallback::OnResult(int32_t resultCode, const AAFwk::Want& result) { - ANS_LOGD("OnResult"); + ANS_LOGD("called"); } /* @@ -331,7 +331,7 @@ void SettingsModalExtensionCallback::OnResult(int32_t resultCode, const AAFwk::W */ void SettingsModalExtensionCallback::OnReceive(const AAFwk::WantParams& receive) { - ANS_LOGD("OnReceive"); + ANS_LOGD("called"); } /* @@ -349,7 +349,7 @@ void SettingsModalExtensionCallback::OnRelease(int32_t releaseCode) */ void SettingsModalExtensionCallback::OnError(int32_t code, const std::string& name, const std::string& message) { - ANS_LOGE("OnError, code = %{public}d,name = %{public}s, message = %{public}s", code, name.c_str(), message.c_str()); + ANS_LOGD("called, code = %{public}d,name = %{public}s, message = %{public}s", code, name.c_str(), message.c_str()); ReleaseOrErrorHandle(code); ProcessStatusChanged(code); } @@ -360,7 +360,7 @@ void SettingsModalExtensionCallback::OnError(int32_t code, const std::string& na */ void SettingsModalExtensionCallback::OnRemoteReady(const std::shared_ptr& uiProxy) { - ANS_LOGI("OnRemoteReady"); + ANS_LOGD("called"); ProcessStatusChanged(0); } @@ -369,7 +369,7 @@ void SettingsModalExtensionCallback::OnRemoteReady(const std::shared_ptrabilityContext_->GetUIContent(); if (uiContent == nullptr) { - ANS_LOGE("uiContent is null"); + ANS_LOGE("null uiContent"); return; } uiContent->CloseModalUIExtension(this->sessionId_); - ANS_LOGD("ReleaseOrErrorHandle end"); + ANS_LOGD("end"); return; } diff --git a/frameworks/js/napi/src/manager/napi_publish.cpp b/frameworks/js/napi/src/manager/napi_publish.cpp index 9f49651aa2a3508e12fe42ddcbf3ee32081c5e92..50284948983dfb66a262481ed8a59221157d8203 100644 --- a/frameworks/js/napi/src/manager/napi_publish.cpp +++ b/frameworks/js/napi/src/manager/napi_publish.cpp @@ -24,7 +24,7 @@ namespace NotificationNapi { napi_value NapiPublish(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); TraceChainUtil traceChain = TraceChainUtil(); ParametersInfoPublish params; if (ParseParameters(env, info, params) == nullptr) { @@ -35,7 +35,7 @@ napi_value NapiPublish(napi_env env, napi_callback_info info) napi_value promise = nullptr; auto asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoPublish {.env = env, .asyncWork = nullptr}; if (!asynccallbackinfo) { - ANS_LOGD("asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); Common::NapiThrow(env, ERROR_INTERNAL_ERROR); return Common::JSParaError(env, params.callback); } @@ -84,7 +84,7 @@ napi_value NapiPublish(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiPublish callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -93,7 +93,7 @@ napi_value NapiPublish(napi_env env, napi_callback_info info) napi_value NapiShowNotification(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoPublish params; if (ParseShowOptions(env, info, params) == nullptr) { ANS_LOGW("parse showOptions failed"); @@ -103,7 +103,7 @@ napi_value NapiShowNotification(napi_env env, napi_callback_info info) auto asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoPublish {.env = env, .asyncWork = nullptr}; if (!asynccallbackinfo) { - ANS_LOGW("failed to create asynccallbackinfo"); + ANS_LOGW("null asynccallbackinfo"); return Common::JSParaError(env, params.callback); } asynccallbackinfo->request = params.request; @@ -150,7 +150,7 @@ napi_value NapiShowNotification(napi_env env, napi_callback_info info) napi_value NapiPublishAsBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); TraceChainUtil traceChain = TraceChainUtil(); ParametersInfoPublish params; if (ParsePublishAsBundleParameters(env, info, params) == nullptr) { @@ -209,7 +209,7 @@ napi_value NapiPublishAsBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiPublishAsBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_push.cpp b/frameworks/js/napi/src/manager/napi_push.cpp index 73335dfcd8626db1f2d62aa83af17e307c870925..164b80e2a07ee956d9743dc2e5d081cf19025536 100644 --- a/frameworks/js/napi/src/manager/napi_push.cpp +++ b/frameworks/js/napi/src/manager/napi_push.cpp @@ -101,7 +101,7 @@ napi_value NapiPush::OnRegisterPushCallback(napi_env env, const napi_callback_in if (jsPushCallBack_ == nullptr) { jsPushCallBack_ = new (std::nothrow) OHOS::Notification::JSPushCallBack(env); if (jsPushCallBack_ == nullptr) { - ANS_LOGE("new JSPushCallBack failed"); + ANS_LOGE("null jsPushCallBack_"); ThrowError(env, ERROR_INTERNAL_ERROR); return undefined; } @@ -110,7 +110,7 @@ napi_value NapiPush::OnRegisterPushCallback(napi_env env, const napi_callback_in jsPushCallBack_->SetJsPushCallBackObject(outSlotType, argv[INDEX_TWO]); auto result = NotificationHelper::RegisterPushCallback(jsPushCallBack_->AsObject(), checkRequest); if (result != ERR_OK) { - ANS_LOGE("Register failed, result is %{public}d", result); + ANS_LOGE("result: %{public}d", result); ThrowError(env, OHOS::Notification::ErrorToExternal(result)); } return undefined; @@ -185,7 +185,7 @@ bool NapiPush::CheckCallerIsSystemApp() napi_value NapiPush::ParseCheckRequest(const napi_env &env, const napi_value &obj, sptr &checkRequest) { - ANS_LOGD("enter"); + ANS_LOGD("start"); if (!AppExecFwk::IsTypeForNapiValue(env, obj, napi_object)) { ANS_LOGE("Wrong argument type. Object expected."); diff --git a/frameworks/js/napi/src/manager/napi_push_callback.cpp b/frameworks/js/napi/src/manager/napi_push_callback.cpp index e93a6bbeb24ff1144cae9009755d87e343ac75d0..d21335a9018ba1f565736dc04b1437f88c96c5cb 100644 --- a/frameworks/js/napi/src/manager/napi_push_callback.cpp +++ b/frameworks/js/napi/src/manager/napi_push_callback.cpp @@ -45,13 +45,13 @@ void JSPushCallBack::SetJsPushCallBackObject(NotificationConstant::SlotType slot bool JSPushCallBack::IsEqualPushCallBackObject(napi_value pushCallBackObject) { if (pushCallBackObject_ == nullptr) { - ANS_LOGE("pushCallBackObject_ nullptr"); + ANS_LOGE("null pushCallBackObject"); return false; } napi_value value = nullptr; napi_get_reference_value(env_, pushCallBackObject_, &value); if (value == nullptr) { - ANS_LOGE("Failed to get value"); + ANS_LOGE("null value"); return false; } @@ -94,7 +94,7 @@ void CallBackReturn(const int32_t ret, const std::weak_ptr pu { auto callBackParam = pushCallBackParam.lock(); if (callBackParam == nullptr) { - ANS_LOGI("Push callback param has been released"); + ANS_LOGI("null callBackParam"); return; } @@ -106,9 +106,9 @@ void CallBackReturn(const int32_t ret, const std::weak_ptr pu napi_value JSPushCallBack::CheckPromiseCallback(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (info == nullptr) { - ANS_LOGE("CheckPromiseCallback, invalid input info"); + ANS_LOGE("null info"); return nullptr; } @@ -138,14 +138,14 @@ int32_t JSPushCallBack::OnCheckNotification( NotificationConstant::SlotType outSlotType = static_cast(checkInfo->GetSlotType()); if (pushCallBackObjects_.find(outSlotType) == pushCallBackObjects_.end()) { - ANS_LOGE("pushCallBackObjects is nullptr"); + ANS_LOGE("null pushCallBackObjects"); return ERR_INVALID_STATE; } napi_value checkFunc = nullptr; napi_get_reference_value(env_, pushCallBackObjects_[outSlotType], &checkFunc); if (checkFunc == nullptr) { - ANS_LOGE("Failed to get checkFunc value"); + ANS_LOGE("null checkFunc"); return ERR_INVALID_STATE; } napi_value jsResult = nullptr; @@ -231,7 +231,7 @@ void JSPushCallBack::HandleCheckPromise( int32_t JSPushCallBack::ConvertFunctionResult(napi_env env, napi_value funcResult) { if (funcResult == nullptr) { - ANS_LOGE("The funcResult is error."); + ANS_LOGE("null funcResult"); return false; } napi_valuetype valueType = napi_undefined; diff --git a/frameworks/js/napi/src/manager/napi_remove_group.cpp b/frameworks/js/napi/src/manager/napi_remove_group.cpp index 7bac7aa3607be25f2ee51bfd00b37c8803428fc2..488bf6a9d340e55ca6fe89e4edf9094e2ecf432a 100644 --- a/frameworks/js/napi/src/manager/napi_remove_group.cpp +++ b/frameworks/js/napi/src/manager/napi_remove_group.cpp @@ -27,7 +27,7 @@ namespace { napi_value ParseParameters( const napi_env &env, const napi_callback_info &info, RemoveParamsGroupByBundle ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = REMOVE_GROUP_BY_BUNDLE_MAX_PARA; napi_value argv[REMOVE_GROUP_BY_BUNDLE_MAX_PARA] = {nullptr}; @@ -50,7 +50,7 @@ napi_value ParseParameters( } auto retValue = Common::GetBundleOption(env, argv[PARAM0], params.option); if (retValue == nullptr) { - ANS_LOGE("GetBundleOption failed."); + ANS_LOGE("null retValue"); Common::NapiThrow(env, ERROR_PARAM_INVALID, PARAMETER_VERIFICATION_FAILED); return nullptr; } @@ -91,9 +91,9 @@ napi_value ParseParameters( void AsyncCompleteCallbackNapiRemoveGroupByBundle(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data"); + ANS_LOGE("null data"); return; } AsyncCallbackInfoRemoveGroupByBundle *asynccallbackinfo = static_cast(data); @@ -111,7 +111,7 @@ void AsyncCompleteCallbackNapiRemoveGroupByBundle(napi_env env, napi_status stat napi_value NapiRemoveGroupByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); RemoveParamsGroupByBundle params {}; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -154,7 +154,7 @@ napi_value NapiRemoveGroupByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiRemoveGroupByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_slot.cpp b/frameworks/js/napi/src/manager/napi_slot.cpp index c9e8306c71279b6b7273d5f003eb37c3ece7f8f9..3d127e237fb1fddbd7666bce7fce4c290ed1a403 100644 --- a/frameworks/js/napi/src/manager/napi_slot.cpp +++ b/frameworks/js/napi/src/manager/napi_slot.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace NotificationNapi { napi_value NapiAddSlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoAddSlot paras; if (ParseParametersByAddSlot(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -37,7 +37,7 @@ napi_value NapiAddSlot(napi_env env, napi_callback_info info) .isAddSlotByType = paras.isAddSlotByType }; if (!asynccallbackinfo) { - ANS_LOGD("Create asynccallbackinfo failed."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, paras.callback); } napi_value promise = nullptr; @@ -83,7 +83,7 @@ napi_value NapiAddSlot(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiAddSlot callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -92,7 +92,7 @@ napi_value NapiAddSlot(napi_env env, napi_callback_info info) napi_value NapiAddSlots(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoAddSlots paras; if (ParseParametersByAddSlots(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -102,7 +102,7 @@ napi_value NapiAddSlots(napi_env env, napi_callback_info info) AsyncCallbackInfoAddSlots *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoAddSlots {.env = env, .asyncWork = nullptr, .slots = paras.slots}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); Common::NapiThrow(env, ERROR_INTERNAL_ERROR); return Common::JSParaError(env, paras.callback); } @@ -144,7 +144,7 @@ napi_value NapiAddSlots(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiAddSlots callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -153,7 +153,7 @@ napi_value NapiAddSlots(napi_env env, napi_callback_info info) napi_value NapiSetSlotByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoSetSlotByBundle params {}; if (ParseParametersSetSlotByBundle(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -204,7 +204,7 @@ napi_value NapiSetSlotByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSetSlotByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -214,9 +214,9 @@ napi_value NapiSetSlotByBundle(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetSlot(napi_env env, napi_status status, void *data) { - ANS_LOGI("GetSlot napi_create_async_work end"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data"); + ANS_LOGE("null data"); return; } @@ -234,7 +234,7 @@ void AsyncCompleteCallbackNapiGetSlot(napi_env env, napi_status status, void *da } Common::CreateReturnValue(env, asynccallbackinfo->info, result); if (asynccallbackinfo->info.callback != nullptr) { - ANS_LOGD("Delete NapiGetSlot callback reference."); + ANS_LOGD("null callback"); napi_delete_reference(env, asynccallbackinfo->info.callback); } napi_delete_async_work(env, asynccallbackinfo->asyncWork); @@ -245,7 +245,7 @@ void AsyncCompleteCallbackNapiGetSlot(napi_env env, napi_status status, void *da napi_value NapiGetSlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoGetSlot paras; if (ParseParametersByGetSlot(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -282,7 +282,7 @@ napi_value NapiGetSlot(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSlot callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -291,7 +291,7 @@ napi_value NapiGetSlot(napi_env env, napi_callback_info info) napi_value NapiGetSlotNumByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoGetSlotNumByBundle params {}; if (ParseParametersGetSlotNumByBundle(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -345,7 +345,7 @@ napi_value NapiGetSlotNumByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSlotNumByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -354,9 +354,9 @@ napi_value NapiGetSlotNumByBundle(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetSlots(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data."); + ANS_LOGE("null data"); return; } napi_value result = nullptr; @@ -377,13 +377,13 @@ void AsyncCompleteCallbackNapiGetSlots(napi_env env, napi_status status, void *d napi_value nSlot = nullptr; napi_create_object(env, &nSlot); if (!Common::SetNotificationSlot(env, *vec, nSlot)) { - ANS_LOGD("SetNotificationSlot is nullptr."); + ANS_LOGD("null SetNotificationSlot"); continue; } napi_set_element(env, arr, count, nSlot); count++; } - ANS_LOGI("NapiGetSlots count : %{public}zu", count); + ANS_LOGI("count : %{public}zu", count); result = arr; if ((count == 0) && (asynccallbackinfo->slots.size() > 0)) { asynccallbackinfo->info.errorCode = ERROR; @@ -403,7 +403,7 @@ void AsyncCompleteCallbackNapiGetSlots(napi_env env, napi_status status, void *d napi_value NapiGetSlots(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -438,7 +438,7 @@ napi_value NapiGetSlots(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSlots callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -447,9 +447,9 @@ napi_value NapiGetSlots(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetSlotsByBundle(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data."); + ANS_LOGE("null data"); return; } napi_value result = nullptr; @@ -474,7 +474,7 @@ void AsyncCompleteCallbackNapiGetSlotsByBundle(napi_env env, napi_status status, napi_set_element(env, arr, count, nSlot); count++; } - ANS_LOGI("count = %{public}zu", count); + ANS_LOGD("count = %{public}zu", count); result = arr; if ((count == 0) && (asynccallbackinfo->slots.size() > 0)) { asynccallbackinfo->info.errorCode = ERROR; @@ -483,7 +483,7 @@ void AsyncCompleteCallbackNapiGetSlotsByBundle(napi_env env, napi_status status, } Common::CreateReturnValue(env, asynccallbackinfo->info, result); if (asynccallbackinfo->info.callback != nullptr) { - ANS_LOGD("Delete napiGetSlotsByBundle callback reference."); + ANS_LOGD("null callback"); napi_delete_reference(env, asynccallbackinfo->info.callback); } napi_delete_async_work(env, asynccallbackinfo->asyncWork); @@ -494,7 +494,7 @@ void AsyncCompleteCallbackNapiGetSlotsByBundle(napi_env env, napi_status status, napi_value NapiGetSlotsByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoGetSlotsByBundle params {}; if (ParseParametersGetSlotsByBundle(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -532,7 +532,7 @@ napi_value NapiGetSlotsByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSlotsByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -541,9 +541,9 @@ napi_value NapiGetSlotsByBundle(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetSlotByBundle(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data."); + ANS_LOGE("null data"); return; } napi_value result = nullptr; @@ -573,7 +573,7 @@ void AsyncCompleteCallbackNapiGetSlotByBundle(napi_env env, napi_status status, napi_value NapiGetSlotByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoGetSlotByBundle params {}; if (ParseParametersGetSlotByBundle(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -611,7 +611,7 @@ napi_value NapiGetSlotByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSlotByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -620,7 +620,7 @@ napi_value NapiGetSlotByBundle(napi_env env, napi_callback_info info) napi_value NapiRemoveSlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoRemoveSlot paras; if (ParseParametersByRemoveSlot(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -630,7 +630,7 @@ napi_value NapiRemoveSlot(napi_env env, napi_callback_info info) AsyncCallbackInfoRemoveSlot *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoRemoveSlot {.env = env, .asyncWork = nullptr, .outType = paras.outType}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, paras.callback); } napi_value promise = nullptr; @@ -672,7 +672,7 @@ napi_value NapiRemoveSlot(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiRemoveSlot callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -681,7 +681,7 @@ napi_value NapiRemoveSlot(napi_env env, napi_callback_info info) napi_value NapiRemoveAllSlots(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; if (Common::ParseParaOnlyCallback(env, info, callback) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -730,7 +730,7 @@ napi_value NapiRemoveAllSlots(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiRemoveAllSlots callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -739,7 +739,7 @@ napi_value NapiRemoveAllSlots(napi_env env, napi_callback_info info) napi_value NapiEnableNotificationSlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoEnableSlot params {}; if (ParseParametersEnableSlot(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -794,7 +794,7 @@ napi_value NapiEnableNotificationSlot(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiEnableNotificationSlot callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -803,7 +803,7 @@ napi_value NapiEnableNotificationSlot(napi_env env, napi_callback_info info) napi_value NapiIsEnableNotificationSlot(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoIsEnableSlot params {}; if (ParseParametersIsEnableSlot(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -857,7 +857,7 @@ napi_value NapiIsEnableNotificationSlot(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiIsEnableNotificationSlot callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -866,7 +866,7 @@ napi_value NapiIsEnableNotificationSlot(napi_env env, napi_callback_info info) napi_value NapiSetSlotFlagsByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoSetSlotFlagsByBundle params {}; if (ParseParametersSetSlotFlagsByBundle(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -918,7 +918,7 @@ napi_value NapiSetSlotFlagsByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSetSlotFlagsByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -927,7 +927,7 @@ napi_value NapiSetSlotFlagsByBundle(napi_env env, napi_callback_info info) napi_value NapiGetSlotFlagsByBundle(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ParametersInfoGetSlotFlagsByBundle params {}; if (ParseParametersGetSlotFlagsByBundle(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -981,7 +981,7 @@ napi_value NapiGetSlotFlagsByBundle(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiGetSlotFlagsByBundle callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -990,9 +990,9 @@ napi_value NapiGetSlotFlagsByBundle(napi_env env, napi_callback_info info) void AsyncCompleteCallbackNapiGetNotificationSettings(napi_env env, napi_status status, void *data) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data"); + ANS_LOGE("null data"); return; } auto asynccallbackinfo = static_cast(data); @@ -1022,7 +1022,7 @@ void AsyncCompleteCallbackNapiGetNotificationSettings(napi_env env, napi_status napi_value NapiGetNotificationSettings(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); AsyncCallbackInfoGetNotificationSettings *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoGetNotificationSettings {.env = env, .asyncWork = nullptr}; if (!asynccallbackinfo) { diff --git a/frameworks/js/napi/src/manager/napi_sync_config.cpp b/frameworks/js/napi/src/manager/napi_sync_config.cpp index 0959947da6c3848c596c325b9c98add544065d79..65f049804f28e32243b98abd7121aad71f95739d 100644 --- a/frameworks/js/napi/src/manager/napi_sync_config.cpp +++ b/frameworks/js/napi/src/manager/napi_sync_config.cpp @@ -44,7 +44,7 @@ struct AsyncCallbackInfoConfig { napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, ConfigParams ¶ms) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SETADDITION_CONFIG_NUM; napi_value argv[SETADDITION_CONFIG_NUM] = {nullptr}; @@ -97,25 +97,25 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, void AsyncSetConfigComplete(napi_env env, napi_status status, void *data) { - ANS_LOGI("NapiSetAdditionConfig work complete."); + ANS_LOGD("start"); AsyncCallbackInfoConfig *asynccallbackinfo = static_cast(data); if (asynccallbackinfo) { napi_value result = nullptr; napi_create_int32(env, asynccallbackinfo->info.errorCode, &result); Common::CreateReturnValue(env, asynccallbackinfo->info, result); if (asynccallbackinfo->info.callback != nullptr) { - ANS_LOGD("Delete NapiSetAdditionConfig callback reference."); + ANS_LOGD("null callback"); napi_delete_reference(env, asynccallbackinfo->info.callback); } napi_delete_async_work(env, asynccallbackinfo->asyncWork); delete asynccallbackinfo; asynccallbackinfo = nullptr; } - ANS_LOGD("NapiSetAdditionConfig work complete end."); + ANS_LOGD("end"); } napi_value NapiSetAdditionConfig(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); ConfigParams paras {}; if (ParseParameters(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -151,7 +151,7 @@ napi_value NapiSetAdditionConfig(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("NapiSetAdditionConfig callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/manager/napi_template.cpp b/frameworks/js/napi/src/manager/napi_template.cpp index 61281e9c624d643f388c812f6d5d8b1a0d95000e..d8d67d5ba560a3df822a2520a1c3fcc12bb03b7d 100644 --- a/frameworks/js/napi/src/manager/napi_template.cpp +++ b/frameworks/js/napi/src/manager/napi_template.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace NotificationNapi { napi_value NapiIsSupportTemplate(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); TemplateName params; if (ParseParameters(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -60,7 +60,7 @@ napi_value NapiIsSupportTemplate(napi_env env, napi_callback_info info) napi_get_boolean(env, asyncCallbackinfo->params.support, &result); Common::CreateReturnValue(env, asyncCallbackinfo->info, result); if (asyncCallbackinfo->info.callback != nullptr) { - ANS_LOGD("Delete napiIsSupportTemplate callback reference."); + ANS_LOGD("null callback"); napi_delete_reference(env, asyncCallbackinfo->info.callback); } napi_delete_async_work(env, asyncCallbackinfo->asyncWork); diff --git a/frameworks/js/napi/src/reminder/native_module.cpp b/frameworks/js/napi/src/reminder/native_module.cpp index b61a112ddfea6b72e06f4ec242b063e78777fd30..dcdf970d4b2e18dba539d284b5e47e16c7e27a54 100644 --- a/frameworks/js/napi/src/reminder/native_module.cpp +++ b/frameworks/js/napi/src/reminder/native_module.cpp @@ -25,7 +25,7 @@ namespace ReminderAgentNapi { EXTERN_C_START napi_value ReminderAgentInit(napi_env env, napi_value exports) { - ANSR_LOGI("ReminderAgentInit start"); + ANSR_LOGD("called"); napi_property_descriptor desc[] = { DECLARE_NAPI_FUNCTION("cancelReminder", CancelReminder), DECLARE_NAPI_FUNCTION("cancelAllReminders", CancelAllReminders), @@ -41,7 +41,7 @@ napi_value ReminderAgentInit(napi_env env, napi_value exports) napi_value ConstantInit(napi_env env, napi_value exports) { - ANSR_LOGI("ConstantInit start"); + ANSR_LOGD("called"); napi_value objReminderType = nullptr; napi_create_object(env, &objReminderType); diff --git a/frameworks/js/napi/src/reminder/native_module_manager.cpp b/frameworks/js/napi/src/reminder/native_module_manager.cpp index 74c93fae9ba866d96a9f9009cd6860c339e5460a..9fed74fbd4beb9e416313de830277a44c567ca29 100644 --- a/frameworks/js/napi/src/reminder/native_module_manager.cpp +++ b/frameworks/js/napi/src/reminder/native_module_manager.cpp @@ -25,7 +25,7 @@ namespace ReminderAgentNapi { EXTERN_C_START napi_value ReminderAgentManagerInit(napi_env env, napi_value exports) { - ANSR_LOGI("ReminderAgentManagerInit start"); + ANSR_LOGD("called"); napi_property_descriptor desc[] = { DECLARE_NAPI_FUNCTION("cancelReminder", CancelReminderMgr), DECLARE_NAPI_FUNCTION("cancelAllReminders", CancelAllRemindersMgr), @@ -45,7 +45,7 @@ napi_value ReminderAgentManagerInit(napi_env env, napi_value exports) napi_value ConstantInit(napi_env env, napi_value exports) { - ANSR_LOGI("ConstantInit start"); + ANSR_LOGD("called"); napi_value objReminderType = nullptr; napi_create_object(env, &objReminderType); diff --git a/frameworks/js/napi/src/reminder/publish.cpp b/frameworks/js/napi/src/reminder/publish.cpp index d87ac483ef0248e9087c43421fd00a3c32e1d871..156a82b7c78a81bc4063e99f01315560ac4cafd0 100644 --- a/frameworks/js/napi/src/reminder/publish.cpp +++ b/frameworks/js/napi/src/reminder/publish.cpp @@ -108,7 +108,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, // argv[1]: callback if (argc >= PUBLISH_PARAM_LEN) { if (GetCallback(env, argv[1], asyncCallbackInfo) == nullptr) { - ANSR_LOGE("[reminderAgent]GetCallbak returns nullptr"); + ANSR_LOGE("null GetCallback"); if (isThrow) { ReminderCommon::HandleErrCode(env, ERR_REMINDER_INVALID_PARAM); } @@ -118,7 +118,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, // argv[0] : reminderRequest if (ReminderCommon::GetReminderRequest(env, argv[0], params.reminder) == nullptr) { - ANSR_LOGE("[reminderAgent]CreateReminder returns nullptr"); + ANSR_LOGE("null GetReminderRequest"); if (isThrow) { ReminderCommon::HandleErrCode(env, ERR_REMINDER_INVALID_PARAM); } @@ -145,7 +145,7 @@ napi_value ParseSlotParameters(const napi_env &env, const napi_callback_info &in // argv[1]: callback if (argc >= ADD_SLOT_PARAM_LEN) { if (GetCallback(env, argv[1], asyncCallbackInfo) == nullptr) { - ANSR_LOGE("GetCallbak returns nullptr"); + ANSR_LOGE("null GetCallback"); if (isThrow) { ReminderCommon::HandleErrCode(env, ERR_REMINDER_INVALID_PARAM); } @@ -181,7 +181,7 @@ napi_value ParseSlotParameters(const napi_env &env, const napi_callback_info &in napi_value ParseCanCelParameter(const napi_env &env, const napi_callback_info &info, Parameters ¶ms, AsyncCallbackInfo &asyncCallbackInfo, bool isThrow) { - ANSR_LOGI("ParseCanCelParameter"); + ANSR_LOGD("called"); size_t argc = CANCEL_PARAM_LEN; napi_value argv[CANCEL_PARAM_LEN] = {nullptr}; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr)); @@ -196,7 +196,7 @@ napi_value ParseCanCelParameter(const napi_env &env, const napi_callback_info &i // argv[1]: callback if (argc >= CANCEL_PARAM_LEN) { if (GetCallback(env, argv[1], asyncCallbackInfo) == nullptr) { - ANSR_LOGE("GetCallbak is nullptr"); + ANSR_LOGE("null GetCallback"); if (isThrow) { ReminderCommon::HandleErrCode(env, ERR_REMINDER_INVALID_PARAM); } @@ -227,7 +227,7 @@ napi_value ParseCanCelParameter(const napi_env &env, const napi_callback_info &i napi_value ParseCanCelAllParameter(const napi_env &env, const napi_callback_info &info, Parameters ¶ms, AsyncCallbackInfo &asyncCallbackInfo, bool isThrow) { - ANSR_LOGI("ParseCanCelAllParameter"); + ANSR_LOGD("called"); size_t argc = CANCEL_ALL_PARAM_LEN; napi_value argv[CANCEL_ALL_PARAM_LEN] = {nullptr}; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr)); @@ -235,7 +235,7 @@ napi_value ParseCanCelAllParameter(const napi_env &env, const napi_callback_info // argv[0]: callback if (argc >= CANCEL_ALL_PARAM_LEN) { if (GetCallback(env, argv[0], asyncCallbackInfo) == nullptr) { - ANSR_LOGE("getCallbak is nullptr"); + ANSR_LOGE("null GetCallback"); if (isThrow) { ReminderCommon::HandleErrCode(env, ERR_REMINDER_INVALID_PARAM); } @@ -255,7 +255,7 @@ napi_value ParseGetValidParameter(const napi_env &env, const napi_callback_info // argv[0]: callback if (argc >= GET_VALID_PARAM_LEN) { if (GetCallback(env, argv[0], asyncCallbackInfo) == nullptr) { - ANSR_LOGE("getCallbak is nullptr"); + ANSR_LOGE("null GetCallback"); if (isThrow) { ReminderCommon::HandleErrCode(env, ERR_REMINDER_INVALID_PARAM); } @@ -279,7 +279,7 @@ napi_value DealErrorReturn(const napi_env &env, const napi_ref &callbackIn, cons napi_value CancelReminderInner(napi_env env, napi_callback_info info, bool isThrow) { - ANSR_LOGI("Cancel reminder"); + ANSR_LOGD("called"); AsyncCallbackInfo *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfo(env); if (!asynccallbackinfo) { @@ -348,7 +348,7 @@ napi_value CancelReminder(napi_env env, napi_callback_info info) napi_value CancelAllRemindersInner(napi_env env, napi_callback_info info, bool isThrow) { - ANSR_LOGI("Cancel all reminder"); + ANSR_LOGD("called"); AsyncCallbackInfo *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfo(env); if (!asynccallbackinfo) { @@ -716,7 +716,7 @@ void ParseMaxScreenWantAgent(const napi_env &env, const ReminderRequest &reminde napi_value SetValidReminder(const napi_env &env, ReminderRequest &reminder, napi_value &result) { - ANSR_LOGI("enter"); + ANSR_LOGD("called"); napi_value value = nullptr; napi_create_string_utf8(env, reminder.Dump().c_str(), NAPI_AUTO_LENGTH, &value); @@ -817,7 +817,7 @@ void GetValidRemindersInner(napi_env env, const std::vector& dates, napi_ napi_set_element(env, arr, count, result); count++; } - ANSR_LOGI("GetExcludeDates count = %{public}d", count); + ANSR_LOGI("count = %{public}d", count); } napi_value GetExcludeDates(napi_env env, napi_callback_info info) @@ -1415,7 +1415,7 @@ napi_value GetExcludeDates(napi_env env, napi_callback_info info) napi_value ParseUpdateReminderParameter(const napi_env &env, const napi_callback_info &info, Parameters ¶ms) { - ANSR_LOGD("ParseUpdateReminderParameter"); + ANSR_LOGD("called"); size_t argc = UPDATE_REMINDER_PARAM_LEN; napi_value argv[UPDATE_REMINDER_PARAM_LEN] = {nullptr}; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr)); @@ -1448,7 +1448,7 @@ napi_value ParseUpdateReminderParameter(const napi_env &env, const napi_callback napi_value UpdateReminder(napi_env env, napi_callback_info info) { - ANSR_LOGD("Call UpdateReminder"); + ANSR_LOGD("called"); AsyncCallbackInfo *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfo(env); if (!asynccallbackinfo) { ANSR_LOGE("Low memory."); diff --git a/frameworks/js/napi/src/reminder/reminder_common.cpp b/frameworks/js/napi/src/reminder/reminder_common.cpp index ca63e1de3f224569cf6c9bc69b190e07bb712ce7..47ba11ee6b8e765c5b50ef9c682a7ddeb38fc1a1 100644 --- a/frameworks/js/napi/src/reminder/reminder_common.cpp +++ b/frameworks/js/napi/src/reminder/reminder_common.cpp @@ -1078,7 +1078,7 @@ std::string ReminderCommon::FindErrMsg(const napi_env &env, const int32_t errCod void ReminderCommon::ReturnCallbackPromise(const napi_env &env, const CallbackPromiseInfo &info, const napi_value &result, bool isThrow) { - ANSR_LOGI("enter errorCode=%{public}d", info.errorCode); + ANSR_LOGD("start, errorCode=%{public}d", info.errorCode); if (info.isCallback) { if (isThrow) { SetCallback(env, info.callback, info.errorCode, result); @@ -1088,7 +1088,7 @@ void ReminderCommon::ReturnCallbackPromise(const napi_env &env, const CallbackPr } else { SetPromise(env, info, result); } - ANSR_LOGI("end"); + ANSR_LOGD("end"); } void ReminderCommon::SetCallback( diff --git a/frameworks/js/napi/src/subscribe.cpp b/frameworks/js/napi/src/subscribe.cpp index 0c822a57b501848e86befb3036c40219377d880f..1c26c65d6a27ea47f42c05fa9ca036c390968add 100644 --- a/frameworks/js/napi/src/subscribe.cpp +++ b/frameworks/js/napi/src/subscribe.cpp @@ -73,14 +73,14 @@ napi_value SetSubscribeCallbackData(const napi_env &env, const std::shared_ptr &request, const std::shared_ptr &sortingMap, int32_t deleteReason, napi_value &result) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (request == nullptr) { - ANS_LOGE("request is null"); + ANS_LOGE("null request"); return Common::NapiGetBoolean(env, false); } if (sortingMap == nullptr) { - ANS_LOGD("sortingMap is null"); + ANS_LOGD("null sortingMap"); return Common::NapiGetBoolean(env, false); } @@ -178,25 +178,25 @@ SubscriberInstance::~SubscriberInstance() void ThreadSafeOnCancel(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("OnCanceled thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Create dataWorkerData failed."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -218,20 +218,20 @@ void ThreadSafeOnCancel(napi_env env, napi_value jsCallback, void* context, void void SubscriberInstance::OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int32_t deleteReason) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (canceCallbackInfo_.ref == nullptr || canceCallbackInfo_.env == nullptr) { - ANS_LOGI("cancel callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (request == nullptr) { - ANS_LOGE("request is null"); + ANS_LOGE("null request"); return; } if (sortingMap == nullptr) { - ANS_LOGE("sortingMap is null"); + ANS_LOGE("null sortingMap"); return; } ANS_LOGI("OnCanceled NotificationKey = %{public}s. sortingMap size = %{public}zu. deleteReason = %{public}d", @@ -239,7 +239,7 @@ void SubscriberInstance::OnCanceled(const std::shared_ptrGetInstanceKey().c_str()); NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("DataWorker is nullptr."); + ANS_LOGE("null dataWorker"); return; } @@ -256,25 +256,25 @@ void SubscriberInstance::OnCanceled(const std::shared_ptr(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Create dataWorkerData failed."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value resultArray = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_array(env, &resultArray); @@ -305,15 +305,15 @@ void SubscriberInstance::OnBatchCanceled(const std::vector &sortingMap, int32_t deleteReason) { if (batchCancelCallbackInfo_.ref == nullptr || batchCancelCallbackInfo_.env == nullptr) { - ANS_LOGI("batchCancelCallbackInfo_ callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (requestList.empty()) { - ANS_LOGE("requestList is empty"); + ANS_LOGE("empty requestList"); return; } if (sortingMap == nullptr) { - ANS_LOGE("sortingMap is null"); + ANS_LOGE("null sortingMap"); return; } ANS_LOGI("OnBatchCancel deleteReason = %{public}d, sortingMap size = %{public}zu", @@ -326,7 +326,7 @@ void SubscriberInstance::OnBatchCanceled(const std::vectorrequestList = requestList; @@ -344,7 +344,7 @@ void SubscriberInstance::OnBatchCanceled(const std::vectorsubscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -402,25 +402,25 @@ void ThreadSafeOnConsumed(napi_env env, napi_value jsCallback, void* context, vo void SubscriberInstance::OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (consumeCallbackInfo_.ref == nullptr || consumeCallbackInfo_.env == nullptr) { - ANS_LOGI("consume callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (tsfn_ == nullptr) { - ANS_LOGI("consume tsfn is null"); + ANS_LOGE("null tsfn"); return; } if (request == nullptr) { - ANS_LOGE("request is nullptr."); + ANS_LOGE("null request"); return; } if (sortingMap == nullptr) { - ANS_LOGE("sortingMap is nullptr."); + ANS_LOGE("null sortingMap"); return; } auto notificationFlags = request->GetNotificationRequest().GetFlags(); @@ -432,7 +432,7 @@ void SubscriberInstance::OnConsumed(const std::shared_ptr(data); if (dataWorkerData == nullptr) { - ANS_LOGE("dataWorkerData is nullptr"); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -483,22 +483,22 @@ void ThreadSafeOnUpdate(napi_env env, napi_value jsCallback, void* context, void void SubscriberInstance::OnUpdate(const std::shared_ptr &sortingMap) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (updateCallbackInfo_.ref == nullptr || updateCallbackInfo_.env == nullptr) { - ANS_LOGI("update callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (sortingMap == nullptr) { - ANS_LOGE("sortingMap is null"); + ANS_LOGE("null sortingMap"); return; } ANS_LOGI("OnUpdate sortingMap size = %{public}zu", sortingMap->GetKey().size()); NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -513,17 +513,17 @@ void SubscriberInstance::OnUpdate(const std::shared_ptr void ThreadSafeOnConnected(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGD("OnConnected thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("dataWorkerData is nullptr."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } @@ -535,21 +535,21 @@ void ThreadSafeOnConnected(napi_env env, napi_value jsCallback, void* context, v void SubscriberInstance::OnConnected() { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (subscribeCallbackInfo_.ref == nullptr || subscribeCallbackInfo_.env == nullptr) { - ANS_LOGI("subscribe callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (tsfn_ == nullptr) { - ANS_LOGI("subscribe tsfn is null"); + ANS_LOGI("null tsfn"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -563,18 +563,18 @@ void SubscriberInstance::OnConnected() void ThreadSafeOnDisconnected(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("OnDisconnected thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Failed to create dataWorkerData."); + ANS_LOGE("null dataWorkerData."); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } if (subscriber->GetCallbackInfo(DIS_CONNECTED).ref == nullptr) { @@ -591,16 +591,16 @@ void ThreadSafeOnDisconnected(napi_env env, napi_value jsCallback, void* context void SubscriberInstance::OnDisconnected() { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (tsfn_ == nullptr) { - ANS_LOGI("unsubscribe tsfn is null"); + ANS_LOGI("null tsfn"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -614,18 +614,18 @@ void SubscriberInstance::OnDisconnected() void ThreadSafeOnDestroy(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("OnDied thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("dataWorkerData is null"); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } Common::SetCallback( @@ -637,16 +637,16 @@ void ThreadSafeOnDestroy(napi_env env, napi_value jsCallback, void* context, voi void SubscriberInstance::OnDied() { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (dieCallbackInfo_.ref == nullptr) { - ANS_LOGE("die callback unset"); + ANS_LOGE("null ref"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -660,25 +660,25 @@ void SubscriberInstance::OnDied() void ThreadSafeOnDoNotDisturbDateChange(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("OnDoNotDisturbDateChange thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Data worker data is null."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -696,23 +696,23 @@ void ThreadSafeOnDoNotDisturbDateChange(napi_env env, napi_value jsCallback, voi void SubscriberInstance::OnDoNotDisturbDateChange(const std::shared_ptr &date) { - ANS_LOGD("enter"); + ANS_LOGD("called"); onDoNotDisturbChanged(date); if (disturbDateCallbackInfo_.ref == nullptr || disturbDateCallbackInfo_.env == nullptr) { - ANS_LOGI("disturbDateCallbackInfo_ callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (date == nullptr) { - ANS_LOGE("date is null"); + ANS_LOGE("null date"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -728,18 +728,18 @@ void SubscriberInstance::OnDoNotDisturbDateChange(const std::shared_ptr(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Data worker data is null."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; @@ -760,21 +760,21 @@ void ThreadSafeOnDoNotDisturbChanged(napi_env env, napi_value jsCallback, void* void SubscriberInstance::onDoNotDisturbChanged(const std::shared_ptr& date) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (disturbChangedCallbackInfo_.ref == nullptr || disturbChangedCallbackInfo_.env == nullptr) { - ANS_LOGE("disturbChangedCallbackInfo_ callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (date == nullptr) { - ANS_LOGE("date is null"); + ANS_LOGE("null date"); return; } NotificationReceiveDataWorker* dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -789,25 +789,25 @@ void SubscriberInstance::onDoNotDisturbChanged(const std::shared_ptr(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Data worker data is null."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -826,21 +826,21 @@ void ThreadSafeOnEnabledNotificationChanged(napi_env env, napi_value jsCallback, void SubscriberInstance::OnEnabledNotificationChanged( const std::shared_ptr &callbackData) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (enabledNotificationCallbackInfo_.ref == nullptr || enabledNotificationCallbackInfo_.env == nullptr) { - ANS_LOGI("enabledNotificationCallbackInfo_ callback or env unset"); + ANS_LOGE("null ref or env"); return; } if (callbackData == nullptr) { - ANS_LOGE("callbackData is null"); + ANS_LOGE("null callbackData"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } @@ -855,25 +855,25 @@ void SubscriberInstance::OnEnabledNotificationChanged( void ThreadSafeOnBadgeChanged(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("OnBadgeChanged thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("dataWorkerData is null"); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -892,20 +892,20 @@ void ThreadSafeOnBadgeChanged(napi_env env, napi_value jsCallback, void* context void SubscriberInstance::OnBadgeChanged( const std::shared_ptr &badgeData) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (setBadgeCallbackInfo_.ref == nullptr || setBadgeCallbackInfo_.env == nullptr) { return; } if (badgeData == nullptr) { - ANS_LOGE("badgeData is null"); + ANS_LOGE("null badgeData"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("new dataWorker failed"); + ANS_LOGE("null dataWorker"); return; } ANS_LOGD("SubscriberInstance::OnBadgeChanged instanceKey:%{public}s", badgeData->GetAppInstanceKey().c_str()); @@ -920,25 +920,25 @@ void SubscriberInstance::OnBadgeChanged( void ThreadSafeOnBadgeEnabledChanged(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("OnBadgeEnabledChanged thread safe start."); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); if (dataWorkerData == nullptr) { - ANS_LOGE("Data worker is null."); + ANS_LOGE("null dataWorkerData"); return; } auto subscriber = dataWorkerData->subscriber.lock(); if (subscriber == nullptr) { delete dataWorkerData; dataWorkerData = nullptr; - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return; } napi_value result = nullptr; napi_handle_scope scope; napi_open_handle_scope(env, &scope); if (scope == nullptr) { - ANS_LOGE("Scope is null"); + ANS_LOGE("null scope"); return; } napi_create_object(env, &result); @@ -957,17 +957,17 @@ void SubscriberInstance::OnBadgeEnabledChanged( const sptr &callbackData) { if (setBadgeEnabledCallbackInfo_.ref == nullptr) { - ANS_LOGE("Set badge enabled callback info is null."); + ANS_LOGE("null setBadgeEnabledCallbackInfo_.ref"); return; } if (callbackData == nullptr) { - ANS_LOGE("Callback data is null."); + ANS_LOGE("null callbackData"); return; } NotificationReceiveDataWorker *dataWorker = new (std::nothrow) NotificationReceiveDataWorker(); if (dataWorker == nullptr) { - ANS_LOGE("Create new data worker failed."); + ANS_LOGE("null dataWorker"); return; } @@ -1213,12 +1213,12 @@ bool HasNotificationSubscriber(const napi_env &env, const napi_value &value, Sub void ThreadFinished(napi_env env, void* data, [[maybe_unused]] void* context) { - ANS_LOGD("ThreadFinished"); + ANS_LOGD("called"); } void ThreadSafeCommon(napi_env env, napi_value jsCallback, void* context, void* data) { - ANS_LOGI("common thread safe start"); + ANS_LOGD("called"); auto dataWorkerData = reinterpret_cast(data); switch (dataWorkerData->type) { case Type::CANCEL: @@ -1265,14 +1265,14 @@ void ThreadSafeCommon(napi_env env, napi_value jsCallback, void* context, void* napi_value GetNotificationSubscriber( const napi_env &env, const napi_value &value, SubscriberInstancesInfo &subscriberInfo) { - ANS_LOGD("enter"); + ANS_LOGD("called"); bool hasProperty = false; napi_valuetype valuetype = napi_undefined; napi_ref result = nullptr; subscriberInfo.subscriber = std::make_shared(); if (subscriberInfo.subscriber == nullptr) { - ANS_LOGE("subscriber is null"); + ANS_LOGE("null subscriber"); std::string msg = "Mandatory parameters are left unspecified. subscriber is null"; Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; @@ -1494,13 +1494,13 @@ napi_value GetNotificationSubscriber( bool AddSubscriberInstancesInfo(const napi_env &env, const SubscriberInstancesInfo &subscriberInfo) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (subscriberInfo.ref == nullptr) { - ANS_LOGE("subscriberInfo.ref is null"); + ANS_LOGE("null ref"); return false; } if (subscriberInfo.subscriber == nullptr) { - ANS_LOGE("subscriberInfo.subscriber is null"); + ANS_LOGE("null subscriber"); return false; } std::lock_guard lock(mutex_); @@ -1511,9 +1511,9 @@ bool AddSubscriberInstancesInfo(const napi_env &env, const SubscriberInstancesIn bool DelSubscriberInstancesInfo(const napi_env &env, const std::shared_ptr subscriber) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (subscriber == nullptr) { - ANS_LOGE("subscriber is null"); + ANS_LOGE("null subscriber"); return false; } @@ -1530,7 +1530,7 @@ bool DelSubscriberInstancesInfo(const napi_env &env, const std::shared_ptr &subscriber, napi_ref &callback) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = SUBSRIBE_MAX_PARA; napi_value argv[SUBSRIBE_MAX_PARA] = {nullptr}; @@ -1599,13 +1599,13 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value Subscribe(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; std::shared_ptr objectInfo = nullptr; NotificationSubscribeInfo subscriberInfo; if (ParseParameters(env, info, subscriberInfo, objectInfo, callback) == nullptr) { - ANS_LOGD("ParseParameters is nullptr."); + ANS_LOGD("null ParseParameters"); return Common::NapiGetUndefined(env); } @@ -1613,7 +1613,7 @@ napi_value Subscribe(napi_env env, napi_callback_info info) .env = env, .asyncWork = nullptr, .objectInfo = objectInfo, .subscriberInfo = subscriberInfo }; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, callback); } napi_value promise = nullptr; @@ -1639,7 +1639,7 @@ napi_value Subscribe(napi_env env, napi_callback_info info) sptr subscribeInfo = new (std::nothrow) OHOS::Notification::NotificationSubscribeInfo(); if (subscribeInfo == nullptr) { - ANS_LOGE("Invalid subscribeInfo!"); + ANS_LOGE("null subscribeInfo"); asynccallbackinfo->info.errorCode = OHOS::Notification::ErrorCode::ERR_ANS_NO_MEMORY; return; } @@ -1657,7 +1657,7 @@ napi_value Subscribe(napi_env env, napi_callback_info info) [](napi_env env, napi_status status, void *data) { ANS_LOGD("Subscribe work complete."); if (!data) { - ANS_LOGE("Invalid asynccallbackinfo!"); + ANS_LOGE("null data"); return; } auto asynccallbackinfo = reinterpret_cast(data); @@ -1679,7 +1679,7 @@ napi_value Subscribe(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("subscribe callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -1757,7 +1757,7 @@ napi_value GetParamOperationInfo(const napi_env &env, const napi_value &content, napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, std::string &hashCode, napi_value& thisVar, OperationInfo& operationInfo) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = DISTRIBUTE_REPLY_PARA; napi_value argv[DISTRIBUTE_REPLY_PARA] = {nullptr}; diff --git a/frameworks/js/napi/src/subscribe/init_module.cpp b/frameworks/js/napi/src/subscribe/init_module.cpp index 20ac78e9f515aefdd3316bbc4f49ec3cf135ce16..2182055470d2d83eed9762bc15758ef14cf63b51 100644 --- a/frameworks/js/napi/src/subscribe/init_module.cpp +++ b/frameworks/js/napi/src/subscribe/init_module.cpp @@ -27,7 +27,7 @@ EXTERN_C_START napi_value NotificationSubscribeInit(napi_env env, napi_value exports) { - ANS_LOGI("NotificationSubscribeInit start"); + ANS_LOGD("called"); napi_property_descriptor desc[] = { DECLARE_NAPI_FUNCTION("subscribe", NapiSubscribe), diff --git a/frameworks/js/napi/src/subscribe/napi_remove.cpp b/frameworks/js/napi/src/subscribe/napi_remove.cpp index 6d9f444bff1d1b5131b3f801dbfeeba4165922aa..a27e43b5ec7b7a753a8db962be1ebf2696b1a2f6 100644 --- a/frameworks/js/napi/src/subscribe/napi_remove.cpp +++ b/frameworks/js/napi/src/subscribe/napi_remove.cpp @@ -23,7 +23,7 @@ namespace NotificationNapi { void NapiRemoveExecuteCallback(napi_env env, void *data) { if (!data) { - ANS_LOGE("Invalid async callback data"); + ANS_LOGE("null data"); return; } auto removeInfo = static_cast(data); @@ -45,7 +45,7 @@ void NapiRemoveExecuteCallback(napi_env env, void *data) void NapiRemoveCompleteCallback(napi_env env, napi_status status, void *data) { if (!data) { - ANS_LOGE("Invalid async callback data"); + ANS_LOGE("null data"); return; } auto removeInfo = static_cast(data); @@ -62,7 +62,7 @@ void NapiRemoveCompleteCallback(napi_env env, napi_status status, void *data) napi_value NapiRemove(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); RemoveParams params {}; if (!ParseParameters(env, info, params)) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -92,7 +92,7 @@ napi_value NapiRemove(napi_env env, napi_callback_info info) napi_value NapiRemoveAll(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); RemoveParams params {}; if (ParseParametersByRemoveAll(env, info, params) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -151,7 +151,7 @@ napi_value NapiRemoveAll(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiRemoveAll callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/subscribe/napi_subscribe.cpp b/frameworks/js/napi/src/subscribe/napi_subscribe.cpp index 15eaa90091a95f90970ca0f9f0b976e5d3c8fdca..d546c4e010c4ad5ca7d7527bcf0ca4621f917c3a 100644 --- a/frameworks/js/napi/src/subscribe/napi_subscribe.cpp +++ b/frameworks/js/napi/src/subscribe/napi_subscribe.cpp @@ -27,21 +27,21 @@ namespace OHOS { namespace NotificationNapi { void NapiDistributeOperationExecuteCallback(napi_env env, void *data) { - ANS_LOGI("DistributeOperation napi_create_async_work start"); + ANS_LOGD("called"); auto asyncCallbackInfo = static_cast(data); if (asyncCallbackInfo == nullptr) { - ANS_LOGE("asyncCallbackInfo is nullptr"); + ANS_LOGE("null asyncCallbackInfo"); return; } sptr callback = new (std::nothrow) DistributedOperationCallback(*asyncCallbackInfo); if (callback == nullptr) { - ANS_LOGE("NAPI_Lock create callback object fail"); + ANS_LOGE("null callback"); return; } sptr operationInfo = new (std::nothrow) NotificationOperationInfo(); if (operationInfo == nullptr) { - ANS_LOGE("create operationInfo failed"); + ANS_LOGE("null operationInfo"); return; } operationInfo->SetHashCode(asyncCallbackInfo->hashCode); @@ -60,9 +60,9 @@ void NapiDistributeOperationExecuteCallback(napi_env env, void *data) void NapiDistributeOperationCompleteCallback(napi_env env, napi_status status, void *data) { - ANS_LOGI("DistributeOperation napi_create_async_work end"); + ANS_LOGD("called"); if (!data) { - ANS_LOGE("Invalid async callback data"); + ANS_LOGE("null data"); return; } auto distributeOperationInfo = static_cast(data); @@ -75,7 +75,7 @@ void NapiDistributeOperationCompleteCallback(napi_env env, napi_status status, v napi_value NapiSubscribe(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; std::shared_ptr objectInfo = nullptr; NotificationSubscribeInfo subscriberInfo; @@ -156,7 +156,7 @@ napi_value NapiSubscribe(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiSubscribe callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -165,7 +165,7 @@ napi_value NapiSubscribe(napi_env env, napi_callback_info info) napi_value NapiSubscribeSelf(napi_env env, napi_callback_info info) { - ANS_LOGD("enter"); + ANS_LOGD("called"); napi_ref callback = nullptr; std::shared_ptr objectInfo = nullptr; NotificationSubscribeInfo subscriberInfo; @@ -228,7 +228,7 @@ napi_value NapiSubscribeSelf(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("NapiSubscribeSelf callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -237,7 +237,7 @@ napi_value NapiSubscribeSelf(napi_env env, napi_callback_info info) napi_value NapiUnsubscribe(napi_env env, napi_callback_info info) { - ANS_LOGI("Unsubscribe start"); + ANS_LOGD("called"); ParametersInfoUnsubscribe paras; if (ParseParameters(env, info, paras) == nullptr) { Common::NapiThrow(env, ERROR_PARAM_INVALID); @@ -304,7 +304,7 @@ napi_value NapiUnsubscribe(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (isCallback) { - ANS_LOGD("napiUnsubscribe callback is nullptr."); + ANS_LOGD("null isCallback"); return Common::NapiGetNull(env); } else { return promise; @@ -328,7 +328,7 @@ void AsyncDistributeOperationCall(napi_env env, AsyncOperationCallbackInfo* dist napi_value NapiDistributeOperation(napi_env env, napi_callback_info info) { - ANS_LOGI("Distribute operation called"); + ANS_LOGD("called"); std::string hashCode; napi_value thisVar = nullptr; OperationInfo operationInfo; diff --git a/frameworks/js/napi/src/unsubscribe.cpp b/frameworks/js/napi/src/unsubscribe.cpp index 3d1d18fefedbfcfb727a7350a7f99f8a0cdef3d1..8da689c90c4de1255e49aca2f436fd5aeb692c08 100644 --- a/frameworks/js/napi/src/unsubscribe.cpp +++ b/frameworks/js/napi/src/unsubscribe.cpp @@ -23,7 +23,7 @@ const int UNSUBSCRIBE_MAX_PARA = 2; napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, ParametersInfoUnsubscribe ¶s) { - ANS_LOGD("enter"); + ANS_LOGD("called"); size_t argc = UNSUBSCRIBE_MAX_PARA; napi_value argv[UNSUBSCRIBE_MAX_PARA] = {nullptr}; @@ -65,7 +65,7 @@ napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, napi_value Unsubscribe(napi_env env, napi_callback_info info) { - ANS_LOGI("Unsubscribe start"); + ANS_LOGD("called"); ParametersInfoUnsubscribe paras; if (ParseParameters(env, info, paras) == nullptr) { @@ -75,7 +75,7 @@ napi_value Unsubscribe(napi_env env, napi_callback_info info) AsyncCallbackInfoUnsubscribe *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoUnsubscribe {.env = env, .asyncWork = nullptr, .objectInfo = paras.objectInfo}; if (!asynccallbackinfo) { - ANS_LOGD("Asynccallbackinfo is nullptr."); + ANS_LOGD("null asynccallbackinfo"); return Common::JSParaError(env, paras.callback); } napi_value promise = nullptr; @@ -132,7 +132,7 @@ napi_value Unsubscribe(napi_env env, napi_callback_info info) napi_queue_async_work_with_qos(env, asynccallbackinfo->asyncWork, napi_qos_user_initiated); if (asynccallbackinfo->info.isCallback) { - ANS_LOGD("Unsubscribe callback is nullptr."); + ANS_LOGE("null isCallback"); return Common::NapiGetNull(env); } else { return promise; diff --git a/frameworks/js/napi/src/uv_queue.cpp b/frameworks/js/napi/src/uv_queue.cpp index efc6ece45ef43d5ec1e082ba49262a4617770f5c..3bfc2c2fc6c6a8d02438828123f4375f2bf186ec 100644 --- a/frameworks/js/napi/src/uv_queue.cpp +++ b/frameworks/js/napi/src/uv_queue.cpp @@ -23,13 +23,13 @@ bool UvQueue::Call(napi_env env, OperationOnCallBack *data, uv_after_work_cb aft uv_loop_s *loop = nullptr; napi_get_uv_event_loop(env, &loop); if (loop == nullptr) { - ANS_LOGW("loop is nullptr."); + ANS_LOGW("null loop"); delete data; return false; } uv_work_t *work = new (std::nothrow) uv_work_t; if (work == nullptr) { - ANS_LOGW("work is nullptr."); + ANS_LOGW("null work"); delete data; return false; } diff --git a/frameworks/reminder/src/reminder_helper.cpp b/frameworks/reminder/src/reminder_helper.cpp index 7db46691694f02076996aae9215113335486b511..89f35cdc1c9b234afd2713f8f534bf007d923cec 100644 --- a/frameworks/reminder/src/reminder_helper.cpp +++ b/frameworks/reminder/src/reminder_helper.cpp @@ -23,67 +23,67 @@ namespace OHOS { namespace Notification { ErrCode ReminderHelper::PublishReminder(const ReminderRequest& reminder, int32_t& reminderId) { - ANSR_LOGI("PublishReminder start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->PublishReminder(reminder, reminderId); } ErrCode ReminderHelper::UpdateReminder(const int32_t reminderId, const ReminderRequest& reminder) { - ANSR_LOGI("UpdateReminder start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->UpdateReminder(reminderId, reminder); } ErrCode ReminderHelper::CancelReminder(const int32_t reminderId) { - ANSR_LOGI("CancelReminder start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->CancelReminder(reminderId); } ErrCode ReminderHelper::CancelAllReminders() { - ANSR_LOGI("CancelAllReminders start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->CancelAllReminders(); } ErrCode ReminderHelper::GetValidReminders(std::vector &validReminders) { - ANSR_LOGI("GetValidReminders start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->GetValidReminders(validReminders); } ErrCode ReminderHelper::AddNotificationSlot(const NotificationSlot &slot) { - ANSR_LOGI("AddNotificationSlot start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->AddNotificationSlot(slot); } ErrCode ReminderHelper::RemoveNotificationSlot(const NotificationConstant::SlotType &slotType) { - ANSR_LOGI("RemoveNotificationSlot start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->RemoveNotificationSlot(slotType); } ErrCode ReminderHelper::AddExcludeDate(const int32_t reminderId, const int64_t date) { - ANSR_LOGI("AddExcludeDate start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->AddExcludeDate(reminderId, date); } ErrCode ReminderHelper::DelExcludeDates(const int32_t reminderId) { - ANSR_LOGI("DelExcludeDates start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->DelExcludeDates(reminderId); } ErrCode ReminderHelper::GetExcludeDates(const int32_t reminderId, std::vector& dates) { - ANSR_LOGI("GetExcludeDates start"); + ANSR_LOGD("called"); return DelayedSingleton::GetInstance()->GetExcludeDates(reminderId, dates); } void ReminderHelper::StartReminderAgentService() { - ANSR_LOGI("StartReminderAgentService call"); + ANSR_LOGD("called"); DelayedSingleton::GetInstance()->StartReminderAgentService(); } } diff --git a/frameworks/reminder/src/reminder_request_adaptation.cpp b/frameworks/reminder/src/reminder_request_adaptation.cpp index 9f8e6ae6c90da92a9f56a39ebc3363ebc8c0dd21..15633e8d3bbd78fab7b250e7d0a941bbc725074c 100644 --- a/frameworks/reminder/src/reminder_request_adaptation.cpp +++ b/frameworks/reminder/src/reminder_request_adaptation.cpp @@ -30,7 +30,7 @@ ReminderRequestAdaptation* ReminderRequestAdaptation::Unmarshalling(Parcel &parc ReminderRequest::ReadReminderTypeFormParcel(parcel, tarReminderType); auto reminderRequest = ReminderRequestFactory::CreateReminderRequest(tarReminderType); if (reminderRequest == nullptr) { - ANSR_LOGE("Failed to create reminder due to no memory."); + ANSR_LOGE("null reminderRequest"); return nullptr; } if (!reminderRequest->ReadFromParcel(parcel)) { diff --git a/frameworks/reminder/src/reminder_request_alarm.cpp b/frameworks/reminder/src/reminder_request_alarm.cpp index 3f017b5d5ea31fb3ee480883d24310f21f0217d1..13b9697b461190a65139f9c20f4cb674db911778 100644 --- a/frameworks/reminder/src/reminder_request_alarm.cpp +++ b/frameworks/reminder/src/reminder_request_alarm.cpp @@ -133,7 +133,7 @@ uint8_t ReminderRequestAlarm::GetMinute() const bool ReminderRequestAlarm::UpdateNextReminder() { - ANSR_LOGD("UpdateNextReminder alarm time"); + ANSR_LOGD("called"); if (IsRepeatReminder()) { uint8_t letfSnoozeTimes = GetSnoozeTimesDynamic(); if ((letfSnoozeTimes > 0) && (GetTimeInterval() > 0)) { @@ -184,10 +184,10 @@ bool ReminderRequestAlarm::WriteParcel(Parcel &parcel) const ReminderRequestAlarm *ReminderRequestAlarm::Unmarshalling(Parcel &parcel) { - ANSR_LOGD("New alarm"); + ANSR_LOGD("called"); auto objptr = new (std::nothrow) ReminderRequestAlarm(); if (objptr == nullptr) { - ANSR_LOGE("Failed to create reminder alarm due to no memory."); + ANSR_LOGE("null objptr"); return objptr; } if (!objptr->ReadFromParcel(parcel)) { diff --git a/frameworks/reminder/src/reminder_request_client.cpp b/frameworks/reminder/src/reminder_request_client.cpp index a112b2b882fc1d260db07bc90b7cea553f591ca5..0644257f31ece3836be8d7f5bb8b52dce4ebcb29 100644 --- a/frameworks/reminder/src/reminder_request_client.cpp +++ b/frameworks/reminder/src/reminder_request_client.cpp @@ -52,7 +52,7 @@ ErrCode ReminderRequestClient::AddNotificationSlot(const NotificationSlot &slot) std::vector> slotsSptr; sptr slotSptr = new (std::nothrow) NotificationSlot(slot); if (slotSptr == nullptr) { - ANS_LOGE("Failed to create NotificationSlot ptr."); + ANS_LOGE("null slotSptr"); return ERR_ANS_NO_MEMORY; } slotsSptr.emplace_back(slotSptr); @@ -61,7 +61,7 @@ ErrCode ReminderRequestClient::AddNotificationSlot(const NotificationSlot &slot) ErrCode ReminderRequestClient::RemoveNotificationSlot(const NotificationConstant::SlotType &slotType) { - ANS_LOGI("enter RemoveNotificationSlot,slotType:%{public}d", slotType); + ANS_LOGD("called, slotType:%{public}d", slotType); sptr proxy = GetAnsManagerProxy(); if (!proxy) { ANS_LOGE("GetAnsManagerProxy fail."); @@ -185,7 +185,7 @@ sptr ReminderRequestClient::GetReminderServiceProxy() } auto samgrProxy = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgrProxy == nullptr) { - ANS_LOGE("get samgr failed"); + ANS_LOGE("null samgrProxy"); return nullptr; } auto object = samgrProxy->CheckSystemAbility(REMINDER_AGENT_SERVICE_ID); @@ -196,7 +196,7 @@ sptr ReminderRequestClient::GetReminderServiceProxy() } } - ANS_LOGE("object is null"); + ANS_LOGE("null object"); if (LoadReminderService()) { std::lock_guard lock(serviceLock_); if (proxy_ != nullptr) { @@ -215,13 +215,13 @@ bool ReminderRequestClient::LoadReminderService() std::unique_lock lock(serviceLock_); sptr loadCallback = sptr(new ReminderServiceCallback()); if (loadCallback == nullptr) { - ANS_LOGE("loadCallback is nullptr."); + ANS_LOGE("null loadCallback"); return false; } auto samgrProxy = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgrProxy == nullptr) { - ANS_LOGE("get samgr failed"); + ANS_LOGE("null samgrProxy"); return false; } @@ -242,7 +242,7 @@ bool ReminderRequestClient::LoadReminderService() void ReminderRequestClient::LoadSystemAbilitySuccess(const sptr &remoteObject) { - ANS_LOGI("ReminderRequestClient FinishStartSA"); + ANS_LOGD("called"); std::lock_guard lock(serviceLock_); if (remoteObject != nullptr) { proxy_ = iface_cast(remoteObject); @@ -260,10 +260,10 @@ void ReminderRequestClient::StartReminderAgentService() { auto reminderServiceProxy = GetReminderServiceProxy(); if (reminderServiceProxy == nullptr) { - ANS_LOGE("StartReminderService failed"); + ANS_LOGE("null reminderServiceProxy"); return; } - ANS_LOGI("StartReminderService success"); + ANS_LOGD("StartReminderService success"); } } // namespace Notification diff --git a/frameworks/reminder/src/reminder_request_timer.cpp b/frameworks/reminder/src/reminder_request_timer.cpp index 9358fc83472e3eb9fef79530ed5f79d67e73cba9..141182feb7f2486991dfe9acad30582466ad98fd 100644 --- a/frameworks/reminder/src/reminder_request_timer.cpp +++ b/frameworks/reminder/src/reminder_request_timer.cpp @@ -63,7 +63,7 @@ void ReminderRequestTimer::SetInitInfo(const uint64_t countDownTimeInSeconds) uint64_t ReminderRequestTimer::PreGetNextTriggerTimeIgnoreSnooze(bool ignoreRepeat, bool forceToGetNext) { - ANSR_LOGD("countdown time not support PreGetNextTriggerTimeIgnoreSnooze"); + ANSR_LOGD("called"); return ReminderRequest::INVALID_LONG_LONG_VALUE; } @@ -81,7 +81,7 @@ bool ReminderRequestTimer::OnTimeZoneChange() bool ReminderRequestTimer::UpdateNextReminder() { - ANSR_LOGD("countdown time not support repeat reminder, no need to update next triggerTime"); + ANSR_LOGD("called"); SetExpired(true); return false; } @@ -138,7 +138,7 @@ ReminderRequestTimer *ReminderRequestTimer::Unmarshalling(Parcel &parcel) { auto objptr = new (std::nothrow) ReminderRequestTimer(); if (objptr == nullptr) { - ANSR_LOGE("Failed to create reminder timer due to no memory."); + ANSR_LOGE("null objptr"); return objptr; } if (!objptr->ReadFromParcel(parcel)) { diff --git a/services/ans/src/advanced_notification_manager/advanced_notification_cancel.cpp b/services/ans/src/advanced_notification_manager/advanced_notification_cancel.cpp index 4e2d2db3dffea9c10bf1b5a3c5701b5e9474310a..cdf77b1b48eb1fe2a5045e81b4638f7d22478e68 100644 --- a/services/ans/src/advanced_notification_manager/advanced_notification_cancel.cpp +++ b/services/ans/src/advanced_notification_manager/advanced_notification_cancel.cpp @@ -34,7 +34,7 @@ namespace Notification { ErrCode AdvancedNotificationService::Cancel(int32_t notificationId, const std::string &label, const std::string &instanceKey) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -53,7 +53,7 @@ ErrCode AdvancedNotificationService::Cancel(int32_t notificationId, ErrCode AdvancedNotificationService::CancelAll(const std::string &instanceKey) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); const int reason = NotificationConstant::APP_CANCEL_ALL_REASON_DELETE; sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -62,7 +62,7 @@ ErrCode AdvancedNotificationService::CancelAll(const std::string &instanceKey) bundleOption->SetAppInstanceKey(instanceKey); if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalidated."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ExcuteCancelAll(bundleOption, reason); @@ -121,10 +121,10 @@ ErrCode AdvancedNotificationService::ExcuteCancelAll( ErrCode AdvancedNotificationService::CancelAsBundle( const sptr &bundleOption, int32_t notificationId, int32_t userId) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); int32_t reason = NotificationConstant::APP_CANCEL_AS_BUNELE_REASON_DELETE; if (bundleOption == nullptr) { - ANS_LOGE("bundleOption is invalid"); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } int32_t errCode = ValidRightsForCancelAsBundle(notificationId, reason); @@ -189,7 +189,7 @@ ErrCode AdvancedNotificationService::ValidRightsForCancelAsBundle(int32_t notifi ErrCode AdvancedNotificationService::CancelAsBundle( const sptr &bundleOption, int32_t notificationId) { - ANS_LOGD("%{public}s, uid = %{public}d", __FUNCTION__, bundleOption->GetUid()); + ANS_LOGD("uid = %{public}d", bundleOption->GetUid()); int32_t userId = -1; if (bundleOption->GetUid() != 0) { OHOS::AccountSA::OsAccountManager::GetOsAccountLocalIdFromUid(bundleOption->GetUid(), userId); @@ -202,11 +202,11 @@ ErrCode AdvancedNotificationService::CancelAsBundle( ErrCode AdvancedNotificationService::CancelAsBundle( int32_t notificationId, const std::string &representativeBundle, int32_t userId) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = new (std::nothrow) NotificationBundleOption( representativeBundle, DEFAULT_UID); if (bundleOption == nullptr) { - ANS_LOGE("bundleOption is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_TASK_ERR; } return CancelAsBundle(bundleOption, notificationId, userId); @@ -266,7 +266,7 @@ ErrCode AdvancedNotificationService::CancelAsBundleWithAgent( ErrCode AdvancedNotificationService::CancelContinuousTaskNotification(const std::string &label, int32_t notificationId) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem) { @@ -274,13 +274,13 @@ ErrCode AdvancedNotificationService::CancelContinuousTaskNotification(const std: } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } int32_t uid = IPCSkeleton::GetCallingUid(); ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); sptr notification = nullptr; for (auto record : notificationList_) { if ((record->bundleOption->GetBundleName().empty()) && (record->bundleOption->GetUid() == uid) && @@ -306,7 +306,7 @@ ErrCode AdvancedNotificationService::RemoveNotification(const sptr notification = nullptr; sptr notificationRequest = nullptr; @@ -421,7 +421,7 @@ ErrCode AdvancedNotificationService::RemoveAllNotificationsInner(const sptr &bundle, int32_t &reason) { std::vector> removeList; - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); GetRemoveListForRemoveAll(bundleOption, bundle, removeList); std::vector> notifications; std::vector timerIds; @@ -541,7 +541,7 @@ ErrCode AdvancedNotificationService::RemoveNotifications( const std::vector &keys, int32_t removeReason) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGD("enter"); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -551,7 +551,7 @@ ErrCode AdvancedNotificationService::RemoveNotifications( return ERR_ANS_PERMISSION_DENIED; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("NotificationSvrQueue is nullptr."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { @@ -603,7 +603,7 @@ ErrCode AdvancedNotificationService::RemoveNotificationBySlot(const sptr &slot, const int reason) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -622,7 +622,7 @@ ErrCode AdvancedNotificationService::RemoveNotificationBySlot(const sptr timerIds; for (auto record : removeList) { if (record == nullptr) { - ANS_LOGE("record is nullptr"); + ANS_LOGE("null record"); continue; } notificationList_.remove(record); @@ -652,7 +652,7 @@ void AdvancedNotificationService::GetRemoveListForRemoveNtfBySlot(const sptrbundleOption->GetBundleName() == bundle->GetBundleName()) && @@ -713,7 +713,7 @@ ErrCode AdvancedNotificationService::RemoveNotificationFromRecordList( ErrCode AdvancedNotificationService::Delete(const std::string &key, int32_t removeReason) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { std::string message = "not systemApp. key:" + key + "."; @@ -746,7 +746,7 @@ ErrCode AdvancedNotificationService::ExcuteDelete(const std::string &key, const { ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); sptr notification = nullptr; #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED std::string deviceId; @@ -774,7 +774,7 @@ ErrCode AdvancedNotificationService::ExcuteDelete(const std::string &key, const ErrCode AdvancedNotificationService::DeleteByBundle(const sptr &bundleOption) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -788,12 +788,12 @@ ErrCode AdvancedNotificationService::DeleteByBundle(const sptr bundle = GenerateValidBundleOption(bundleOption); if (bundle == nullptr) { - ANS_LOGD("bundle is false."); + ANS_LOGD("null bundle"); return ERR_ANS_INVALID_BUNDLE; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_OK; @@ -833,7 +833,7 @@ ErrCode AdvancedNotificationService::DeleteByBundle(const sptrGetType(request->GetRemovalWantAgent()->GetPendingWant()->GetTarget())); bool isSystemApp = AccessTokenHelper::IsSystemApp(); if (!isSubsystem && !isSystemApp && operationType != OPERATION_TYPE_COMMON_EVENT) { - ANS_LOGI("SetRemovalWantAgent as nullptr"); + ANS_LOGI("null SetRemovalWantAgent"); request->SetRemovalWantAgent(nullptr); } } @@ -164,11 +164,11 @@ ErrCode AdvancedNotificationService::PublishNotificationForIndirectProxy(const s NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); TraceChainUtil traceChain = TraceChainUtil(); OHOS::HiviewDFX::HiTraceId traceId = OHOS::HiviewDFX::HiTraceChain::GetId(); - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_9, EventBranchId::BRANCH_0); if (!request) { - ANS_LOGE("Request object is nullptr"); + ANS_LOGE("null request"); message.ErrorCode(ERR_ANS_INVALID_PARAM).Message("Request object is nullptr"); NotificationAnalyticsUtil::ReportPublishFailedEvent(request, message); return ERR_ANS_INVALID_PARAM; @@ -195,7 +195,7 @@ ErrCode AdvancedNotificationService::PublishNotificationForIndirectProxy(const s record->bundleOption = new (std::nothrow) NotificationBundleOption(bundle, uid); sptr bundleOption = new (std::nothrow) NotificationBundleOption(bundle, uid); if (record->bundleOption == nullptr || bundleOption == nullptr) { - ANS_LOGE("Failed to create bundleOption"); + ANS_LOGE("null bundleOption"); message.ErrorCode(ERR_ANS_NO_MEMORY).Message("Failed to create bundleOption"); NotificationAnalyticsUtil::ReportPublishFailedEvent(request, message); return ERR_ANS_NO_MEMORY; @@ -203,14 +203,14 @@ ErrCode AdvancedNotificationService::PublishNotificationForIndirectProxy(const s record->bundleOption->SetAppInstanceKey(request->GetAppInstanceKey()); record->notification = new (std::nothrow) Notification(request); if (record->notification == nullptr) { - ANS_LOGE("Failed to create notification"); + ANS_LOGE("null notification"); message.ErrorCode(ERR_ANS_NO_MEMORY).Message("Failed to create notification"); NotificationAnalyticsUtil::ReportPublishFailedEvent(request, message); return ERR_ANS_NO_MEMORY; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); message.ErrorCode(ERR_ANS_NO_MEMORY).Message("Serial queue is invalid."); NotificationAnalyticsUtil::ReportPublishFailedEvent(request, message); return ERR_ANS_INVALID_PARAM; @@ -290,7 +290,7 @@ ErrCode AdvancedNotificationService::PublishAsBundleWithMaxCapacity( ErrCode AdvancedNotificationService::PublishContinuousTaskNotification(const sptr &request) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem) { @@ -314,7 +314,7 @@ ErrCode AdvancedNotificationService::PublishContinuousTaskNotification(const spt sptr bundleOption = nullptr; bundleOption = new (std::nothrow) NotificationBundleOption(std::string(), uid); if (bundleOption == nullptr) { - ANS_LOGE("Failed to create NotificationBundleOption instance"); + ANS_LOGE("null bundleOption"); return ERR_NO_MEMORY; } @@ -328,17 +328,17 @@ ErrCode AdvancedNotificationService::PublishContinuousTaskNotification(const spt record->bundleOption = bundleOption; record->notification = new (std::nothrow) Notification(request); if (record->notification == nullptr) { - ANS_LOGE("Failed to create Notification instance"); + ANS_LOGE("null notification"); return ERR_NO_MEMORY; } record->notification->SetSourceType(NotificationConstant::SourceType::TYPE_CONTINUOUS); if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); if (!IsNotificationExists(record->notification->GetKey())) { AddToNotificationList(record); } else { @@ -362,12 +362,12 @@ ErrCode AdvancedNotificationService::UpdateNotificationTimerByUid(const int32_t bool isSubSystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); int32_t callingUid = IPCSkeleton::GetCallingUid(); if (!isSubSystem || callingUid != RESSCHED_UID) { - ANS_LOGE("caller is not ressched, callingUid: %{public}d", callingUid); + ANS_LOGE(" callingUid: %{public}d", callingUid); return ERR_ANS_NOT_SYSTEM_SERVICE; } if (!notificationSvrQueue_) { - ANS_LOGE("Serial queue is invalidated."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { @@ -380,7 +380,7 @@ ErrCode AdvancedNotificationService::UpdateNotificationTimerByUid(const int32_t ErrCode AdvancedNotificationService::CheckNotificationRequest(const sptr &request) { if (!request) { - ANSR_LOGE("ReminderRequest object is nullptr"); + ANSR_LOGE("null request"); return ERR_ANS_INVALID_PARAM; } auto tokenCaller = IPCSkeleton::GetCallingTokenID(); diff --git a/services/ans/src/advanced_notification_manager/advanced_notification_query.cpp b/services/ans/src/advanced_notification_manager/advanced_notification_query.cpp index 1bee13e13f543b67172dedd3f0dbb1f83d1a7639..332a978237350fd53d5b49c2aa5f415d5cba98fa 100644 --- a/services/ans/src/advanced_notification_manager/advanced_notification_query.cpp +++ b/services/ans/src/advanced_notification_manager/advanced_notification_query.cpp @@ -44,7 +44,7 @@ inline bool IsContained(const std::vector &vec, const std::string & ErrCode AdvancedNotificationService::GetActiveNotifications( std::vector> ¬ifications, const std::string &instanceKey) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -53,11 +53,11 @@ ErrCode AdvancedNotificationService::GetActiveNotifications( bundleOption->SetAppInstanceKey(instanceKey); if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalidated."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); notifications.clear(); for (auto record : notificationList_) { if ((record->bundleOption->GetBundleName() == bundleOption->GetBundleName()) && @@ -73,20 +73,20 @@ ErrCode AdvancedNotificationService::GetActiveNotifications( ErrCode AdvancedNotificationService::GetActiveNotificationNums(uint64_t &num) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { - ANS_LOGE("BundleOption is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_BUNDLE; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); size_t count = 0; for (auto record : notificationList_) { if ((record->bundleOption->GetBundleName() == bundleOption->GetBundleName()) && @@ -102,7 +102,7 @@ ErrCode AdvancedNotificationService::GetActiveNotificationNums(uint64_t &num) ErrCode AdvancedNotificationService::GetAllActiveNotifications(std::vector> ¬ifications) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -116,11 +116,11 @@ ErrCode AdvancedNotificationService::GetAllActiveNotifications(std::vectorsubmit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); notifications.clear(); for (auto record : notificationList_) { if (record->notification != nullptr && record->notification->request_ != nullptr) { @@ -135,7 +135,7 @@ ErrCode AdvancedNotificationService::GetAllActiveNotifications(std::vector> ¬ifications, int32_t slotTypeInt) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); NotificationConstant::SlotType slotType = static_cast(slotTypeInt); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); @@ -149,11 +149,11 @@ ErrCode AdvancedNotificationService::GetAllNotificationsBySlotType(std::vectorsubmit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); notifications.clear(); for (auto record : notificationList_) { if (record->notification != nullptr && record->notification->request_ != nullptr && @@ -169,7 +169,7 @@ ErrCode AdvancedNotificationService::GetAllNotificationsBySlotType(std::vector &key, std::vector> ¬ifications) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -182,11 +182,11 @@ ErrCode AdvancedNotificationService::GetSpecialActiveNotifications( } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); for (auto record : notificationList_) { if (IsContained(key, record->notification->GetKey())) { notifications.push_back(record->notification); @@ -201,7 +201,7 @@ ErrCode AdvancedNotificationService::GetActiveNotificationByFilter( const sptr &bundleOption, int32_t notificationId, const std::string &label, const std::vector &extraInfoKeys, sptr &request) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundle = GenerateValidBundleOption(bundleOption); if (bundle == nullptr) { return ERR_ANS_INVALID_BUNDLE; @@ -218,13 +218,13 @@ ErrCode AdvancedNotificationService::GetActiveNotificationByFilter( } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalidity."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_ANS_NOTIFICATION_NOT_EXISTS; ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); auto record = GetRecordFromNotificationList(notificationId, bundle->GetUid(), label, bundle->GetBundleName()); if ((record == nullptr) || (!record->request->IsCommonLiveView())) { @@ -264,7 +264,7 @@ ErrCode AdvancedNotificationService::GetNotificationRequestByHashCode( } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } diff --git a/services/ans/src/advanced_notification_publish/common_notification_publish_process.cpp b/services/ans/src/advanced_notification_publish/common_notification_publish_process.cpp index 8577c1befa80037128e3aa43e4c452d9a193bb7a..2c2e2a537ca42ae1fabd9688db3911b4221d6c8b 100644 --- a/services/ans/src/advanced_notification_publish/common_notification_publish_process.cpp +++ b/services/ans/src/advanced_notification_publish/common_notification_publish_process.cpp @@ -30,7 +30,7 @@ std::shared_ptr CommonNotificationPublishProce if (instance_ == nullptr) { instance_ = std::make_shared(); if (instance_ == nullptr) { - ANS_LOGE("Failed to create CommonNotificationPublishProcess instance"); + ANS_LOGE("null instance"); return nullptr; } } diff --git a/services/ans/src/advanced_notification_publish/live_publish_process.cpp b/services/ans/src/advanced_notification_publish/live_publish_process.cpp index 18bd8d68818c04093bc55784553717a9347b658a..0c0d306c003e547cd82487a60f115fffafedc0eb 100644 --- a/services/ans/src/advanced_notification_publish/live_publish_process.cpp +++ b/services/ans/src/advanced_notification_publish/live_publish_process.cpp @@ -39,7 +39,7 @@ std::shared_ptr LivePublishProcess::GetInstance() if (instance_ == nullptr) { instance_ = std::make_shared(); if (instance_ == nullptr) { - ANS_LOGE("Failed to create LivePublishProcess instance"); + ANS_LOGE("null instance"); return nullptr; } } diff --git a/services/ans/src/advanced_notification_publish_service.cpp b/services/ans/src/advanced_notification_publish_service.cpp index 64636a8098056a6375c0d98006c4874e9b673360..1119a89a0b80b94a14cbfc601173d9aab774eab4 100644 --- a/services/ans/src/advanced_notification_publish_service.cpp +++ b/services/ans/src/advanced_notification_publish_service.cpp @@ -307,7 +307,7 @@ bool AdvancedNotificationService::InitPublishProcess() ErrCode AdvancedNotificationService::IsAllowedNotifyForBundle(const sptr &bundleOption, bool &allowed) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (bundleOption == nullptr) { return ERR_ANS_INVALID_BUNDLE; } @@ -335,7 +335,7 @@ ErrCode AdvancedNotificationService::IsAllowedNotifyForBundle(const sptr &bundleOption, const std::string &groupName) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); const int32_t reason = NotificationConstant::APP_REMOVE_GROUP_REASON_DELETE; bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -687,7 +687,7 @@ void AdvancedNotificationService::ClearSlotTypeData(const sptr &request) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); auto tokenCaller = IPCSkeleton::GetCallingTokenID(); bool isSystemApp = AccessTokenHelper::IsSystemApp(); @@ -1090,7 +1090,7 @@ bool AdvancedNotificationService::IsNeedToControllerByDisableNotification(const void AdvancedNotificationService::SetAndPublishSubscriberExistFlag(const std::string& deviceType, bool existFlag) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (deviceType.empty()) { ANS_LOGE("deviceType is empty"); return; @@ -1148,7 +1148,7 @@ void AdvancedNotificationService::PublishSubscriberExistFlagEvent(bool headsetEx ErrCode AdvancedNotificationService::RemoveAllNotificationsByBundleName(const std::string &bundleName, int32_t reason) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (bundleName.empty()) { std::string message = "bundle name is empty."; @@ -1217,7 +1217,7 @@ ErrCode AdvancedNotificationService::RemoveAllNotificationsByBundleName(const st ErrCode AdvancedNotificationService::SetHashCodeRule(const uint32_t type) { - ANS_LOGI("%{public}s", __FUNCTION__); + ANS_LOGD("called"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_8, EventBranchId::BRANCH_8); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -1235,7 +1235,7 @@ ErrCode AdvancedNotificationService::SetHashCodeRule(const uint32_t type) return ERR_ANS_PERMISSION_DENIED; } ErrCode result = NotificationPreferences::GetInstance()->SetHashCodeRule(uid, type); - ANS_LOGI("SetHashCodeRule uid = %{public}d type = %{public}d, result %{public}d", uid, type, result); + ANS_LOGI("uid = %{public}d type = %{public}d, result = %{public}d", uid, type, result); message.ErrorCode(result); NotificationAnalyticsUtil::ReportModifyEvent(message); diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77b40d6a59d4edc1796ffe6a3e41cd616a738576..9f7f45903140a5274e80524c3572e13e8b021d8d 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -119,7 +119,7 @@ std::map> Advance ErrCode AdvancedNotificationService::PrepareNotificationRequest(const sptr &request) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_14, EventBranchId::BRANCH_0); std::string bundle = GetClientBundleName(); @@ -321,7 +321,7 @@ void AdvancedNotificationService::InitDistributeCallBack() AdvancedNotificationService::AdvancedNotificationService() { - ANS_LOGI("constructor"); + ANS_LOGD("called"); notificationSvrQueue_ = std::make_shared("NotificationSvrMain"); if (!notificationSvrQueue_) { ANS_LOGE("ffrt create failed!"); @@ -364,7 +364,7 @@ AdvancedNotificationService::AdvancedNotificationService() AdvancedNotificationService::~AdvancedNotificationService() { - ANS_LOGI("deconstructor"); + ANS_LOGD("called"); NotificationSubscriberManager::GetInstance()->UnRegisterOnSubscriberAddCallback(); StopFilters(); @@ -666,7 +666,7 @@ ErrCode AdvancedNotificationService::PublishPreparedNotification(const sptr &bundleOption, bool isUpdateByOwner) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGI("PublishPreparedNotification"); + ANS_LOGI("called"); auto tokenCaller = IPCSkeleton::GetCallingTokenID(); bool isAgentController = AccessTokenHelper::VerifyCallerPermission(tokenCaller, OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER); @@ -770,17 +770,17 @@ void AdvancedNotificationService::QueryDoNotDisturbProfile(const int32_t &userId { auto datashareHelper = DelayedSingleton::GetInstance(); if (datashareHelper == nullptr) { - ANS_LOGE("The data share helper is nullptr."); + ANS_LOGE("null datashareHelper"); return; } Uri enableUri(datashareHelper->GetFocusModeEnableUri(userId)); bool ret = datashareHelper->Query(enableUri, KEY_FOCUS_MODE_ENABLE, enable); if (!ret) { - ANS_LOGE("Query focus mode enable fail."); + ANS_LOGE("Query failed"); return; } if (enable != DO_NOT_DISTURB_MODE) { - ANS_LOGI("Currently not is do not disturb mode."); + ANS_LOGI("Currently not is do not disturb mode"); return; } Uri idUri(datashareHelper->GetFocusModeProfileUri(userId)); @@ -942,7 +942,7 @@ ErrCode AdvancedNotificationService::UpdateSlotAuthInfo(const std::shared_ptrrequest->IsSystemLiveView()) { - ANS_LOGI("System live view no need add sloty."); + ANS_LOGI("System live view no need add slot"); return ERR_OK; } std::vector> slots; @@ -1169,7 +1169,7 @@ void AdvancedNotificationService::StopFilters() ErrCode AdvancedNotificationService::GetBundleImportance(int32_t &importance) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -1346,7 +1346,7 @@ ErrCode AdvancedNotificationService::RemoveFromNotificationList(const sptrGetBundleName().c_str(), bundleOption->GetUid()); return ERR_ANS_NOTIFICATION_NOT_EXISTS; } @@ -1547,7 +1547,7 @@ ErrCode AdvancedNotificationService::PublishInNotificationList(const std::shared ErrCode AdvancedNotificationService::GetHasPoppedDialog( const sptr bundleOption, bool &hasPopped) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (notificationSvrQueue_ == nullptr) { ANS_LOGE("Serial queue is invalid."); return ERR_ANS_INVALID_PARAM; @@ -1562,7 +1562,7 @@ ErrCode AdvancedNotificationService::GetHasPoppedDialog( void AdvancedNotificationService::ResetPushCallbackProxy(NotificationConstant::SlotType slotType) { - ANS_LOGD("enter"); + ANS_LOGD("called"); std::lock_guard lock(pushMutex_); if (pushCallBacks_.empty()) { ANS_LOGE("invalid proxy state"); @@ -1702,7 +1702,7 @@ bool AdvancedNotificationService::IsNeedPushCheck(const sptr & void AdvancedNotificationService::TriggerAutoDelete(const std::string &hashCode, int32_t reason) { - ANS_LOGD("Enter"); + ANS_LOGD("called"); for (const auto &record : notificationList_) { if (!record->request) { @@ -1905,7 +1905,7 @@ bool AdvancedNotificationService::IsNeedNotifyConsumed(const sptr &request, std::string bundleName) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (request->GetSound().empty()) { ANS_LOGD("request sound length empty"); return ERR_OK; diff --git a/services/ans/src/advanced_notification_slot_service.cpp b/services/ans/src/advanced_notification_slot_service.cpp index 8c833accc2a66104c55cdf8ab091eb62d6053145..404b712aadd2e53bf36e04d6653892f3d74b8b89 100644 --- a/services/ans/src/advanced_notification_slot_service.cpp +++ b/services/ans/src/advanced_notification_slot_service.cpp @@ -50,7 +50,7 @@ namespace { ErrCode AdvancedNotificationService::AddSlots(const std::vector> &slots) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -102,7 +102,7 @@ ErrCode AdvancedNotificationService::AddSlots(const std::vector> &slots) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -129,7 +129,7 @@ ErrCode AdvancedNotificationService::GetSlots(std::vector ErrCode AdvancedNotificationService::GetSlotsByBundle( const sptr &bundleOption, std::vector> &slots) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -169,7 +169,7 @@ ErrCode AdvancedNotificationService::GetSlotByBundle( const sptr &bundleOption, int32_t slotTypeInt, sptr &slot) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); NotificationConstant::SlotType slotType = static_cast(slotTypeInt); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -207,7 +207,7 @@ ErrCode AdvancedNotificationService::GetSlotByBundle( ErrCode AdvancedNotificationService::UpdateSlots( const sptr &bundleOption, const std::vector> &slots) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_6, EventBranchId::BRANCH_6); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); @@ -256,7 +256,7 @@ ErrCode AdvancedNotificationService::UpdateSlots( ErrCode AdvancedNotificationService::RemoveAllSlots() { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -303,7 +303,7 @@ ErrCode AdvancedNotificationService::RemoveAllSlots() ErrCode AdvancedNotificationService::AddSlotByType(int32_t slotTypeInt) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); NotificationConstant::SlotType slotType = static_cast(slotTypeInt); if (!AccessTokenHelper::IsSystemApp() && slotType == NotificationConstant::SlotType::EMERGENCY_INFORMATION) { @@ -385,7 +385,7 @@ ErrCode AdvancedNotificationService::GetEnabledForBundleSlotSelf(int32_t slotTyp ErrCode AdvancedNotificationService::GetSlotFlagsAsBundle(const sptr &bundleOption, uint32_t &slotFlags) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { return ERR_ANS_NON_SYSTEM_APP; @@ -421,7 +421,7 @@ ErrCode AdvancedNotificationService::GetSlotFlagsAsBundle(const sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { ANS_LOGD("Failed to generateBundleOption."); @@ -450,7 +450,7 @@ ErrCode AdvancedNotificationService::GetNotificationSettings(uint32_t &slotFlags ErrCode AdvancedNotificationService::SetSlotFlagsAsBundle(const sptr &bundleOption, uint32_t slotFlags) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (bundleOption == nullptr) { ANS_LOGE("BundleOption is null."); return ERR_ANS_INVALID_BUNDLE; @@ -589,7 +589,7 @@ void AdvancedNotificationService::GenerateSlotReminderMode(const sptrGetNotificationSlotFlagsForBundle(bundle, slotFlags); if (ret != ERR_OK) { - ANS_LOGI("Failed to get slotflags for bundle, use default slotflags."); + ANS_LOGE("Failed to get slotflags for bundle, use default slotflags"); } auto configSlotReminderMode = @@ -674,7 +674,7 @@ void AdvancedNotificationService::SetRequestBySlotType(const sptrUpdateLiveviewReminderFlags(request); LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->UpdateLiveviewVoiceContent(request); } - ANS_LOGI("SetFlags-GetRemindMode, notificationKey = %{public}s flags = %{public}d", + ANS_LOGI("notificationKey = %{public}s flags = %{public}d", request->GetKey().c_str(), flags->GetReminderFlags()); #ifdef NOTIFICATION_SMART_REMINDER_SUPPORTED DelayedSingleton::GetInstance()->ReminderDecisionProcess(request); @@ -684,7 +684,7 @@ void AdvancedNotificationService::SetRequestBySlotType(const sptr &slot) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); NotificationConstant::SlotType slotType = static_cast(slotTypeInt); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -707,7 +707,7 @@ ErrCode AdvancedNotificationService::GetSlotByType(int32_t slotTypeInt, sptr(slotTypeInt); sptr bundleOption = GenerateBundleOption(); @@ -739,7 +739,7 @@ ErrCode AdvancedNotificationService::RemoveSlotByType(int32_t slotTypeInt) ErrCode AdvancedNotificationService::GetSlotNumAsBundle( const sptr &bundleOption, uint64_t &num) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { diff --git a/services/ans/src/advanced_notification_utils.cpp b/services/ans/src/advanced_notification_utils.cpp index f575aaecb9bbf1951a6325ddcfe42ac2ae4f3c0a..078ca050c1a9e882926d30a6f88a9ab320d6a15c 100644 --- a/services/ans/src/advanced_notification_utils.cpp +++ b/services/ans/src/advanced_notification_utils.cpp @@ -563,7 +563,7 @@ void AdvancedNotificationService::RemoveDoNotDisturbProfileTrustList( void AdvancedNotificationService::OnBundleDataAdd(const sptr &bundleOption) { CHECK_BUNDLE_OPTION_IS_INVALID(bundleOption) - ANS_LOGI("enter OnBundleDataAdd,bundleName:%{public}s", bundleOption->GetBundleName().c_str()); + ANS_LOGI("called, bundleName:%{public}s", bundleOption->GetBundleName().c_str()); auto bundleInstall = [bundleOption, this]() { CHECK_BUNDLE_OPTION_IS_INVALID(bundleOption) AppExecFwk::BundleInfo bundleInfo; @@ -593,7 +593,7 @@ void AdvancedNotificationService::OnBundleDataAdd(const sptr &bundleOption) { CHECK_BUNDLE_OPTION_IS_INVALID(bundleOption) - ANS_LOGI("enter OnBundleDataUpdate,bundleName:%{public}s", bundleOption->GetBundleName().c_str()); + ANS_LOGI("called, bundleName:%{public}s", bundleOption->GetBundleName().c_str()); AppExecFwk::BundleInfo bundleInfo; if (!GetBundleInfoByNotificationBundleOption(bundleOption, bundleInfo)) { ANS_LOGE("Failed to get BundleInfo using NotificationBundleOption."); @@ -601,7 +601,7 @@ void AdvancedNotificationService::OnBundleDataUpdate(const sptrSetLocalScreenStatus(true); } void AdvancedNotificationService::OnScreenOff() { - ANS_LOGI("%{public}s", __FUNCTION__); + ANS_LOGD("called"); localScreenOn_ = false; DistributedScreenStatusManager::GetInstance()->SetLocalScreenStatus(false); } @@ -1374,7 +1374,7 @@ ErrCode AdvancedNotificationService::ShellDump(const std::string &cmd, const std int AdvancedNotificationService::Dump(int fd, const std::vector &args) { - ANS_LOGD("enter"); + ANS_LOGD("called"); std::string result; GetDumpInfo(args, result); int ret = dprintf(fd, "%s\n", result.c_str()); @@ -1544,7 +1544,7 @@ ErrCode AdvancedNotificationService::PrePublishRequest(const sptr &record, int64_t deleteTimePoint, int32_t reason) { - ANS_LOGD("Enter"); + ANS_LOGD("called"); wptr wThis = this; auto triggerFunc = [wThis, record, reason, deleteTimePoint] { @@ -1571,7 +1571,7 @@ uint64_t AdvancedNotificationService::StartAutoDelete(const std::shared_ptr timerIds) { - ANS_LOGD("Enter"); + ANS_LOGD("called"); for (uint64_t timerId : timerIds) { CancelTimer(timerId); } @@ -1828,7 +1828,7 @@ void AdvancedNotificationService::ResetDistributedEnabled() ErrCode AdvancedNotificationService::OnRecoverLiveView( const std::vector &keys) { - ANS_LOGD("enter"); + ANS_LOGD("called"); if (notificationSvrQueue_ == nullptr) { ANS_LOGE("NotificationSvrQueue is nullptr."); diff --git a/services/ans/src/badge_manager/badge_manager.cpp b/services/ans/src/badge_manager/badge_manager.cpp index 1d77989b0b7dad2b432cc847433a8b041eb1a806..e57633e45c8f6f39d7191b0142c82cd2e1cf6e00 100644 --- a/services/ans/src/badge_manager/badge_manager.cpp +++ b/services/ans/src/badge_manager/badge_manager.cpp @@ -34,22 +34,22 @@ constexpr int32_t BADGE_NUM_LIMIT = 0; ErrCode AdvancedNotificationService::SetNotificationBadgeNum(int32_t num) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { - ANS_LOGD("BundleOption is null."); + ANS_LOGD("null bundleOption"); return ERR_ANS_INVALID_BUNDLE; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalidity."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h( std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); result = NotificationPreferences::GetInstance()->SetTotalBadgeNums(bundleOption, num); })); notificationSvrQueue_->wait(handler); @@ -61,7 +61,7 @@ ErrCode AdvancedNotificationService::SetShowBadgeEnabledForBundle( { HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_13, EventBranchId::BRANCH_0); if (bundleOption == nullptr) { - ANS_LOGE("BundleOption is null."); + ANS_LOGE("null bundleOption"); NotificationAnalyticsUtil::ReportModifyEvent(message.ErrorCode(ERR_ANS_INVALID_BUNDLE)); return ERR_ANS_INVALID_BUNDLE; } @@ -86,18 +86,18 @@ ErrCode AdvancedNotificationService::SetShowBadgeEnabledForBundle( sptr bundle = GenerateValidBundleOption(bundleOption); if (bundle == nullptr) { - ANS_LOGE("Bundle is nullptr."); + ANS_LOGE("null bundle"); return ERR_ANS_INVALID_BUNDLE; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("NotificationSvrQueue_ is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h( std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); result = NotificationPreferences::GetInstance()->SetShowBadge(bundle, enabled); if (result == ERR_OK) { HandleBadgeEnabledChanged(bundle, enabled); @@ -117,7 +117,7 @@ void AdvancedNotificationService::HandleBadgeEnabledChanged( sptr enabledData = new (std::nothrow) EnabledNotificationCallbackData(bundleOption->GetBundleName(), bundleOption->GetUid(), enabled); if (enabledData == nullptr) { - ANS_LOGE("Failed to create badge enabled data object."); + ANS_LOGE("null enabledData"); return; } @@ -127,7 +127,7 @@ void AdvancedNotificationService::HandleBadgeEnabledChanged( ErrCode AdvancedNotificationService::GetShowBadgeEnabledForBundle( const sptr &bundleOption, bool &enabled) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { @@ -141,17 +141,17 @@ ErrCode AdvancedNotificationService::GetShowBadgeEnabledForBundle( sptr bundle = GenerateValidBundleOption(bundleOption); if (bundle == nullptr) { - ANS_LOGD("Failed to generateValidBundleOption."); + ANS_LOGE("null bundle"); return ERR_ANS_INVALID_BUNDLE; } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); result = NotificationPreferences::GetInstance()->IsShowBadge(bundle, enabled); if (result == ERR_ANS_PREFERENCES_NOTIFICATION_BUNDLE_NOT_EXIST) { result = ERR_OK; @@ -164,7 +164,7 @@ ErrCode AdvancedNotificationService::GetShowBadgeEnabledForBundle( ErrCode AdvancedNotificationService::GetShowBadgeEnabled(bool &enabled) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); sptr bundleOption = GenerateBundleOption(); if (bundleOption == nullptr) { @@ -172,12 +172,12 @@ ErrCode AdvancedNotificationService::GetShowBadgeEnabled(bool &enabled) } if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is ineffective."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h(std::bind([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); result = NotificationPreferences::GetInstance()->IsShowBadge(bundleOption, enabled); if (result == ERR_ANS_PREFERENCES_NOTIFICATION_BUNDLE_NOT_EXIST) { result = ERR_OK; @@ -190,9 +190,9 @@ ErrCode AdvancedNotificationService::GetShowBadgeEnabled(bool &enabled) ErrCode AdvancedNotificationService::SetBadgeNumber(int32_t badgeNumber, const std::string &instanceKey) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (notificationSvrQueue_ == nullptr) { - ANS_LOGE("Serial queue is invalid."); + ANS_LOGE("null notificationSvrQueue"); return ERR_ANS_INVALID_PARAM; } int32_t callingUid = IPCSkeleton::GetCallingUid(); @@ -201,12 +201,12 @@ ErrCode AdvancedNotificationService::SetBadgeNumber(int32_t badgeNumber, const s sptr badgeData = new (std::nothrow) BadgeNumberCallbackData( bundleName, instanceKey, callingUid, badgeNumber); if (badgeData == nullptr) { - ANS_LOGE("Failed to create BadgeNumberCallbackData."); + ANS_LOGE("null badgeData"); return ERR_ANS_NO_MEMORY; } ffrt::task_handle handler = notificationSvrQueue_->submit_h([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); NotificationSubscriberManager::GetInstance()->SetBadgeNumber(badgeData); }); notificationSvrQueue_->wait(handler); @@ -217,7 +217,7 @@ ErrCode AdvancedNotificationService::SetBadgeNumberForDhByBundle( const sptr &bundleOption, int32_t badgeNumber) { if (bundleOption == nullptr) { - ANS_LOGE("SetBadgeNumberForDhByBundle bundleOption is null"); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } if (bundleOption->GetBundleName().empty()) { @@ -250,11 +250,11 @@ ErrCode AdvancedNotificationService::SetBadgeNumberForDhByBundle( } ErrCode result = ERR_OK; ffrt::task_handle handler = notificationSvrQueue_->submit_h([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); sptr badgeData = new (std::nothrow) BadgeNumberCallbackData( bundleOption->GetBundleName(), bundleOption->GetUid(), badgeNumber); if (badgeData == nullptr) { - ANS_LOGE("Failed to create badge number callback data."); + ANS_LOGE("null badgeData"); result = ERR_ANS_NO_MEMORY; } NotificationSubscriberManager::GetInstance()->SetBadgeNumber(badgeData); @@ -308,7 +308,7 @@ ErrCode AdvancedNotificationService::SetBadgeNumberByBundle( } ffrt::task_handle handler = notificationSvrQueue_->submit_h([&]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); sptr badgeData = new (std::nothrow) BadgeNumberCallbackData( bundle->GetBundleName(), bundle->GetUid(), badgeNumber); if (badgeData == nullptr) { diff --git a/services/ans/src/clone/dh_notification_clone_bundle_service.cpp b/services/ans/src/clone/dh_notification_clone_bundle_service.cpp index 0e93e2a5f7bd8d3d874f97e77336182555d2e433..be3ec0409c0a8b4313c34918ef1025e4f0c46d32 100644 --- a/services/ans/src/clone/dh_notification_clone_bundle_service.cpp +++ b/services/ans/src/clone/dh_notification_clone_bundle_service.cpp @@ -47,7 +47,7 @@ DhNotificationCloneBundle::~DhNotificationCloneBundle() ErrCode DhNotificationCloneBundle::OnBackup(nlohmann::json &jsonObject) { - ANS_LOGI("dh Notification bundle backup."); + ANS_LOGI("called"); std::vector cloneBundles; NotificationPreferences::GetInstance()->GetAllCLoneBundlesInfo(ZERO_USERID, cloneBundles); @@ -68,7 +68,7 @@ ErrCode DhNotificationCloneBundle::OnBackup(nlohmann::json &jsonObject) void DhNotificationCloneBundle::OnRestore(const nlohmann::json &jsonObject) { - ANS_LOGI("dh Notification bundle list on restore."); + ANS_LOGI("called"); if (jsonObject.is_null() || !jsonObject.is_array()) { ANS_LOGI("dh Notification bundle list is null or not array."); return; @@ -124,7 +124,7 @@ void DhNotificationCloneBundle::OnUserSwitch(int32_t userId) { ANS_LOGI("Handler user switch %{public}d", userId); if (dhCloneBundleQueue_ == nullptr) { - ANS_LOGW("Clone bundle queue is null."); + ANS_LOGW("null dhCloneBundleQueue"); return; } dhCloneBundleQueue_->submit_h(std::bind([&, userId]() { diff --git a/services/ans/src/clone/notification_clone_bundle_service.cpp b/services/ans/src/clone/notification_clone_bundle_service.cpp index 9bdf7f60bb226621ff937103a895d993aa67a9cb..9694601f0ffae08d527ddc0729479b83f26252d6 100644 --- a/services/ans/src/clone/notification_clone_bundle_service.cpp +++ b/services/ans/src/clone/notification_clone_bundle_service.cpp @@ -46,7 +46,7 @@ NotificationCloneBundle::~NotificationCloneBundle() ErrCode NotificationCloneBundle::OnBackup(nlohmann::json &jsonObject) { - ANS_LOGI("Notification bundle backup."); + ANS_LOGI("called"); int32_t userId = NotificationCloneUtil::GetActiveUserId(); std::vector cloneBundles; NotificationPreferences::GetInstance()->GetAllCLoneBundlesInfo(userId, cloneBundles); @@ -68,7 +68,7 @@ ErrCode NotificationCloneBundle::OnBackup(nlohmann::json &jsonObject) void NotificationCloneBundle::OnRestore(const nlohmann::json &jsonObject) { - ANS_LOGI("Notification bundle list on restore."); + ANS_LOGI("called"); if (jsonObject.is_null() || !jsonObject.is_array()) { ANS_LOGI("Notification disturb profile list is null or not array."); return; @@ -107,7 +107,7 @@ void NotificationCloneBundle::OnRestore(const nlohmann::json &jsonObject) for (auto bundle = bundlesInfo_.begin(); bundle != bundlesInfo_.end(); bundle++) { ANS_LOGI("Event bundle left %{public}s.", bundle->Dump().c_str()); } - ANS_LOGI("Notification bundle list on restore end."); + ANS_LOGD("end"); } void NotificationCloneBundle::OnRestoreStart(const std::string bundleName, int32_t appIndex, @@ -137,7 +137,7 @@ void NotificationCloneBundle::OnUserSwitch(int32_t userId) { ANS_LOGI("Handler user switch %{public}d", userId); if (cloneBundleQueue_ == nullptr) { - ANS_LOGW("Clone bundle queue is null."); + ANS_LOGW("null cloneBundleQueue"); return; } cloneBundleQueue_->submit_h(std::bind([&, userId]() { diff --git a/services/ans/src/clone/notification_clone_disturb_service.cpp b/services/ans/src/clone/notification_clone_disturb_service.cpp index 7e390b8e7d1f2d8659c515d8c3ad104099c4d852..1693d268541689c58cf1daad71a7b159c48dcdb5 100644 --- a/services/ans/src/clone/notification_clone_disturb_service.cpp +++ b/services/ans/src/clone/notification_clone_disturb_service.cpp @@ -63,7 +63,7 @@ ErrCode NotificationCloneDisturb::OnBackup(nlohmann::json &jsonObject) void NotificationCloneDisturb::OnRestore(const nlohmann::json &jsonObject) { - ANS_LOGI("Notification disturb profile list on restore."); + ANS_LOGD("called"); if (jsonObject.is_null() || !jsonObject.is_array()) { ANS_LOGI("Notification disturb profile list is null or not array."); return; @@ -117,7 +117,7 @@ void NotificationCloneDisturb::OnRestore(const nlohmann::json &jsonObject) ANS_LOGI("Clone queue left %{public}s %{public}zu.", std::to_string((*profile)->GetProfileId()).c_str(), (*profile)->GetProfileTrustList().size()); } - ANS_LOGI("Notification disturb profile list on restore end."); + ANS_LOGD("end"); })); } @@ -147,9 +147,9 @@ void NotificationCloneDisturb::GetProfileUid(int32_t userId, std::mapsubmit_h(std::bind([&, userId]() { @@ -159,7 +159,7 @@ void NotificationCloneDisturb::OnUserSwitch(int32_t userId) ANS_LOGI("Clone queue left %{public}s %{public}zu.", std::to_string((*profile)->GetProfileId()).c_str(), (*profile)->GetProfileTrustList().size()); } - ANS_LOGI("Notification disturb profile list on recover end."); + ANS_LOGD("end"); })); } @@ -175,7 +175,7 @@ void NotificationCloneDisturb::OnRestoreStart(const std::string bundleName, int3 NotificationBundleOption bundle(bundleName, uid); bundle.SetAppIndex(appIndex); if (cloneDisturbQueue_ == nullptr) { - ANS_LOGW("Clone disturb queue is null."); + ANS_LOGW("null cloneDisturbQueue"); return; } cloneDisturbQueue_->submit_h(std::bind([&, bundle, userId]() { diff --git a/services/ans/src/clone/notification_clone_manager.cpp b/services/ans/src/clone/notification_clone_manager.cpp index 1a448dd02c28892e78a8b190d0457bd7176eaaa4..e961cf5c84243d12c5ef8b3eab012cdc6760d009 100644 --- a/services/ans/src/clone/notification_clone_manager.cpp +++ b/services/ans/src/clone/notification_clone_manager.cpp @@ -46,13 +46,13 @@ constexpr const char *BACKUP_CONFIG_FILE_PATH = "/data/service/el1/public/notifi std::shared_ptr AncoRestoreStartEventSubscriber::create() { - ANS_LOGI("AncoRestoreStartEventSubscriber create"); + ANS_LOGD("start"); EventFwk::MatchingSkills matchingSkills; matchingSkills.AddEvent(AncoRestoreStartEventSubscriber::EVENT_NAME); EventFwk::CommonEventSubscribeInfo subscriberInfo(matchingSkills); subscriberInfo.SetPermission(AncoRestoreStartEventSubscriber::EVENT_PUBLISHER_PERMISSION); return std::make_shared(subscriberInfo); - ANS_LOGI("AncoRestoreStartEventSubscriber create end"); + ANS_LOGD("end"); } AncoRestoreStartEventSubscriber::AncoRestoreStartEventSubscriber( @@ -63,7 +63,7 @@ AncoRestoreStartEventSubscriber::AncoRestoreStartEventSubscriber( AncoRestoreStartEventSubscriber::~AncoRestoreStartEventSubscriber() { - ANS_LOGI("AncoRestoreStartEventSubscriber release"); + ANS_LOGD("called"); } void AncoRestoreStartEventSubscriber::OnReceiveEvent(const EventFwk::CommonEventData& data) @@ -106,7 +106,7 @@ static std::string SetBackUpReply() int32_t NotificationCloneManager::OnBackup(MessageParcel& data, MessageParcel& reply) { - ANS_LOGI("OnBackup start"); + ANS_LOGD("called"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_22, EventBranchId::BRANCH_1); if (cloneTemplates.empty()) { ANS_LOGI("Notification no need Backup."); @@ -118,7 +118,7 @@ int32_t NotificationCloneManager::OnBackup(MessageParcel& data, MessageParcel& r nlohmann::json jsonItem; auto cloneTemplate = iter->second; if (cloneTemplate == nullptr) { - ANS_LOGW("Notification OnBackup %{public}s funtion is null.", iter->first.c_str()); + ANS_LOGW("null cloneTemplate %{public}s", iter->first.c_str()); continue; } if (iter->second->OnBackup(jsonItem) != ERR_OK) { @@ -136,7 +136,7 @@ int32_t NotificationCloneManager::OnBackup(MessageParcel& data, MessageParcel& r FILE *fdfile = fopen(BACKUP_CONFIG_FILE_PATH, "r"); if (fdfile == nullptr) { - ANS_LOGE("Notification open file failed."); + ANS_LOGE("null fdfile"); message.Message("Notification open file failed."); NotificationAnalyticsUtil::ReportModifyEvent(message); return ANS_CLONE_ERROR; @@ -157,7 +157,7 @@ int32_t NotificationCloneManager::OnBackup(MessageParcel& data, MessageParcel& r int32_t NotificationCloneManager::OnRestore(MessageParcel& data, MessageParcel& reply) { - ANS_LOGI("OnRestore start"); + ANS_LOGD("start"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_22, EventBranchId::BRANCH_2); reply.WriteString(SetBackUpReply()); std::string storeMessage; @@ -189,13 +189,13 @@ int32_t NotificationCloneManager::OnRestore(MessageParcel& data, MessageParcel& iter->second->OnRestore(jsonObject.at(iter->first)); } } - ANS_LOGI("OnRestore end"); + ANS_LOGD("end"); return ERR_OK; } NotificationCloneManager::NotificationCloneManager() { - ANS_LOGI("Notification clone manager init."); + ANS_LOGD("start"); // not change push sequence, ensure [clone item] before [dh clone item] cloneTemplates.push_back(std::make_pair(CLONE_ITEM_BUNDLE_INFO, NotificationCloneBundle::GetInstance())); cloneTemplates.push_back(std::make_pair(DH_CLONE_ITEM_BUNDLE_INFO, DhNotificationCloneBundle::GetInstance())); @@ -206,17 +206,17 @@ NotificationCloneManager::NotificationCloneManager() ANS_LOGE("Subscribe AncoRestoreStartEventSubscriber Failed."); restoreStartEventSubscriber_ = nullptr; } - ANS_LOGI("Subscribe AncoRestoreStartEventSubscriber success."); + ANS_LOGD("end"); } NotificationCloneManager::~NotificationCloneManager() { - ANS_LOGI("Notification clone manager destory."); + ANS_LOGD("called"); } ErrCode NotificationCloneManager::LoadConfig(UniqueFd &fd, std::string& config) { - ANS_LOGI("Load notification config."); + ANS_LOGD("called"); struct stat statBuf; if (fstat(fd.Get(), &statBuf) < 0) { ANS_LOGE("LoadConfig fstat fd fail %{public}d.", fd.Get()); diff --git a/services/ans/src/common/notification_analytics_util.cpp b/services/ans/src/common/notification_analytics_util.cpp index 7bfa31ccefe927759996d78f87752a180a827a4a..38fe9e190e593352fcf8078abc8ee9535bf819a7 100644 --- a/services/ans/src/common/notification_analytics_util.cpp +++ b/services/ans/src/common/notification_analytics_util.cpp @@ -342,7 +342,7 @@ void NotificationAnalyticsUtil::ReportDeleteFailedEvent(const sptr& request, const HaMetaMessage& message) { - ANS_LOGD("ReportPublishSuccessEvent enter"); + ANS_LOGD("called"); if (request == nullptr) { return; } @@ -475,7 +475,7 @@ void NotificationAnalyticsUtil::CreateLiveViewTimerExecute() } sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null timer"); g_reportLiveViewFlag = false; return; } @@ -504,7 +504,7 @@ void NotificationAnalyticsUtil::ExecuteLiveViewReport() if (reportAggregateTimeId == 0) { sptr aggregateTimer = MiscServices::TimeServiceClient::GetInstance(); if (aggregateTimer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null aggregateTimer"); g_reportLiveViewFlag = false; return; } @@ -517,7 +517,7 @@ void NotificationAnalyticsUtil::ExecuteLiveViewReport() } sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null timer"); return; } auto triggerFunc = [] { @@ -580,7 +580,7 @@ ReportCache NotificationAnalyticsUtil::AggregateLiveView() bool NotificationAnalyticsUtil::IsAllowedBundle(const sptr& request) { - ANS_LOGD("IsAllowedBundle enter"); + ANS_LOGD("called"); std::string bundleName = request->GetOwnerBundleName(); return DelayedSingleton::GetInstance()->IsReportTrustList(bundleName); } @@ -588,7 +588,7 @@ bool NotificationAnalyticsUtil::IsAllowedBundle(const sptr& std::string NotificationAnalyticsUtil::BuildAnsData(const sptr& request, const HaMetaMessage& message) { - ANS_LOGD("BuildAnsData enter."); + ANS_LOGD("called"); nlohmann::json ansData; std::shared_ptr extraInfo = nullptr; if (request->GetUnifiedGroupInfo() != nullptr && @@ -693,7 +693,7 @@ void NotificationAnalyticsUtil::CommonNotificationEvent(const sptr& request, int32_t callUid) { - ANS_LOGD("ReportPublishSuccessEvent enter"); + ANS_LOGD("called"); if (request == nullptr) { return; } @@ -715,7 +715,7 @@ void NotificationAnalyticsUtil::ReportSAPublishSuccessEvent(const sptr& request) { - ANS_LOGD("ReportPublishSuccessEvent enter"); + ANS_LOGD("called"); if (request == nullptr || !request->HasUserInputButton()) { return; } @@ -986,7 +986,7 @@ void NotificationAnalyticsUtil::AddListCache(EventFwk::Want& want, int32_t event if (reportTimerId == 0) { sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null timer"); return; } reportTimerId = timer->CreateTimer(reportTimeInfo); @@ -1003,7 +1003,7 @@ void NotificationAnalyticsUtil::AddListCache(EventFwk::Want& want, int32_t event void NotificationAnalyticsUtil::ReportBadgeChange(const sptr &badgeData) { - ANS_LOGD("ReportBadgeChange enter"); + ANS_LOGD("called"); if (badgeData == nullptr) { return; } @@ -1038,7 +1038,7 @@ void NotificationAnalyticsUtil::ReportBadgeChange(const sptr& request) { - ANS_LOGD("ReportPublishBadge enter"); + ANS_LOGD("called"); if (request == nullptr) { return; } @@ -1148,7 +1148,7 @@ void NotificationAnalyticsUtil::AggregateBadgeChange() if (reportAggregateTimeId == 0) { sptr aggregateTimer = MiscServices::TimeServiceClient::GetInstance(); if (aggregateTimer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null aggregateTimer"); return; } reportAggregateTimeId = aggregateTimer->CreateTimer(reportAggregateTimeInfo); @@ -1181,7 +1181,7 @@ void NotificationAnalyticsUtil::AddSuccessListCache(EventFwk::Want& want, int32_ if (reportAggregateTimeId == 0) { sptr aggregateTimer = MiscServices::TimeServiceClient::GetInstance(); if (aggregateTimer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null aggregateTimer"); return; } reportAggregateTimeId = aggregateTimer->CreateTimer(reportAggregateTimeInfo); @@ -1198,7 +1198,7 @@ void NotificationAnalyticsUtil::AddSuccessListCache(EventFwk::Want& want, int32_ ReportCache NotificationAnalyticsUtil::Aggregate() { - ANS_LOGI("Success list aggregated."); + ANS_LOGD("called"); EventFwk::Want want; auto reportCachetemp = successReportCacheList.front(); @@ -1278,7 +1278,7 @@ void NotificationAnalyticsUtil::ExecuteCacheList() { if (reportCacheList.empty()) { g_reportFlag = false; - ANS_LOGI("reportCacheList is end"); + ANS_LOGE("empty reportCacheList"); return; } auto reportCache = reportCacheList.front(); @@ -1292,7 +1292,7 @@ void NotificationAnalyticsUtil::ExecuteCacheList() sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr || reportTimerId == 0) { g_reportFlag = false; - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null timer or reportTimerId"); return; } timer->StartTimer(reportTimerId, NotificationAnalyticsUtil::GetCurrentTime() + @@ -1456,7 +1456,7 @@ bool NotificationAnalyticsUtil::CreateSlotTimerExecute(const int32_t &userId) sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null timer"); g_reportSlotFlag = false; return false; } @@ -1488,7 +1488,7 @@ void NotificationAnalyticsUtil::ExecuteSlotReportList() sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANS_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANS_LOGE("null timer"); g_reportSlotFlag = false; return; } diff --git a/services/ans/src/common/notification_config_parse.cpp b/services/ans/src/common/notification_config_parse.cpp index e7a444355f58c233dafe917798823235a5245a27..7331883e23c7787eef765eabb54e84b47f5057ae 100644 --- a/services/ans/src/common/notification_config_parse.cpp +++ b/services/ans/src/common/notification_config_parse.cpp @@ -292,7 +292,7 @@ bool NotificationConfigParse::GetMirrorNotificationEnabledStatus(std::vector lock(mutex_); @@ -408,7 +408,7 @@ void NotificationConfigParse::GetCollaborationFilter() bool NotificationConfigParse::IsInCollaborationFilter(const std::string& bundleName, int32_t uid) const { if (uidList_.empty() && bundleNameList_.empty()) { - ANS_LOGE("UidList and bundleNameList empty."); + ANS_LOGE("empty uidList or bundleNameList"); return false; } diff --git a/services/ans/src/notification_local_live_view_subscriber_manager.cpp b/services/ans/src/notification_local_live_view_subscriber_manager.cpp index d4ecd711e569a8ed3e0ed21fc02d6d09a23c2cc8..c82a342339f6696a05b929eba6efba99f60e6213 100644 --- a/services/ans/src/notification_local_live_view_subscriber_manager.cpp +++ b/services/ans/src/notification_local_live_view_subscriber_manager.cpp @@ -41,19 +41,19 @@ struct NotificationLocalLiveViewSubscriberManager::LocalLiveViewSubscriberRecord NotificationLocalLiveViewSubscriberManager::NotificationLocalLiveViewSubscriberManager() { - ANS_LOGI("constructor"); + ANS_LOGD("called"); notificationButtonQueue_ = std::make_shared("NotificationLocalLiveViewMgr"); recipient_ = new (std::nothrow) RemoteDeathRecipient(std::bind(&NotificationLocalLiveViewSubscriberManager::OnRemoteDied, this, std::placeholders::_1)); if (recipient_ == nullptr) { - ANS_LOGE("Failed to create RemoteDeathRecipient instance"); + ANS_LOGE("null recipient"); } } NotificationLocalLiveViewSubscriberManager::~NotificationLocalLiveViewSubscriberManager() { - ANS_LOGI("deconstructor"); + ANS_LOGD("called"); buttonRecordList_.clear(); } @@ -69,7 +69,7 @@ ErrCode NotificationLocalLiveViewSubscriberManager::AddLocalLiveViewSubscriber( { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (subscriber == nullptr) { - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return ERR_ANS_INVALID_PARAM; } @@ -83,22 +83,22 @@ ErrCode NotificationLocalLiveViewSubscriberManager::AddLocalLiveViewSubscriber( bundleOption = new (std::nothrow) NotificationBundleOption(bundle, callingUid); ErrCode result = ERR_ANS_TASK_ERR; if (bundleOption == nullptr) { - ANS_LOGE("Failed to create NotificationBundleOption instance"); + ANS_LOGE("null bundleOption"); return ERR_ANS_NO_MEMORY; } ANS_LOGD("Get userId succeeded, callingUid = <%{public}d> bundleName = <%{public}s>", callingUid, bundle.c_str()); if (notificationButtonQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return result; } - ANS_LOGD("ffrt start!"); + ANS_LOGD("start"); ffrt::task_handle handler = notificationButtonQueue_->submit_h(std::bind([this, &subscriber, &bundleOption, &result]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); result = this->AddSubscriberInner(subscriber, bundleOption); })); notificationButtonQueue_->wait(handler); - ANS_LOGD("ffrt end!"); + ANS_LOGD("end"); return result; } @@ -107,23 +107,23 @@ ErrCode NotificationLocalLiveViewSubscriberManager::RemoveLocalLiveViewSubscribe { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (subscriber == nullptr) { - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_ANS_TASK_ERR; if (notificationButtonQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return result; } - ANS_LOGD("ffrt start!"); + ANS_LOGD("start"); ffrt::task_handle handler = notificationButtonQueue_->submit_h(std::bind([this, &subscriber, &subscribeInfo, &result]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); result = this->RemoveSubscriberInner(subscriber, subscribeInfo); })); notificationButtonQueue_->wait(handler); - ANS_LOGD("ffrt end!"); + ANS_LOGD("end"); return result; } @@ -132,27 +132,27 @@ void NotificationLocalLiveViewSubscriberManager::NotifyTriggerResponse(const spt { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (notificationButtonQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } AppExecFwk::EventHandler::Callback NotifyTriggerResponseFunc = std::bind(&NotificationLocalLiveViewSubscriberManager::NotifyTriggerResponseInner, this, notification, buttonOption); - ANS_LOGD("ffrt start!"); + ANS_LOGD("start"); notificationButtonQueue_->submit(NotifyTriggerResponseFunc); - ANS_LOGD("ffrt end!"); + ANS_LOGD("end"); } void NotificationLocalLiveViewSubscriberManager::OnRemoteDied(const wptr &object) { - ANS_LOGI("OnRemoteDied"); + ANS_LOGD("called"); if (notificationButtonQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } ffrt::task_handle handler = notificationButtonQueue_->submit_h(std::bind([this, object]() { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); std::shared_ptr record = FindSubscriberRecord(object); if (record != nullptr) { ANS_LOGI("subscriber removed . userId = %{public}d", record->userId); @@ -161,9 +161,9 @@ void NotificationLocalLiveViewSubscriberManager::OnRemoteDied(const wptrwait(handler); - ANS_LOGD("ffrt end!"); + ANS_LOGD("end"); } std::shared_ptr NotificationLocalLiveViewSubscriberManager::FindSubscriberRecord( @@ -217,7 +217,7 @@ ErrCode NotificationLocalLiveViewSubscriberManager::AddSubscriberInner( if (record == nullptr) { record = CreateSubscriberRecord(subscriber, bundleOption); if (record == nullptr) { - ANS_LOGE("CreateSubscriberRecord failed."); + ANS_LOGE("null record"); return ERR_ANS_NO_MEMORY; } buttonRecordList_.push_back(record); @@ -238,7 +238,7 @@ ErrCode NotificationLocalLiveViewSubscriberManager::RemoveSubscriberInner( std::shared_ptr record = FindSubscriberRecord(subscriber); if (record == nullptr) { - ANS_LOGE("subscriber not found."); + ANS_LOGE("null record"); return ERR_ANS_INVALID_PARAM; } @@ -255,7 +255,7 @@ ErrCode NotificationLocalLiveViewSubscriberManager::RemoveSubscriberInner( void NotificationLocalLiveViewSubscriberManager::NotifyTriggerResponseInner( const sptr ¬ification, const sptr buttonOption) { - ANS_LOGD("ffrt enter!"); + ANS_LOGD("called"); NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); int32_t sendUserId; @@ -267,12 +267,10 @@ void NotificationLocalLiveViewSubscriberManager::NotifyTriggerResponseInner( sendUserId = notification->GetUid(); bundleName = notification->GetBundleName(); } - ANS_LOGD("%{public}s sendUserId <%{public}d>, bundlename <%{public}s>", - __FUNCTION__, sendUserId, bundleName.c_str()); + ANS_LOGD("sendUserId <%{public}d>, bundlename <%{public}s>", sendUserId, bundleName.c_str()); for (auto record : buttonRecordList_) { - ANS_LOGD("%{public}s record->userId = <%{public}d>, bundlename <%{public}s>", - __FUNCTION__, record->userId, record->bundleName.c_str()); + ANS_LOGD("record->userId = <%{public}d>, bundlename <%{public}s>", record->userId, record->bundleName.c_str()); if (record->bundleName == bundleName && record->userId == sendUserId) { record->subscriber->OnResponse(notification->GetId(), buttonOption); } diff --git a/services/ans/src/notification_preferences.cpp b/services/ans/src/notification_preferences.cpp index dcff9f9fdb301d05eff2d440d5a58b80fab44adb..7d0b394d767c834d63337ffb0e3dde6353c3bed6 100644 --- a/services/ans/src/notification_preferences.cpp +++ b/services/ans/src/notification_preferences.cpp @@ -517,7 +517,7 @@ ErrCode NotificationPreferences::GetDoNotDisturbDate(const int32_t &userId, ErrCode NotificationPreferences::SetDoNotDisturbDate(const int32_t &userId, const sptr date) { - ANS_LOGE("enter."); + ANS_LOGE("called"); if (userId <= SUBSCRIBE_USER_INIT) { return ERR_ANS_INVALID_PARAM; } @@ -539,7 +539,7 @@ ErrCode NotificationPreferences::SetDoNotDisturbDate(const int32_t &userId, ErrCode NotificationPreferences::AddDoNotDisturbProfiles( int32_t userId, std::vector> profiles) { - ANS_LOGD("Called."); + ANS_LOGD("called"); for (auto profile : profiles) { if (profile == nullptr) { ANS_LOGE("The profile is nullptr."); @@ -592,7 +592,7 @@ bool NotificationPreferences::GetBundleInfo(NotificationPreferencesInfo &prefere ErrCode NotificationPreferences::RemoveDoNotDisturbProfiles( int32_t userId, const std::vector> profiles) { - ANS_LOGD("Called."); + ANS_LOGD("called"); for (auto profile : profiles) { if (profile == nullptr) { ANS_LOGE("The profile is nullptr."); @@ -633,7 +633,7 @@ void NotificationPreferences::UpdateProfilesUtil(std::vector& bundleList) { - ANS_LOGI("Called update Profile %{public}d %{public}s %{public}zu.", + ANS_LOGD("called, update Profile %{public}d %{public}s %{public}zu", userId, std::to_string(profileId).c_str(), bundleList.size()); if (bundleList.empty()) { return ERR_ANS_INVALID_PARAM; @@ -756,7 +756,7 @@ void NotificationPreferences::GetDoNotDisturbProfileListByUserId(int32_t userId, ErrCode NotificationPreferences::GetAllNotificationEnabledBundles(std::vector &bundleOption) { - ANS_LOGD("Called."); + ANS_LOGD("called"); std::lock_guard lock(preferenceMutex_); if (preferncesDB_ == nullptr) { return ERR_ANS_SERVICE_NOT_READY; @@ -770,7 +770,7 @@ ErrCode NotificationPreferences::GetAllNotificationEnabledBundles(std::vector &bundleOption) { - ANS_LOGD("Called."); + ANS_LOGD("called"); std::lock_guard lock(preferenceMutex_); return preferencesInfo_.GetAllLiveViewEnabledBundles(userId, bundleOption); } @@ -778,7 +778,7 @@ ErrCode NotificationPreferences::GetAllLiveViewEnabledBundles(const int32_t user ErrCode NotificationPreferences::GetAllDistribuedEnabledBundles(int32_t userId, const std::string &deviceType, std::vector &bundleOption) { - ANS_LOGD("Called."); + ANS_LOGD("called"); std::lock_guard lock(preferenceMutex_); if (preferncesDB_ == nullptr) { return ERR_ANS_SERVICE_NOT_READY; @@ -1516,7 +1516,7 @@ void NotificationPreferences::SetDistributedEnabledForBundle(const NotificationP if (!isCachedMirrorNotificationEnabledStatus_) { if (!DelayedSingleton::GetInstance()->GetMirrorNotificationEnabledStatus( mirrorNotificationEnabledStatus_)) { - ANS_LOGE("GetMirrorNotificationEnabledStatus failed from json"); + ANS_LOGE("Get mirror status failed"); return; } isCachedMirrorNotificationEnabledStatus_ = true; @@ -1554,7 +1554,7 @@ uint32_t NotificationPreferences::GetHashCodeRule(const int32_t uid) std::lock_guard lock(preferenceMutex_); uint32_t result = 0; result = preferncesDB_->GetHashCodeRule(uid); - ANS_LOGI("GetHashCodeRule uid = %{public}d result = %{public}d", uid, result); + ANS_LOGI("uid = %{public}d result = %{public}d", uid, result); return result; } diff --git a/services/ans/src/notification_preferences_database.cpp b/services/ans/src/notification_preferences_database.cpp index 895037299931dce8ddb73d2e13546dc97836d02e..1ee9e1ce560c0ddd00159a41bc70ac7758304005 100644 --- a/services/ans/src/notification_preferences_database.cpp +++ b/services/ans/src/notification_preferences_database.cpp @@ -272,7 +272,7 @@ NotificationPreferencesDatabase::NotificationPreferencesDatabase() NotificationPreferencesDatabase::~NotificationPreferencesDatabase() { - ANS_LOGD("Notification Rdb is deleted"); + ANS_LOGD("called"); } bool NotificationPreferencesDatabase::CheckRdbStore() @@ -291,7 +291,7 @@ bool NotificationPreferencesDatabase::PutSlotsToDisturbeDB( const std::string &bundleName, const int32_t &bundleUid, const std::vector> &slots) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (bundleName.empty()) { ANS_LOGE("Bundle name is null."); return false; @@ -312,7 +312,7 @@ bool NotificationPreferencesDatabase::PutSlotsToDisturbeDB( int32_t userId = -1; OsAccountManagerHelper::GetInstance().GetOsAccountLocalIdFromUid(bundleUid, userId); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t result = rdbDataManager_->InsertBatchData(values, userId); @@ -331,7 +331,7 @@ bool NotificationPreferencesDatabase::PutBundlePropertyToDisturbeDB( message.Message(bundleInfo.GetBundleName() + "_" +std::to_string(bundleInfo.GetBundleUid())); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); NotificationAnalyticsUtil::ReportModifyEvent(message.BranchId(BRANCH_1)); return false; } @@ -464,7 +464,7 @@ bool NotificationPreferencesDatabase::PutNotificationsEnabledForBundle( bool NotificationPreferencesDatabase::PutNotificationsEnabled(const int32_t &userId, const bool &enabled) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -483,7 +483,7 @@ bool NotificationPreferencesDatabase::PutSlotFlags(NotificationPreferencesInfo:: const int32_t &slotFlags) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -519,12 +519,12 @@ bool NotificationPreferencesDatabase::PutDoNotDisturbDate( const int32_t &userId, const sptr &date) { if (date == nullptr) { - ANS_LOGE("Invalid date."); + ANS_LOGE("null date"); return false; } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -563,13 +563,13 @@ bool NotificationPreferencesDatabase::AddDoNotDisturbProfiles( return false; } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::unordered_map values; for (auto profile : profiles) { if (profile == nullptr) { - ANS_LOGE("The profile is null."); + ANS_LOGE("null profile"); return false; } std::string key = std::string().append(KEY_DO_NOT_DISTURB_ID).append(KEY_UNDER_LINE).append( @@ -592,13 +592,13 @@ bool NotificationPreferencesDatabase::RemoveDoNotDisturbProfiles( return false; } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::vector keys; for (auto profile : profiles) { if (profile == nullptr) { - ANS_LOGE("The profile is null."); + ANS_LOGE("null profile"); return false; } std::string key = std::string().append(KEY_DO_NOT_DISTURB_ID).append(KEY_UNDER_LINE).append( @@ -617,7 +617,7 @@ bool NotificationPreferencesDatabase::GetDoNotDisturbProfiles( const std::string &key, sptr &profile, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::string values; @@ -628,7 +628,7 @@ bool NotificationPreferencesDatabase::GetDoNotDisturbProfiles( } profile = new (std::nothrow) NotificationDoNotDisturbProfile(); if (profile == nullptr) { - ANS_LOGE("The profile is null."); + ANS_LOGE("null profile"); return false; } profile->FromJson(values); @@ -639,7 +639,7 @@ void NotificationPreferencesDatabase::GetValueFromDisturbeDB( const std::string &key, const int32_t &userId, std::function callback) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return; } std::string value; @@ -655,7 +655,7 @@ void NotificationPreferencesDatabase::GetValueFromDisturbeDB( const std::string &key, const int32_t &userId, std::function callback) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return; } std::string value; @@ -713,7 +713,7 @@ bool NotificationPreferencesDatabase::PutBundlePropertyValueToDisturbeDB( values); GenerateEntry(GenerateBundleKey(bundleKey, KEY_BUNDLE_UID), std::to_string(bundleInfo.GetBundleUid()), values); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t userId = -1; @@ -728,9 +728,9 @@ bool NotificationPreferencesDatabase::PutBundlePropertyValueToDisturbeDB( bool NotificationPreferencesDatabase::ParseFromDisturbeDB(NotificationPreferencesInfo &info, int32_t userId) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::vector activeUserId; @@ -792,9 +792,9 @@ bool NotificationPreferencesDatabase::GetBundleInfo(const sptrDestroy(); @@ -804,9 +804,9 @@ bool NotificationPreferencesDatabase::RemoveAllDataFromDisturbeDB() bool NotificationPreferencesDatabase::RemoveBundleFromDisturbeDB( const std::string &bundleKey, const int32_t &bundleUid) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t userId = -1; @@ -840,7 +840,7 @@ bool NotificationPreferencesDatabase::RemoveSlotFromDisturbeDB( const std::string &bundleKey, const NotificationConstant::SlotType &type, const int32_t &bundleUid) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); int32_t userId = -1; OsAccountManagerHelper::GetInstance().GetOsAccountLocalIdFromUid(bundleUid, userId); if (bundleKey.empty()) { @@ -849,7 +849,7 @@ bool NotificationPreferencesDatabase::RemoveSlotFromDisturbeDB( } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -877,9 +877,9 @@ bool NotificationPreferencesDatabase::RemoveSlotFromDisturbeDB( bool NotificationPreferencesDatabase::GetAllNotificationEnabledBundles( std::vector &bundleOption) { - ANS_LOGD("Called."); + ANS_LOGD("called"); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::unordered_map datas; @@ -897,9 +897,9 @@ bool NotificationPreferencesDatabase::GetAllNotificationEnabledBundles( bool NotificationPreferencesDatabase::GetAllDistribuedEnabledBundles(int32_t userId, const std::string &deviceType, std::vector &bundleOption) { - ANS_LOGD("Called."); + ANS_LOGD("called"); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::string key = std::string(KEY_ENABLE_BUNDLE_DISTRIBUTED_NOTIFICATION).append(KEY_MIDDLE_LINE); @@ -990,7 +990,7 @@ bool NotificationPreferencesDatabase::HandleDataBaseMap( bool NotificationPreferencesDatabase::RemoveAllSlotsFromDisturbeDB( const std::string &bundleKey, const int32_t &bundleUid) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); int32_t userId = -1; OsAccountManagerHelper::GetInstance().GetOsAccountLocalIdFromUid(bundleUid, userId); if (bundleKey.empty()) { @@ -999,7 +999,7 @@ bool NotificationPreferencesDatabase::RemoveAllSlotsFromDisturbeDB( } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -1048,7 +1048,7 @@ int32_t NotificationPreferencesDatabase::PutBundlePropertyToDisturbeDB( break; } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t userId = -1; @@ -1062,7 +1062,7 @@ bool NotificationPreferencesDatabase::PutBundleToDisturbeDB( const std::string &bundleKey, const NotificationPreferencesInfo::BundleInfo &bundleInfo) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t userId = -1; @@ -1091,7 +1091,7 @@ bool NotificationPreferencesDatabase::SlotToEntry(const std::string &bundleName, const sptr &slot, std::unordered_map &values) { if (slot == nullptr) { - ANS_LOGE("Notification slot is nullptr."); + ANS_LOGE("null slot"); return false; } @@ -1141,7 +1141,7 @@ void NotificationPreferencesDatabase::ParseBundleFromDistureDB(NotificationPrefe const std::unordered_map &values, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return; } for (auto item : values) { @@ -1183,7 +1183,7 @@ void NotificationPreferencesDatabase::ParseSlotFromDisturbeDB(NotificationPrefer if (!bundleInfo.GetSlot(slotType, slot)) { slot = new (std::nothrow) NotificationSlot(slotType); if (slot == nullptr) { - ANS_LOGE("Failed to create NotificationSlot instance"); + ANS_LOGE("null slot"); return; } } @@ -1607,7 +1607,7 @@ void NotificationPreferencesDatabase::GetDoNotDisturbType(NotificationPreference sptr disturbDate = new (std::nothrow) NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::NONE, 0, 0); if (disturbDate == nullptr) { - ANS_LOGE("Create NotificationDoNotDisturbDate instance fail."); + ANS_LOGE("null disturbDate"); return; } info.GetDoNotDisturbDate(userId, disturbDate); @@ -1636,7 +1636,7 @@ void NotificationPreferencesDatabase::GetDoNotDisturbBeginDate(NotificationPrefe sptr disturbDate = new (std::nothrow) NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::NONE, 0, 0); if (disturbDate == nullptr) { - ANS_LOGE("Failed to create NotificationDoNotDisturbDate instance"); + ANS_LOGE("null disturbDate"); return; } info.GetDoNotDisturbDate(userId, disturbDate); @@ -1664,7 +1664,7 @@ void NotificationPreferencesDatabase::GetDoNotDisturbEndDate(NotificationPrefere sptr disturbDate = new (std::nothrow) NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::NONE, 0, 0); if (disturbDate == nullptr) { - ANS_LOGE("Defeat to create NotificationDoNotDisturbDate instance"); + ANS_LOGE("null disturbDate"); return; } info.GetDoNotDisturbDate(userId, disturbDate); @@ -1709,7 +1709,7 @@ void NotificationPreferencesDatabase::GetEnableAllNotification(NotificationPrefe void NotificationPreferencesDatabase::GetDoNotDisturbProfile(NotificationPreferencesInfo &info, int32_t userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return; } std::unordered_map datas; @@ -1733,9 +1733,9 @@ void NotificationPreferencesDatabase::GetDoNotDisturbProfile(NotificationPrefere bool NotificationPreferencesDatabase::RemoveNotificationEnable(const int32_t userId) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -1753,9 +1753,9 @@ bool NotificationPreferencesDatabase::RemoveNotificationEnable(const int32_t use bool NotificationPreferencesDatabase::RemoveDoNotDisturbDate(const int32_t userId) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -1785,7 +1785,7 @@ bool NotificationPreferencesDatabase::RemoveDoNotDisturbDate(const int32_t userI bool NotificationPreferencesDatabase::RemoveAnsBundleDbInfo(std::string bundleName, int32_t uid) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -1805,7 +1805,7 @@ bool NotificationPreferencesDatabase::RemoveAnsBundleDbInfo(std::string bundleNa bool NotificationPreferencesDatabase::RemoveEnabledDbByBundleName(std::string bundleName, const int32_t &bundleUid) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t userId = -1; @@ -1843,7 +1843,7 @@ int32_t NotificationPreferencesDatabase::SetKvToDb( { HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_7, EventBranchId::BRANCH_2); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); message.Message("RdbStore is nullptr."); NotificationAnalyticsUtil::ReportModifyEvent(message); return NativeRdb::E_ERROR; @@ -1868,7 +1868,7 @@ int32_t NotificationPreferencesDatabase::SetByteToDb( if (!CheckRdbStore()) { message.Message("RdbStore is nullptr."); NotificationAnalyticsUtil::ReportModifyEvent(message); - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } int32_t result = rdbDataManager_->InsertData(key, value, userId); @@ -1886,7 +1886,7 @@ int32_t NotificationPreferencesDatabase::GetKvFromDb( const std::string &key, std::string &value, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } @@ -1906,7 +1906,7 @@ int32_t NotificationPreferencesDatabase::GetKvFromDb( const std::string &key, std::string &value, const int32_t &userId, int32_t &retCode) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } @@ -1919,7 +1919,7 @@ int32_t NotificationPreferencesDatabase::GetByteFromDb( const std::string &key, std::vector &value, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } @@ -1936,7 +1936,7 @@ int32_t NotificationPreferencesDatabase::GetBatchKvsFromDb( const std::string &key, std::unordered_map &values, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } @@ -1953,7 +1953,7 @@ int32_t NotificationPreferencesDatabase::GetBatchKvsFromDbContainsKey( const std::string &key, std::unordered_map &values, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } @@ -1969,7 +1969,7 @@ int32_t NotificationPreferencesDatabase::GetBatchKvsFromDbContainsKey( int32_t NotificationPreferencesDatabase::DeleteKvFromDb(const std::string &key, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return NativeRdb::E_ERROR; } @@ -1988,7 +1988,7 @@ int32_t NotificationPreferencesDatabase::DeleteBatchKvFromDb(const std::vector int32_t NotificationPreferencesDatabase::PutDataToDB(const std::string &key, const T &value, const int32_t &userId) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::string valueStr = std::to_string(value); @@ -2222,7 +2222,7 @@ bool NotificationPreferencesDatabase::GetDistributedEnabledForBundle(const std:: break; } }); - ANS_LOGD("GetDistributedEnabledForBundle:enabled:[%{public}d]KEY:%{public}s", enabled, key.c_str()); + ANS_LOGD("enabled:[%{public}d]KEY:%{public}s", enabled, key.c_str()); return result; } @@ -2349,7 +2349,7 @@ bool NotificationPreferencesDatabase::IsDistributedEnabledBySlot( std::string NotificationPreferencesDatabase::GetAdditionalConfig(const std::string &key) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return ""; } std::string configValue = ""; @@ -2364,7 +2364,7 @@ std::string NotificationPreferencesDatabase::GetAdditionalConfig(const std::stri bool NotificationPreferencesDatabase::CheckApiCompatibility(const std::string &bundleName, const int32_t &uid) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); std::shared_ptr bundleManager = BundleManagerHelper::GetInstance(); if (bundleManager == nullptr) { return false; @@ -2381,7 +2381,7 @@ bool NotificationPreferencesDatabase::UpdateBundlePropertyToDisturbeDB(int32_t u } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } std::string value; @@ -2419,7 +2419,7 @@ bool NotificationPreferencesDatabase::UpdateBundleSlotToDisturbeDB(int32_t userI GenerateSlotEntry(bundleKey, slot, values); } if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } int32_t result = rdbDataManager_->InsertBatchData(values, userId); @@ -2430,7 +2430,7 @@ bool NotificationPreferencesDatabase::DelCloneProfileInfo(const int32_t &userId, const sptr& info) { if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -2448,7 +2448,7 @@ bool NotificationPreferencesDatabase::DelBatchCloneProfileInfo(const int32_t &us { std::string cloneProfile = KEY_CLONE_LABEL + CLONE_PROFILE; if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -2530,7 +2530,7 @@ bool NotificationPreferencesDatabase::DelBatchCloneBundleInfo(const int32_t &use { std::string cloneBundle = KEY_CLONE_LABEL + CLONE_BUNDLE; if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -2569,7 +2569,7 @@ bool NotificationPreferencesDatabase::DelCloneBundleInfo(const int32_t &userId, std::string key = cloneBundle + cloneBundleInfo.GetBundleName() + std::to_string(cloneBundleInfo.GetAppIndex()); if (!CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -2585,7 +2585,7 @@ bool NotificationPreferencesDatabase::UpdateCloneToDisturbeDB(const int32_t &use const std::unordered_map values) { if (values.empty() || !CheckRdbStore()) { - ANS_LOGE("RdbStore is nullptr."); + ANS_LOGE("null RdbStore"); return false; } @@ -2596,7 +2596,7 @@ bool NotificationPreferencesDatabase::UpdateCloneToDisturbeDB(const int32_t &use bool NotificationPreferencesDatabase::SetDisableNotificationInfo(const sptr ¬ificationDisable) { if (notificationDisable == nullptr || !CheckRdbStore()) { - ANS_LOGE("notificationDisable or rdbStore is nullptr"); + ANS_LOGE("null notificationDisable or rdbStore"); return false; } if (notificationDisable->GetBundleList().empty()) { @@ -2611,13 +2611,13 @@ bool NotificationPreferencesDatabase::SetDisableNotificationInfo(const sptrQueryData(KEY_DISABLE_NOTIFICATION, value, ZERO_USER_ID); if (result != NativeRdb::E_OK) { - ANS_LOGE("query disable data fail"); + ANS_LOGE("query data failed"); return false; } notificationDisable.FromJson(value); @@ -2627,13 +2627,13 @@ bool NotificationPreferencesDatabase::GetDisableNotificationInfo(NotificationDis void NotificationPreferencesDatabase::GetDisableNotificationInfo(NotificationPreferencesInfo &info) { if (!CheckRdbStore()) { - ANS_LOGE("rdbStore is nullptr"); + ANS_LOGE("null rdbStore"); return; } std::string value; int32_t result = rdbDataManager_->QueryData(KEY_DISABLE_NOTIFICATION, value, ZERO_USER_ID); if (result != NativeRdb::E_OK) { - ANS_LOGE("query disable data failed"); + ANS_LOGE("query data failed"); return; } info.AddDisableNotificationInfo(value); @@ -2661,7 +2661,7 @@ bool NotificationPreferencesDatabase::IsDistributedEnabledEmptyForBundle( void NotificationPreferencesDatabase::GetSmartReminderEnableFromCCM(const std::string& deviceType, bool& enabled) { - ANS_LOGD("%{public}s", __FUNCTION__); + ANS_LOGD("called"); if (!isCachedSmartReminderEnableList_) { if (!DelayedSingleton::GetInstance()->GetSmartReminderEnableList( smartReminderEnableList_)) { @@ -2749,7 +2749,7 @@ bool NotificationPreferencesDatabase::SetHashCodeRule(const int32_t uid, const u ANS_LOGD("%{public}s, %{public}d,", __FUNCTION__, type); int32_t userId = SUBSCRIBE_USER_INIT; OHOS::AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(userId); - ANS_LOGI("SetHashCodeRule userId = %{public}d", userId); + ANS_LOGI("userId = %{public}d", userId); if (userId == SUBSCRIBE_USER_INIT) { ANS_LOGE("Current user acquisition failed"); return false; @@ -2808,7 +2808,7 @@ bool NotificationPreferencesDatabase::SetBundleRemoveFlag(const sptrIsDeviceTypeAffordConsume(deviceType, request, affordConsume); if (!affordConsume) { - ANS_LOGI("not afford consume, deviceType = %{public}s", deviceType.c_str()); + ANS_LOGI("deviceType = %{public}s", deviceType.c_str()); continue; } @@ -369,8 +369,8 @@ void SmartReminderCenter::InitValidDevices( for (auto it = smartDevices.begin(); it != smartDevices.end(); ++it) { smartDevicesStr = smartDevicesStr + *it + StringUtils::SPLIT_CHAR; } - ANS_LOGI("sync device list: %{public}s", syncDevicesStr.c_str()); - ANS_LOGI("smart device list: %{public}s", smartDevicesStr.c_str()); + ANS_LOGI("sync device: %{public}s", syncDevicesStr.c_str()); + ANS_LOGI("smart device: %{public}s", smartDevicesStr.c_str()); return; } @@ -712,8 +712,7 @@ void SmartReminderCenter::GetDeviceStatusByType( screenLocked = ScreenLock::ScreenLockManager::GetInstance()->IsScreenLocked(); bitStatus.set(DistributedDeviceStatus::LOCK_FLAG, !screenLocked); } - ANS_LOGI("GetDeviceStatusByType deviceType: %{public}s, bitStatus: %{public}s.", - deviceType.c_str(), bitStatus.to_string().c_str()); + ANS_LOGI("deviceType: %{public}s, bitStatus: %{public}s", deviceType.c_str(), bitStatus.to_string().c_str()); } } // namespace Notification } // namespace OHOS diff --git a/services/ans/src/notification_subscriber_manager.cpp b/services/ans/src/notification_subscriber_manager.cpp index 6a7a93c07f9aa7cd6a999c6bbbc0fcf3d00f4713..892ea21379de1d9c684f6e12d873b717c0f2bc88 100644 --- a/services/ans/src/notification_subscriber_manager.cpp +++ b/services/ans/src/notification_subscriber_manager.cpp @@ -56,7 +56,7 @@ const uint32_t FILTETYPE_QUICK_REPLY_IM = 2 << 0; NotificationSubscriberManager::NotificationSubscriberManager() { - ANS_LOGI("constructor"); + ANS_LOGD("called"); notificationSubQueue_ = std::make_shared("NotificationSubscriberMgr"); recipient_ = new (std::nothrow) RemoteDeathRecipient(std::bind(&NotificationSubscriberManager::OnRemoteDied, this, std::placeholders::_1)); @@ -67,7 +67,7 @@ NotificationSubscriberManager::NotificationSubscriberManager() NotificationSubscriberManager::~NotificationSubscriberManager() { - ANS_LOGI("deconstructor"); + ANS_LOGD("called"); subscriberRecordList_.clear(); } @@ -83,7 +83,7 @@ ErrCode NotificationSubscriberManager::AddSubscriber( { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (subscriber == nullptr) { - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return ERR_ANS_INVALID_PARAM; } @@ -91,7 +91,7 @@ ErrCode NotificationSubscriberManager::AddSubscriber( if (subInfo == nullptr) { subInfo = new (std::nothrow) NotificationSubscribeInfo(); if (subInfo == nullptr) { - ANS_LOGE("Failed to create NotificationSubscribeInfo ptr."); + ANS_LOGE("null subInfo"); return ERR_ANS_NO_MEMORY; } } @@ -113,7 +113,7 @@ ErrCode NotificationSubscriberManager::AddSubscriber( ErrCode result = ERR_ANS_TASK_ERR; if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return result; } @@ -146,13 +146,13 @@ ErrCode NotificationSubscriberManager::RemoveSubscriber( { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (subscriber == nullptr) { - ANS_LOGE("subscriber is null."); + ANS_LOGE("null subscriber"); return ERR_ANS_INVALID_PARAM; } ErrCode result = ERR_ANS_TASK_ERR; if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return result; } HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_9, EventBranchId::BRANCH_1); @@ -177,7 +177,7 @@ void NotificationSubscriberManager::NotifyConsumed( { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } AppExecFwk::EventHandler::Callback NotifyConsumedFunc = @@ -190,7 +190,7 @@ void NotificationSubscriberManager::NotifyApplicationInfoNeedChanged(const std:: { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (notificationSubQueue_ == nullptr || bundleName.empty()) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } AppExecFwk::EventHandler::Callback NotifyConsumedFunc = @@ -203,7 +203,7 @@ void NotificationSubscriberManager::NotifyApplicationInfoNeedChanged(const std:: void NotificationSubscriberManager::NotifyApplicationInfochangedInner(const std::string& bundleName) { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); - ANS_LOGI("NotifyApplicationInfochangedInner %{public}s", bundleName.c_str()); + ANS_LOGD("bundleName: %{public}s", bundleName.c_str()); for (auto record : subscriberRecordList_) { if (record->needNotifyApplicationChanged) { record->subscriber->OnApplicationInfoNeedChanged(bundleName); @@ -222,7 +222,7 @@ void NotificationSubscriberManager::BatchNotifyConsumed(const std::vector ¬ificationMap) { if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } AppExecFwk::EventHandler::Callback NotifyUpdatedFunc = @@ -286,7 +286,7 @@ void NotificationSubscriberManager::NotifyDoNotDisturbDateChanged(const int32_t const sptr &date) { if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } AppExecFwk::EventHandler::Callback func = @@ -300,7 +300,7 @@ void NotificationSubscriberManager::NotifyEnabledNotificationChanged( { NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } AppExecFwk::EventHandler::Callback func = @@ -313,7 +313,7 @@ void NotificationSubscriberManager::NotifyBadgeEnabledChanged(const sptr &object) { - ANS_LOGI("OnRemoteDied"); + ANS_LOGD("called"); if (notificationSubQueue_ == nullptr) { - ANS_LOGE("queue is nullptr"); + ANS_LOGE("null queue"); return; } ffrt::task_handle handler = notificationSubQueue_->submit_h(std::bind([this, object]() { @@ -433,7 +433,7 @@ ErrCode NotificationSubscriberManager::AddSubscriberInner( if (record == nullptr) { record = CreateSubscriberRecord(subscriber); if (record == nullptr) { - ANS_LOGE("CreateSubscriberRecord failed."); + ANS_LOGE("null record"); return ERR_ANS_NO_MEMORY; } subscriberRecordList_.push_back(record); @@ -441,7 +441,7 @@ ErrCode NotificationSubscriberManager::AddSubscriberInner( record->subscriber->AsObject()->AddDeathRecipient(recipient_); record->subscriber->OnConnected(); - ANS_LOGI("subscriber is connected."); + ANS_LOGD("subscriber connected"); } AddRecordInfo(record, subscribeInfo); @@ -466,7 +466,7 @@ ErrCode NotificationSubscriberManager::RemoveSubscriberInner( std::shared_ptr record = FindSubscriberRecord(subscriber); if (record == nullptr) { - ANS_LOGE("subscriber not found."); + ANS_LOGE("null record"); return ERR_ANS_INVALID_PARAM; } @@ -487,7 +487,7 @@ void NotificationSubscriberManager::NotifyConsumedInner( const sptr ¬ification, const sptr ¬ificationMap) { if (notification == nullptr) { - ANS_LOGE("[OnConsumed] fail: notification is nullptr."); + ANS_LOGE("null notification"); return; } NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); @@ -508,7 +508,7 @@ void NotificationSubscriberManager::NotifyConsumedInner( } sptr notificationStub = data.ReadParcelable(); if (notificationStub == nullptr) { - ANS_LOGE("ReadParcelable failed."); + ANS_LOGE("null notificationStub"); continue; } record->subscriber->OnConsumed(notificationStub, notificationMap); @@ -551,7 +551,7 @@ bool NotificationSubscriberManager::IsDeviceTypeSubscriberd(const std::string de return true; } } - ANS_LOGE("device not subscribe, device = %{public}s", deviceType.c_str()); + ANS_LOGE("device = %{public}s", deviceType.c_str()); return false; } @@ -566,7 +566,7 @@ ErrCode NotificationSubscriberManager::IsDeviceTypeAffordConsume( } sptr notification = new (std::nothrow) Notification(request); if (notification == nullptr) { - ANS_LOGE("Failed to create notification"); + ANS_LOGE("null notification"); return ERR_ANS_NO_MEMORY; } if (IsSubscribedBysubscriber(record, notification) && ConsumeRecordFilter(record, notification)) { @@ -623,7 +623,7 @@ void NotificationSubscriberManager::NotifyCanceledInner( const sptr ¬ification, const sptr ¬ificationMap, int32_t deleteReason) { if (notification == nullptr) { - ANS_LOGE("[OnCanceled] fail: notification is nullptr."); + ANS_LOGE("null notification"); return; } NOTIFICATION_HITRACE(HITRACE_TAG_NOTIFICATION); @@ -686,7 +686,7 @@ bool NotificationSubscriberManager::ConsumeRecordFilter( { NotificationRequest request = notification->GetNotificationRequest(); // filterType - ANS_LOGI("filterType = %{public}u", record->filterType); + ANS_LOGD("filterType = %{public}u", record->filterType); if (NotificationConstant::SlotType::SOCIAL_COMMUNICATION == request.GetSlotType()) { bool isQuickReply = request.HasUserInputButton(); if (isQuickReply && (record->filterType & FILTETYPE_QUICK_REPLY_IM) > 0) { @@ -769,7 +769,7 @@ void NotificationSubscriberManager::BatchNotifyCanceledInner(const std::vector ¬ificationMap) { if (notificationMap == nullptr) { - ANS_LOGE("[OnUpdated] fail: notificationMap is nullptr."); + ANS_LOGE("null notificationMap"); return; } for (auto record : subscriberRecordList_) { @@ -781,7 +781,7 @@ void NotificationSubscriberManager::NotifyDoNotDisturbDateChangedInner(const int const sptr &date) { if (date == nullptr) { - ANS_LOGE("[OnDoNotDisturbDateChange] fail: date is nullptr."); + ANS_LOGE("null date"); return; } for (auto record : subscriberRecordList_) { @@ -796,7 +796,7 @@ void NotificationSubscriberManager::NotifyBadgeEnabledChangedInner( const sptr &callbackData) { if (callbackData == nullptr) { - ANS_LOGE("[OnBadgeEnabledChanged] fail: callbackData is nullptr."); + ANS_LOGE("null callbackData"); return; } int32_t userId = SUBSCRIBE_USER_INIT; @@ -818,7 +818,7 @@ void NotificationSubscriberManager::NotifyEnabledNotificationChangedInner( const sptr &callbackData) { if (callbackData == nullptr) { - ANS_LOGE("[OnEnabledNotificationChanged] fail: callbackData is nullptr."); + ANS_LOGE("null callbackData"); return; } int32_t userId = SUBSCRIBE_USER_INIT; @@ -834,7 +834,7 @@ void NotificationSubscriberManager::NotifyEnabledNotificationChangedInner( void NotificationSubscriberManager::SetBadgeNumber(const sptr &badgeData) { if (notificationSubQueue_ == nullptr || badgeData == nullptr) { - ANS_LOGE("queue or badgeData is nullptr"); + ANS_LOGE("null queue or badgeData"); return; } std::function setBadgeNumberFunc = [this, badgeData] () { @@ -856,7 +856,7 @@ void NotificationSubscriberManager::RegisterOnSubscriberAddCallback( std::function &)> callback) { if (callback == nullptr) { - ANS_LOGE("Callback is nullptr"); + ANS_LOGE("null callback"); return; } @@ -878,17 +878,17 @@ void NotificationSubscriberManager::IsDeviceFlag(const std::shared_ptr ¬ification, bool &wearableFlag, bool &headsetFlag, bool &keyNodeFlag) { if (record == nullptr || notification == nullptr) { - ANS_LOGE("record or notification is nullptr."); + ANS_LOGE("null record or notification"); return; } sptr request = notification->GetNotificationRequestPoint(); if (request == nullptr) { - ANS_LOGE("request is nullptr."); + ANS_LOGE("null request"); return; } auto flagsMap = request->GetDeviceFlags(); if (flagsMap == nullptr || flagsMap->size() <= 0) { - ANS_LOGE("flagsMap is nullptr or flagsMap size <= 0."); + ANS_LOGE("null flagsMap or empty flagsMap"); return; } @@ -911,7 +911,7 @@ void NotificationSubscriberManager::IsDeviceFlag(const std::shared_ptrIsCommonLiveView()) { auto flags = request->GetFlags(); if (flags == nullptr) { - ANS_LOGE("flags is nullptr."); + ANS_LOGE("null flags"); return; } if (flags->IsVibrationEnabled() == NotificationConstant::FlagStatus::OPEN && @@ -925,12 +925,12 @@ void NotificationSubscriberManager::TrackCodeLog( const sptr ¬ification, const bool &wearableFlag, const bool &headsetFlag, const bool &keyNodeFlag) { if (notification == nullptr) { - ANS_LOGE("notification is empty."); + ANS_LOGE("null notification"); return; } sptr request = notification->GetNotificationRequestPoint(); if (request == nullptr) { - ANS_LOGE("request is nullptr."); + ANS_LOGE("null request"); return; } auto slotType = request->GetSlotType(); @@ -962,7 +962,7 @@ ErrCode NotificationSubscriberManager::DistributeOperation(const sptr &r } if (record->request->IsSystemLiveView()) { - ANS_LOGI("System live view no need check switch."); + ANS_LOGE("System live view no need check switch"); return ERR_OK; } diff --git a/services/ans/src/report_time_info.cpp b/services/ans/src/report_time_info.cpp index a427a76d846f464cf3304b605e8598f196e2b494..61b831fc085e552e945ce537489ca8fb51ebf0f9 100644 --- a/services/ans/src/report_time_info.cpp +++ b/services/ans/src/report_time_info.cpp @@ -19,7 +19,7 @@ namespace OHOS { namespace Notification { void ReportTimerInfo::OnTrigger() { - ANS_LOGI("ReportTimerInfo is arrived."); + ANS_LOGD("called"); auto callBack = GetCallBack(); if (callBack != nullptr) { IN_PROCESS_CALL_WITHOUT_RET(callBack()); diff --git a/services/distributed/src/distributed_database.cpp b/services/distributed/src/distributed_database.cpp index 7517df9fec295154c8723f99500a8323110d41fa..f62f3dc5e00497b7c7a3e539f7436e1af82c7f6f 100644 --- a/services/distributed/src/distributed_database.cpp +++ b/services/distributed/src/distributed_database.cpp @@ -61,7 +61,7 @@ void DistributedDatabase::GetKvDataManager() void DistributedDatabase::DeviceInitCallBack::OnRemoteDied() { - ANS_LOGW("DeviceInitCallBack OnRemoteDied"); + ANS_LOGD("called"); } bool DistributedDatabase::CheckKvDataManager() @@ -70,7 +70,7 @@ bool DistributedDatabase::CheckKvDataManager() GetKvDataManager(); } if (kvDataManager_ == nullptr) { - ANS_LOGE("kvDataManager_ is nullptr."); + ANS_LOGE("null kvDataManager"); return false; } return true; @@ -127,7 +127,7 @@ bool DistributedDatabase::CheckKvStore() GetKvStore(); } if (kvStore_ == nullptr) { - ANS_LOGE("kvStore is nullptr."); + ANS_LOGE("null kvStore"); return false; } return true; @@ -143,7 +143,7 @@ bool DistributedDatabase::PutToDistributedDB(const std::string &key, const std:: std::lock_guard lock(mutex_); if (kvStore_ == nullptr) { - ANS_LOGE("kvStore is null."); + ANS_LOGE("null kvStore"); return false; } @@ -168,7 +168,7 @@ bool DistributedDatabase::GetFromDistributedDB(const std::string &key, std::stri std::lock_guard lock(mutex_); if (kvStore_ == nullptr) { - ANS_LOGE("kvStore is nullptr."); + ANS_LOGE("null kvStore"); return false; } @@ -195,7 +195,7 @@ bool DistributedDatabase::GetEntriesFromDistributedDB(const std::string &prefixK std::lock_guard lock(mutex_); if (kvStore_ == nullptr) { - ANS_LOGE("kvStore_ is nullptr."); + ANS_LOGE("null kvStore"); return false; } @@ -219,7 +219,7 @@ bool DistributedDatabase::DeleteToDistributedDB(const std::string &key) std::lock_guard lock(mutex_); if (kvStore_ == nullptr) { - ANS_LOGE("kvStore is nullptr."); + ANS_LOGE("null kvStore"); return false; } @@ -243,7 +243,7 @@ bool DistributedDatabase::ClearDataByDevice(const std::string &deviceId) std::lock_guard lock(mutex_); if (kvStore_ == nullptr) { - ANS_LOGE("kvStore is nullptr."); + ANS_LOGE("null kvStore"); return false; } diff --git a/services/distributed/src/distributed_preferences.cpp b/services/distributed/src/distributed_preferences.cpp index b9a47328820957c836cb17f5ea34533167e0efed..9f34b40365b9c3fabd9f205914fe66e95a0c6c8e 100644 --- a/services/distributed/src/distributed_preferences.cpp +++ b/services/distributed/src/distributed_preferences.cpp @@ -139,7 +139,7 @@ bool DistributedPreferences::ResolveSyncWithoutAppEnable(const std::string &key, ErrCode DistributedPreferences::SetDistributedEnable(bool isEnable) { - ANS_LOGI("start"); + ANS_LOGD("called"); std::string key; GetDistributedMainKey(key); @@ -155,7 +155,7 @@ ErrCode DistributedPreferences::SetDistributedEnable(bool isEnable) ErrCode DistributedPreferences::GetDistributedEnable(bool &isEnable) { - ANS_LOGI("start"); + ANS_LOGD("called"); isEnable = preferencesInfo_->GetDistributedEnable(); @@ -165,9 +165,9 @@ ErrCode DistributedPreferences::GetDistributedEnable(bool &isEnable) ErrCode DistributedPreferences::SetDistributedBundleEnable( const sptr &bundleOption, bool isEnable) { - ANS_LOGI("start"); + ANS_LOGD("called"); if (bundleOption == nullptr) { - ANS_LOGE("bundleOption is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } @@ -188,12 +188,12 @@ ErrCode DistributedPreferences::GetDistributedBundleEnable( const sptr &bundleOption, bool &isEnable) { if (bundleOption == nullptr) { - ANS_LOGE("bundleOption is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } if (preferencesInfo_ == nullptr) { - ANS_LOGE("preferencesInfo is nullptr"); + ANS_LOGE("null preferencesInfo"); return ERR_ANS_DISTRIBUTED_OPERATION_FAILED; } @@ -205,12 +205,12 @@ ErrCode DistributedPreferences::GetDistributedBundleEnable( ErrCode DistributedPreferences::DeleteDistributedBundleInfo(const sptr &bundleOption) { if (bundleOption == nullptr) { - ANS_LOGE("bundleOption is nullptr."); + ANS_LOGE("null bundleOption"); return ERR_ANS_INVALID_PARAM; } if (database_ == nullptr || preferencesInfo_ == nullptr) { - ANS_LOGE("database or preferencesInfo is nullptr"); + ANS_LOGE("null database or preferencesInfo"); return ERR_ANS_DISTRIBUTED_OPERATION_FAILED; } @@ -230,7 +230,7 @@ ErrCode DistributedPreferences::DeleteDistributedBundleInfo(const sptr lock(mutex_); - ANS_LOGI("%{public}s, screenOn:%{public}s", __FUNCTION__, screenOn ? "true" : "false"); + ANS_LOGD("called, screenOn:%{public}s", screenOn ? "true" : "false"); localScreenOn_ = screenOn; if (kvStore_ == nullptr) { return ERR_ANS_DISTRIBUTED_OPERATION_FAILED; diff --git a/services/reminder/src/reminder_agent_service.cpp b/services/reminder/src/reminder_agent_service.cpp index 3f32fae0ba5329575e9ef9ace35b11f567cd977d..50ed97510667f596a8db975738a7d79443fbdc94 100644 --- a/services/reminder/src/reminder_agent_service.cpp +++ b/services/reminder/src/reminder_agent_service.cpp @@ -63,10 +63,10 @@ sptr ReminderAgentService::GetInstance() ErrCode ReminderAgentService::PublishReminder(const ReminderRequest& reminder, int32_t& reminderId) { NOTIFICATION_HITRACE(HITRACE_TAG_OHOS); - ANSR_LOGD("call."); + ANSR_LOGD("called"); sptr tarReminder = CreateReminderRequest(reminder); if (nullptr == tarReminder) { - ANSR_LOGE("Failed to create ReminderRequest."); + ANSR_LOGE("null tarReminder"); return ERR_REMINDER_INVALID_PARAM; } if (!CheckReminderPermission()) { @@ -107,10 +107,10 @@ ErrCode ReminderAgentService::PublishReminder(const ReminderRequest& reminder, i ErrCode ReminderAgentService::UpdateReminder(const int32_t reminderId, const ReminderRequest& reminder) { NOTIFICATION_HITRACE(HITRACE_TAG_OHOS); - ANSR_LOGD("call."); + ANSR_LOGD("called"); sptr tarReminder = CreateReminderRequest(reminder); if (nullptr == tarReminder) { - ANSR_LOGE("Failed to create ReminderRequest."); + ANSR_LOGE("null tarReminder"); return ERR_REMINDER_INVALID_PARAM; } if (!CheckReminderPermission()) { @@ -136,7 +136,7 @@ ErrCode ReminderAgentService::UpdateReminder(const int32_t reminderId, const Rem ErrCode ReminderAgentService::CancelReminder(const int32_t reminderId) { NOTIFICATION_HITRACE(HITRACE_TAG_OHOS); - ANSR_LOGD("call."); + ANSR_LOGD("called"); if (!CheckReminderPermission()) { ANSR_LOGE("Failed to check permission: ohos.permission.PUBLISH_AGENT_REMINDER."); return ERR_REMINDER_PERMISSION_DENIED; @@ -152,7 +152,7 @@ ErrCode ReminderAgentService::CancelReminder(const int32_t reminderId) ErrCode ReminderAgentService::CancelAllReminders() { NOTIFICATION_HITRACE(HITRACE_TAG_OHOS); - ANSR_LOGD("call."); + ANSR_LOGD("called"); if (!CheckReminderPermission()) { ANSR_LOGE("Failed to check permission: ohos.permission.PUBLISH_AGENT_REMINDER."); return ERR_REMINDER_PERMISSION_DENIED; @@ -172,7 +172,7 @@ ErrCode ReminderAgentService::CancelAllReminders() ErrCode ReminderAgentService::GetValidReminders(std::vector& reminders) { NOTIFICATION_HITRACE(HITRACE_TAG_OHOS); - ANSR_LOGD("call."); + ANSR_LOGD("called"); if (!CheckReminderPermission()) { ANSR_LOGE("Failed to check permission: ohos.permission.PUBLISH_AGENT_REMINDER."); return ERR_REMINDER_PERMISSION_DENIED; @@ -189,7 +189,7 @@ ErrCode ReminderAgentService::GetValidReminders(std::vector& dates) { NOTIFICATION_HITRACE(HITRACE_TAG_OHOS); - ANSR_LOGD("call."); + ANSR_LOGD("called"); if (!CheckReminderPermission()) { ANSR_LOGE("Failed to check permission: ohos.permission.PUBLISH_AGENT_REMINDER."); return ERR_REMINDER_PERMISSION_DENIED; @@ -258,11 +258,11 @@ void ReminderAgentService::TryUnloadService() tryUnloadTask_ = nullptr; return; } - ANSR_LOGD("call."); + ANSR_LOGD("called"); ChangeReminderAgentLoadConfig(REMINDER_AGENT_SERVICE_UNLOAD_STATE); auto samgrProxy = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgrProxy == nullptr) { - ANSR_LOGE("Failed to get samgr."); + ANSR_LOGE("null samgrProxy"); tryUnloadTask_ = nullptr; return; } @@ -315,7 +315,7 @@ ErrCode ReminderAgentService::InitReminderRequest(sptr& reminde const std::string& bundle, const int32_t callingUid) { if (reminder->GetWantAgentInfo() == nullptr || reminder->GetMaxScreenWantAgentInfo() == nullptr) { - ANSR_LOGE("WantAgentInfo is nullptr."); + ANSR_LOGE("null WantAgentInfo"); return ERR_REMINDER_INVALID_PARAM; } std::string wantAgentName = reminder->GetWantAgentInfo()->pkgName; diff --git a/services/reminder/src/reminder_config_change_observer.cpp b/services/reminder/src/reminder_config_change_observer.cpp index a19712fb0e0b2294cc6261f331f5374abd45c2c5..81b6257d7c0a30f80d12a63e36dae1489005a17b 100644 --- a/services/reminder/src/reminder_config_change_observer.cpp +++ b/services/reminder/src/reminder_config_change_observer.cpp @@ -23,10 +23,10 @@ namespace Notification { void ReminderConfigChangeObserver::OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) { - ANSR_LOGD("OnConfigurationUpdated."); + ANSR_LOGD("called"); auto reminderDataMgr = ReminderDataManager::GetInstance(); if (reminderDataMgr == nullptr) { - ANSR_LOGE("Reminder data manager is nullptr"); + ANSR_LOGE("null reminderDataMgr"); return; } std::string newLanguageInfo = configuration.GetItem(AAFwk::GlobalConfigurationKey::SYSTEM_LANGUAGE); diff --git a/services/reminder/src/reminder_data_manager.cpp b/services/reminder/src/reminder_data_manager.cpp index 744989d302d1a5d762729762e06f6b171eba9bcb..b7d644a886d53dbae306b925ad11d6252df6cad3 100644 --- a/services/reminder/src/reminder_data_manager.cpp +++ b/services/reminder/src/reminder_data_manager.cpp @@ -123,7 +123,7 @@ ErrCode ReminderDataManager::CancelReminder( ANSR_LOGI("cancel reminder id: %{public}d", reminderId); sptr reminder = FindReminderRequestLocked(reminderId, false); if (reminder == nullptr) { - ANSR_LOGW("Cancel reminder, not find the reminder in memory."); + ANSR_LOGW("null reminder"); return CancelReminderToDb(reminderId, callingUid); } if (!CheckIsSameApp(reminder, callingUid)) { @@ -163,7 +163,7 @@ sptr ReminderDataManager::CheckExcludeDateParam(const int32_t r { sptr reminder = FindReminderRequestLocked(reminderId, false); if (reminder == nullptr) { - ANSR_LOGW("Check reminder failed, not find the reminder"); + ANSR_LOGW("null reminder"); return nullptr; } if (!CheckIsSameApp(reminder, callingUid)) { @@ -283,7 +283,7 @@ void ReminderDataManager::CancelRemindersImplLocked(const std::string& packageNa } if (store_ == nullptr) { MUTEX.unlock(); - ANSR_LOGE("CancelRemindersImplLocked failed, store_ is null"); + ANSR_LOGE("null store"); return; } if (isCancelAllPackage) { @@ -429,7 +429,7 @@ void ReminderDataManager::OnUserSwitch(const int32_t& userId) void ReminderDataManager::OnProcessDiedLocked(const int32_t callingUid) { - ANSR_LOGD("OnProcessDiedLocked, uid=%{public}d", callingUid); + ANSR_LOGD("called, uid=%{public}d", callingUid); std::lock_guard locker(ReminderDataManager::MUTEX); std::lock_guard lock(ReminderDataManager::SHOW_MUTEX); for (auto it = showedReminderVector_.begin(); it != showedReminderVector_.end(); ++it) { @@ -540,7 +540,7 @@ void ReminderDataManager::CloseReminder(const OHOS::EventFwk::Want &want, bool c bool isShare = want.GetBoolParam(ReminderRequest::PARAM_REMINDER_SHARE, false); sptr reminder = FindReminderRequestLocked(reminderId, isShare); if (reminder == nullptr) { - ANSR_LOGW("Invalid reminder id: %{public}d", reminderId); + ANSR_LOGW("null reminder: %{public}d", reminderId); return; } std::string packageName = reminder->GetBundleName(); @@ -631,7 +631,7 @@ void ReminderDataManager::StartLoadTimer() { sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANSR_LOGE("Get timeServiceClient failed"); + ANSR_LOGE("null timer"); return; } std::lock_guard locker(timeLoadMutex_); @@ -645,7 +645,7 @@ void ReminderDataManager::StartLoadTimer() void ReminderDataManager::InitShareReminders(const bool registerObserver) { - ANSR_LOGD("Call."); + ANSR_LOGD("called"); ReminderDataShareHelper::GetInstance().SetUserId(currentUserId_); ReminderDataShareHelper::GetInstance().UpdateCalendarUid(); if (registerObserver) { @@ -690,7 +690,7 @@ bool ReminderDataManager::CheckUpdateConditions(const sptr &rem return false; } if (actionButtonMap.at(actionButtonType).dataShareUpdate == nullptr) { - ANSR_LOGI("dataShareUpdate is null"); + ANSR_LOGI("null dataShareUpdate"); return false; } if (actionButtonMap.at(actionButtonType).dataShareUpdate->uri == "" || @@ -724,7 +724,7 @@ void ReminderDataManager::UpdateAppDatabase(const sptr &reminde // create datashareHelper std::shared_ptr dataShareHelper = DataShare::DataShareHelper::Creator(uriStr, options); if (dataShareHelper == nullptr) { - ANSR_LOGE("create datashareHelper failed"); + ANSR_LOGE("null dataShareHelper"); return; } // gen uri equalTo valuesBucket @@ -870,7 +870,7 @@ void ReminderDataManager::TerminateAlerting(const OHOS::EventFwk::Want &want) bool isShare = want.GetBoolParam(ReminderRequest::PARAM_REMINDER_SHARE, false); sptr reminder = FindReminderRequestLocked(reminderId, isShare); if (reminder == nullptr) { - ANSR_LOGE("Invalid reminder id: %{public}d", reminderId); + ANSR_LOGE("null reminder: %{public}d", reminderId); return; } TerminateAlerting(reminder, "timeOut"); @@ -885,7 +885,7 @@ void ReminderDataManager::TerminateAlerting(const uint16_t waitInSecond, const s void ReminderDataManager::TerminateAlerting(const sptr &reminder, const std::string &reason) { if (reminder == nullptr) { - ANSR_LOGE("TerminateAlerting illegal."); + ANSR_LOGE("null reminder"); return; } ANSR_LOGI("Terminate the alerting reminder, %{public}s, called by %{public}s", @@ -976,7 +976,7 @@ void ReminderDataManager::ShowActiveReminder(const EventFwk::Want &want) } sptr reminder = FindReminderRequestLocked(reminderId, isShare); if (reminder == nullptr) { - ANSR_LOGW("Invalid reminder id: %{public}d", reminderId); + ANSR_LOGW("null reminder: %{public}d", reminderId); return; } if (HandleSysTimeChange(reminder)) { @@ -1047,7 +1047,7 @@ void ReminderDataManager::ShowActiveReminderExtendLocked(sptr& bool ReminderDataManager::StartExtensionAbility(const sptr &reminder, const int8_t type) { - ANSR_LOGD("StartExtensionAbility"); + ANSR_LOGD("called"); if (reminder->GetReminderType() == ReminderRequest::ReminderType::CALENDAR) { ReminderRequestCalendar* calendar = static_cast(reminder.GetRefPtr()); std::shared_ptr wantInfo = calendar->GetRRuleWantAgentInfo(); @@ -1059,7 +1059,7 @@ bool ReminderDataManager::StartExtensionAbility(const sptr &rem int32_t result = IN_PROCESS_CALL( AAFwk::AbilityManagerClient::GetInstance()->StartExtensionAbility(want, nullptr)); if (result != ERR_OK) { - ANSR_LOGE("StartExtensionAbility failed[%{public}d]", result); + ANSR_LOGE("failed[%{public}d]", result); return false; } } @@ -1127,7 +1127,7 @@ void ReminderDataManager::SnoozeReminder(const OHOS::EventFwk::Want &want) bool isShare = want.GetBoolParam(ReminderRequest::PARAM_REMINDER_SHARE, false); sptr reminder = FindReminderRequestLocked(reminderId, isShare); if (reminder == nullptr) { - ANSR_LOGW("Invalid reminder id: %{public}d", reminderId); + ANSR_LOGW("null reminder: %{public}d", reminderId); return; } SnoozeReminderImpl(reminder); @@ -1137,7 +1137,7 @@ void ReminderDataManager::SnoozeReminder(const OHOS::EventFwk::Want &want) void ReminderDataManager::SnoozeReminderImpl(sptr &reminder) { - ANSR_LOGI("Snooze the reminder request, %{public}s", reminder->Dump().c_str()); + ANSR_LOGD("Snooze the reminder request, %{public}s", reminder->Dump().c_str()); int32_t reminderId = reminder->GetReminderId(); if (activeReminderId_ == reminderId) { ANSR_LOGD("Cancel active reminder, id=%{public}d", activeReminderId_.load()); @@ -1171,7 +1171,7 @@ void ReminderDataManager::StartRecentReminder() std::lock_guard lock(ReminderDataManager::MUTEX); sptr reminder = GetRecentReminder(); if (reminder == nullptr) { - ANSR_LOGW("No reminder need to start"); + ANSR_LOGE("null reminder"); SetActiveReminder(reminder); return; } @@ -1197,7 +1197,7 @@ void ReminderDataManager::StartRecentReminder() void ReminderDataManager::StopAlertingReminder(const sptr &reminder) { if (reminder == nullptr) { - ANSR_LOGE("StopAlertingReminder illegal."); + ANSR_LOGE("null reminder"); return; } if ((alertingReminderId_ == -1) || (reminder->GetReminderId() != alertingReminderId_)) { @@ -1346,7 +1346,7 @@ void ReminderDataManager::HandleSameNotificationIdShowing(const sptrGetNotificationId(); bool isShare = reminder->IsShare(); - ANSR_LOGD("HandleSameNotificationIdShowing notificationId=%{public}d", notificationId); + ANSR_LOGD("called, notificationId=%{public}d", notificationId); int32_t curReminderId = reminder->GetReminderId(); for (auto it = reminderVector_.begin(); it != reminderVector_.end(); ++it) { @@ -1374,7 +1374,7 @@ void ReminderDataManager::HandleSameNotificationIdShowing(const sptr("ReminderDataManager"); if (queue_ == nullptr) { - ANSR_LOGE("create ffrt queue failed!"); + ANSR_LOGE("null queue"); return; } } @@ -1415,7 +1415,7 @@ void ReminderDataManager::Init() auto callback = []() { auto manager = ReminderDataManager::GetInstance(); if (manager == nullptr) { - ANSR_LOGE("ReminderDataManager is nullptr."); + ANSR_LOGE("null manager"); return; } manager->InitShareReminders(true); @@ -1426,14 +1426,14 @@ void ReminderDataManager::Init() void ReminderDataManager::InitServiceHandler() { - ANSR_LOGD("InitServiceHandler started"); + ANSR_LOGD("called"); if (serviceQueue_ != nullptr) { - ANSR_LOGD("InitServiceHandler already init."); + ANSR_LOGD("null serviceQueue"); return; } serviceQueue_ = std::make_shared("ReminderService"); - ANSR_LOGD("InitServiceHandler suceeded."); + ANSR_LOGD("suceeded"); } void ReminderDataManager::CheckReminderTime(std::vector>& immediatelyReminders, @@ -1630,7 +1630,7 @@ void ReminderDataManager::PlaySoundAndVibration(const sptr &rem if (soundPlayer_ == nullptr) { soundPlayer_ = Media::PlayerFactory::CreatePlayer(); if (soundPlayer_ == nullptr) { - ANSR_LOGE("Fail to creat player."); + ANSR_LOGE("null soundPlayer"); return; } } @@ -1656,7 +1656,7 @@ void ReminderDataManager::StopSoundAndVibrationLocked(const sptr &reminder) { if (reminder == nullptr) { - ANSR_LOGE("Stop sound and vibration failed as reminder is null."); + ANSR_LOGE("null reminder"); return; } if ((alertingReminderId_ == -1) || (reminder->GetReminderId() != alertingReminderId_)) { @@ -1667,7 +1667,7 @@ void ReminderDataManager::StopSoundAndVibration(const sptr &rem ANSR_LOGD("Stop sound and vibration, reminderId=%{public}d", reminder->GetReminderId()); #ifdef PLAYER_FRAMEWORK_ENABLE if (soundPlayer_ == nullptr) { - ANSR_LOGW("Sound player is null"); + ANSR_LOGW("null soundPlayer"); } else { std::string customRingUri = reminder->GetCustomRingUri(); if (customRingUri.empty()) { @@ -1751,7 +1751,7 @@ void ReminderDataManager::StartTimer(const sptr &reminderReques { sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANSR_LOGE("Failed to start timer due to get TimeServiceClient is null."); + ANSR_LOGE("null timer"); return; } time_t now; @@ -1825,7 +1825,7 @@ void ReminderDataManager::StopTimer(TimerType type) { sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANSR_LOGE("Failed to stop timer due to get TimeServiceClient is null."); + ANSR_LOGE("null timer"); return; } uint64_t timerId = 0; @@ -1879,7 +1879,7 @@ void ReminderDataManager::ResetStates(TimerType type) } sptr timer = MiscServices::TimeServiceClient::GetInstance(); if (timer == nullptr) { - ANSR_LOGE("Failed to destroy timer due to get TimeServiceClient is null."); + ANSR_LOGE("null timer"); return; } if (timerId != 0) { @@ -1893,7 +1893,7 @@ void ReminderDataManager::HandleCustomButtonClick(const OHOS::EventFwk::Want &wa bool isShare = want.GetBoolParam(ReminderRequest::PARAM_REMINDER_SHARE, false); sptr reminder = FindReminderRequestLocked(reminderId, isShare); if (reminder == nullptr) { - ANSR_LOGE("Invalid reminder id: %{public}d", reminderId); + ANSR_LOGE("null reminder: %{public}d", reminderId); return; } if (!reminder->IsSystemApp()) { @@ -1927,7 +1927,7 @@ void ReminderDataManager::ClickReminder(const OHOS::EventFwk::Want &want) ANSR_LOGI("click reminder[%{public}d] start", reminderId); sptr reminder = FindReminderRequestLocked(reminderId, isShare); if (reminder == nullptr) { - ANSR_LOGW("Invalid reminder id: %{public}d", reminderId); + ANSR_LOGW("null reminder: %{public}d", reminderId); return; } CloseReminder(reminder, false); @@ -1948,7 +1948,7 @@ void ReminderDataManager::ClickReminder(const OHOS::EventFwk::Want &want) auto client = AppExecFwk::AbilityManagerClient::GetInstance(); if (client == nullptr) { - ANSR_LOGE("start ability failed, due to ability mgr client is nullptr."); + ANSR_LOGE("null client"); return; } uint32_t specifyTokenId = static_cast(IPCSkeleton::GetSelfTokenID()); @@ -2017,7 +2017,7 @@ void ReminderDataManager::UpdateReminderLanguageLocked(const int32_t uid, void ReminderDataManager::OnLanguageChanged() { - ANSR_LOGI("System language config changed start."); + ANSR_LOGD("start"); std::unordered_map>> reminders; { std::lock_guard lock(ReminderDataManager::MUTEX); @@ -2044,7 +2044,7 @@ void ReminderDataManager::OnLanguageChanged() ShowReminder((*it), false, false, false, false, false); } ReminderDataShareHelper::GetInstance().StartDataExtension(ReminderCalendarShareTable::START_BY_LANGUAGE_CHANGE); - ANSR_LOGI("System language config changed end."); + ANSR_LOGD("end"); } void ReminderDataManager::OnRemoveAppMgr() @@ -2062,13 +2062,13 @@ bool ReminderDataManager::ConnectAppMgr() sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (systemAbilityManager == nullptr) { - ANSR_LOGE("get SystemAbilityManager failed"); + ANSR_LOGE("null systemAbilityManager"); return false; } sptr remoteObject = systemAbilityManager->GetSystemAbility(APP_MGR_SERVICE_ID); if (remoteObject == nullptr) { - ANSR_LOGE("get app manager service failed"); + ANSR_LOGE("null remoteObject"); return false; } diff --git a/services/reminder/src/reminder_data_manager_inner.cpp b/services/reminder/src/reminder_data_manager_inner.cpp index 13b0b96398c1079bd75951db2ea64a7285c44cdb..ef22c3521c491ffa78c97536b19d68845886c54b 100644 --- a/services/reminder/src/reminder_data_manager_inner.cpp +++ b/services/reminder/src/reminder_data_manager_inner.cpp @@ -117,7 +117,7 @@ bool ReminderDataManager::IsActionButtonDataShareValid(const sptr> showedReminder; { std::lock_guard lock(ReminderDataManager::SHOW_MUTEX); @@ -156,7 +156,7 @@ bool ReminderDataManager::GetCustomRingFileDesc(const sptr& rem std::lock_guard locker(resourceMutex_); soundResource_ = GetResourceMgr(reminder->GetBundleName(), reminder->GetUid()); if (soundResource_ == nullptr) { - ANSR_LOGE("GetResourceMgr fail."); + ANSR_LOGE("null soundResource"); return false; } auto result = soundResource_->GetRawFileDescriptor(reminder->GetCustomRingUri(), desc); @@ -171,14 +171,14 @@ void ReminderDataManager::CloseCustomRingFileDesc(const int32_t reminderId, cons { std::lock_guard locker(resourceMutex_); if (soundResource_ == nullptr) { - ANSR_LOGE("ResourceManager is nullptr."); + ANSR_LOGE("null soundResource"); return; } auto result = soundResource_->CloseRawFileDescriptor(customRingUri); if (result != Global::Resource::SUCCESS) { ANSR_LOGE("CloseRawFileDescriptor fail[%{public}d]", static_cast(result)); } - ANSR_LOGI("Stop custom sound, reminderId:[%{public}d].", reminderId); + ANSR_LOGI("reminderId:[%{public}d]", reminderId); soundResource_ = nullptr; } @@ -262,7 +262,7 @@ void ReminderDataManager::AsyncStartExtensionAbility(const sptr { auto manager = ReminderDataManager::GetInstance(); if (manager == nullptr) { - ANSR_LOGE("ReminderDataManager is nullptr."); + ANSR_LOGE("null manager"); return; } if (!manager->IsSystemReady()) { @@ -403,7 +403,7 @@ void ReminderDataManager::SetAlertingReminder(const sptr &remin ErrCode ReminderDataManager::CancelReminderToDb(const int32_t reminderId, const int32_t callingUid) { if (store_ == nullptr) { - ANSR_LOGE("Store is nullptr."); + ANSR_LOGE("null store"); return ERR_REMINDER_NOT_EXIST; } std::lock_guard lock(ReminderDataManager::MUTEX); diff --git a/services/reminder/src/reminder_datashare_helper.cpp b/services/reminder/src/reminder_datashare_helper.cpp index aa1452120977cfe9ea38c97565bb61281697ad69..d6a51beba79a00885a58f02e419cd8bb2292bd3e 100644 --- a/services/reminder/src/reminder_datashare_helper.cpp +++ b/services/reminder/src/reminder_datashare_helper.cpp @@ -75,7 +75,7 @@ bool ReminderDataShareHelper::RegisterObserver() } auto helper = CreateDataShareHelper(); if (helper == nullptr) { - ANSR_LOGE("Create datashare helper failed."); + ANSR_LOGE("null helper"); return false; } observer_ = std::make_shared(); @@ -93,7 +93,7 @@ bool ReminderDataShareHelper::UnRegisterObserver() } auto helper = CreateDataShareHelper(); if (helper == nullptr) { - ANSR_LOGE("Create datashare helper failed."); + ANSR_LOGE("null helper"); return false; } Uri uri(ReminderCalendarShareTable::PROXY); @@ -107,7 +107,7 @@ bool ReminderDataShareHelper::Query(std::map> { auto helper = CreateDataShareHelper(); if (helper == nullptr) { - ANSR_LOGE("Create datashare helper failed."); + ANSR_LOGE("null helper"); return false; } int64_t timestamp = GetCurrentTime(); @@ -155,7 +155,7 @@ bool ReminderDataShareHelper::Update(const int32_t reminderId, const int32_t sta { auto helper = CreateDataShareHelper(); if (helper == nullptr) { - ANSR_LOGE("Create datashare helper failed."); + ANSR_LOGE("null helper"); return false; } std::string proxy = ReminderCalendarShareTable::PROXY; @@ -195,7 +195,7 @@ void ReminderDataShareHelper::UpdateCalendarUid() for (const auto& metaData : moduleInfo.metadata) { if (metaData.name == "hmos.calendardata.reminderDbVersion") { isNewRdbVer_ = true; - ANSR_LOGI("New calendar rdb version."); + ANSR_LOGE("New calendar rdb version"); return; } } @@ -225,7 +225,7 @@ void ReminderDataShareHelper::OnDataInsertOrDelete() auto func = []() { auto manager = ReminderDataManager::GetInstance(); if (manager == nullptr) { - ANSR_LOGE("ReminderDataManager is nullptr."); + ANSR_LOGE("null manager"); return; } manager->OnDataShareInsertOrDelete(); @@ -251,7 +251,7 @@ void ReminderDataShareHelper::OnDataUpdate(const DataShare::DataShareObserver::C auto func = []() { auto manager = ReminderDataManager::GetInstance(); if (manager == nullptr) { - ANSR_LOGE("ReminderDataManager is nullptr."); + ANSR_LOGE("null manager"); return; } auto reminders = ReminderDataShareHelper::GetInstance().GetCacheReminders(); @@ -280,12 +280,12 @@ std::shared_ptr ReminderDataShareHelper::CreateDataS { sptr manager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (manager == nullptr) { - ANSR_LOGE("Get sa manager failed."); + ANSR_LOGE("null manager"); return nullptr; } sptr remoteObj = manager->GetSystemAbility(ADVANCED_NOTIFICATION_SERVICE_ABILITY_ID); if (remoteObj == nullptr) { - ANSR_LOGE("Get system ability failed."); + ANSR_LOGE("null remoteObj"); return nullptr; } @@ -304,7 +304,7 @@ std::shared_ptr ReminderDataShareHelper::CreateDataS bool ReminderDataShareHelper::ReleaseDataShareHelper(const std::shared_ptr& helper) { if (helper == nullptr) { - ANSR_LOGE("DataShareHelper is nullptr."); + ANSR_LOGE("null helper"); return false; } return helper->Release();