diff --git a/frameworks/ans/src/notification_request.cpp b/frameworks/ans/src/notification_request.cpp index 5dff5384a701b2d4a07badb040ae62cccb3c84c4..c046ff2af3dd4d8668b30a3084dce765c4429616 100644 --- a/frameworks/ans/src/notification_request.cpp +++ b/frameworks/ans/src/notification_request.cpp @@ -545,16 +545,6 @@ std::vector NotificationRequest::GetNotificationUserInputHistory() return userInputHistory_; } -void NotificationRequest::SetPublicNotification(const std::shared_ptr &other) -{ - publicNotification_ = other; -} - -const std::shared_ptr NotificationRequest::GetPublicNotification() const -{ - return publicNotification_; -} - std::string NotificationRequest::GetNotificationHashCode() const { if (creatorBundleName_.empty() || (creatorUid_ == 0) || ownerBundleName_.empty()) { @@ -706,7 +696,6 @@ std::string NotificationRequest::Dump() ", littleIcon = " + (littleIcon_ ? "not null" : "null") + ", bigIcon = " + (bigIcon_ ? "not null" : "null") + ", notificationContent = " + (notificationContent_ ? notificationContent_->Dump() : "null") + - ", publicNotification = " + (publicNotification_ ? "not null" : "null") + ", notificationTemplate = " + (notificationTemplate_ ? "not null" : "null") + ", actionButtons = " + (!actionButtons_.empty() ? actionButtons_.at(0)->Dump() : "empty") + ", messageUsers = " + (!messageUsers_.empty() ? messageUsers_.at(0)->Dump() : "empty") + @@ -1140,19 +1129,6 @@ bool NotificationRequest::Marshalling(Parcel &parcel) const } } - valid = publicNotification_ ? true : false; - if (!parcel.WriteBool(valid)) { - ANS_LOGE("Failed to write the flag which indicate whether publicNotification is null"); - return false; - } - - if (valid) { - if (!parcel.WriteParcelable(publicNotification_.get())) { - ANS_LOGE("Failed to write publicNotification"); - return false; - } - } - // write std::vector if (!parcel.WriteUint64(actionButtons_.size())) { ANS_LOGE("Failed to write the size of actionButtons"); @@ -1380,15 +1356,6 @@ bool NotificationRequest::ReadFromParcel(Parcel &parcel) } } - valid = parcel.ReadBool(); - if (valid) { - publicNotification_ = std::shared_ptr(parcel.ReadParcelable()); - if (!publicNotification_) { - ANS_LOGE("Failed to read publicNotification"); - return false; - } - } - auto vsize = parcel.ReadUint64(); for (uint64_t it = 0; it < vsize; ++it) { auto member = parcel.ReadParcelable(); @@ -1542,7 +1509,6 @@ void NotificationRequest::CopyOther(const NotificationRequest &other) this->littleIcon_ = other.littleIcon_; this->bigIcon_ = other.bigIcon_; this->notificationContent_ = other.notificationContent_; - this->publicNotification_ = other.publicNotification_; this->actionButtons_ = other.actionButtons_; this->messageUsers_ = other.messageUsers_; diff --git a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp index 22de02b1b9f0035a49b65645b872d0bebd488901..58531df1aaba277a426d5e3c8717d57eae4ebc5e 100644 --- a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp +++ b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp @@ -179,10 +179,6 @@ private: EXPECT_EQ("bundleName", notificationRequest.GetOwnerBundleName()); EXPECT_EQ("bundleName", notificationRequest.GetCreatorBundleName()); EXPECT_EQ("ANS_Interface_MT_Publish_00100", notificationRequest.GetLabel()); - std::shared_ptr NotificationRequestPtr = notificationRequest.GetPublicNotification(); - if (NotificationRequestPtr != nullptr) { - EXPECT_EQ("ANS_Interface_MT_Publish_00100_REQUEST", NotificationRequestPtr->GetLabel()); - } // pixelmap auto littleIcon = notificationRequest.GetLittleIcon(); @@ -582,10 +578,6 @@ HWTEST_F(AnsInnerKitsModulePublishTest, ANS_Interface_MT_Publish_00100, Function req.SetOwnerBundleName("bundleName"); req.SetCreatorBundleName("creatorbundlename"); req.SetLabel("ANS_Interface_MT_Publish_00100"); - std::shared_ptr requestPtr = std::make_shared(); - EXPECT_NE(requestPtr, nullptr); - requestPtr->SetLabel("ANS_Interface_MT_Publish_00100_REQUEST"); - req.SetPublicNotification(requestPtr); // pixelmap auto pixelMap = std::make_shared(); diff --git a/interfaces/inner_api/notification_request.h b/interfaces/inner_api/notification_request.h index 502de66a9d577591f7b479b93ef314340fa6d23f..0124bda67858d8dc3d9bed5c5be1b215c4c91fd8 100644 --- a/interfaces/inner_api/notification_request.h +++ b/interfaces/inner_api/notification_request.h @@ -832,22 +832,6 @@ public: */ std::vector GetNotificationUserInputHistory() const; - /** - * @brief Sets an alternative notification to be displayed on the lock screen for this notification. - * The display effect (whether and how this alternative notification will be displayed) is subject to - * the configuration in NotificationSlot::setLockscreenVisibleness(int). - * - * @param other Indicates the alternative notification to be displayed on the lock screen. - */ - void SetPublicNotification(const std::shared_ptr &other); - - /** - * @brief Obtains the alternative notification to be displayed on the lock screen for this notification. - * - * @return Returns the alternative notification to be displayed on the lock screen for this notification. - */ - const std::shared_ptr GetPublicNotification() const; - /** * @brief Obtains the unique hash code of a notification in the current application. * To obtain a valid hash code, you must have subscribed to and received the notification. @@ -1188,7 +1172,6 @@ private: std::shared_ptr littleIcon_ {}; std::shared_ptr bigIcon_ {}; std::shared_ptr notificationContent_ {}; - std::shared_ptr publicNotification_ {}; std::vector> actionButtons_ {}; std::vector> messageUsers_ {}; diff --git a/test/fuzztest/settemplate_fuzzer/settemplate_fuzzer.cpp b/test/fuzztest/settemplate_fuzzer/settemplate_fuzzer.cpp index d280ccb2f69e0839e44a93b60c820976d417b832..229807ebd8f20bd7f213c1897a656b665358e50b 100644 --- a/test/fuzztest/settemplate_fuzzer/settemplate_fuzzer.cpp +++ b/test/fuzztest/settemplate_fuzzer/settemplate_fuzzer.cpp @@ -50,9 +50,6 @@ namespace OHOS { text.emplace_back(stringData); request.SetNotificationUserInputHistory(text); request.GetNotificationUserInputHistory(); - std::shared_ptr other = nullptr; - request.SetPublicNotification(other); - request.GetPublicNotification(); request.GetNotificationHashCode(); request.GetOwnerBundleName(); request.GetCreatorBundleName();