From e6c6472a70f48a7e5238dba44ab67644f6b61679 Mon Sep 17 00:00:00 2001 From: let_it_rot Date: Fri, 29 Aug 2025 14:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: let_it_rot --- frameworks/reminder/src/reminder_request.cpp | 78 ++++++++++++------- .../reminder_request_branch_test.cpp | 12 +-- .../test/unittest/reminder_request_test.cpp | 42 +++++++++- interfaces/inner_api/reminder_request.h | 11 ++- .../reminder/src/reminder_data_manager.cpp | 41 ++-------- .../src/reminder_data_manager_inner.cpp | 32 ++++++++ 6 files changed, 142 insertions(+), 74 deletions(-) diff --git a/frameworks/reminder/src/reminder_request.cpp b/frameworks/reminder/src/reminder_request.cpp index a23e305e0..ad348ddb3 100644 --- a/frameworks/reminder/src/reminder_request.cpp +++ b/frameworks/reminder/src/reminder_request.cpp @@ -28,6 +28,9 @@ #include "want_agent_helper.h" #include "nlohmann/json.hpp" #include "want_params_wrapper.h" +#include "bool_wrapper.h" +#include "string_wrapper.h" +#include "int_wrapper.h" namespace OHOS { namespace Notification { @@ -83,6 +86,8 @@ const uint8_t ReminderRequest::MONDAY = 1; const uint8_t ReminderRequest::SUNDAY = 7; const uint8_t ReminderRequest::HOURS_PER_DAY = 24; const uint16_t ReminderRequest::SECONDS_PER_HOUR = 3600; +static constexpr const char* WANT_EXTRA_START_BUNDLE = "startBundleName"; +static constexpr const char* WANT_EXTRA_START_INDEX = "startBundleAppIndex"; template void GetJsonValue(const nlohmann::json& root, const std::string& name, T& value) @@ -1102,7 +1107,8 @@ std::string ReminderRequest::GetMaxWantAgentStr() return maxWantAgentStr_; } -void ReminderRequest::UpdateNotificationRequest(NotificationRequest& notificationRequest, const bool isSnooze) +void ReminderRequest::UpdateNotificationRequest(NotificationRequest& notificationRequest, const bool isSnooze, + const int32_t index) { if (isSnooze) { UpdateNotificationStateForSnooze(notificationRequest); @@ -1112,16 +1118,16 @@ void ReminderRequest::UpdateNotificationRequest(NotificationRequest& notificatio } UpdateNotificationCommon(notificationRequest, isSnooze); UpdateNotificationAddRemovalWantAgent(notificationRequest); - UpdateNotificationWantAgent(notificationRequest); + UpdateNotificationWantAgent(notificationRequest, index); UpdateNotificationMaxScreenWantAgent(notificationRequest); UpdateNotificationBundleInfo(notificationRequest); } -void ReminderRequest::UpdateNotificationWantAgent(NotificationRequest& notificationRequest) +void ReminderRequest::UpdateNotificationWantAgent(NotificationRequest& notificationRequest, const int32_t index) { ANSR_LOGI("UpdateNotification want_agent"); AppExecFwk::ElementName element("", wantAgentInfo_->pkgName, wantAgentInfo_->abilityName); - std::shared_ptr wantAgent = CreateWantAgent(element); + std::shared_ptr wantAgent = CreateWantAgent(element, index); notificationRequest.SetWantAgent(wantAgent); if (wantAgentInfo_->parameters.HasParam(PARAM_EXTRA_KEY)) { std::shared_ptr extras = std::make_shared( @@ -1540,15 +1546,31 @@ std::string ReminderRequest::GetState(const uint8_t state) const return stateInfo; } -void ReminderRequest::AddActionButtons(NotificationRequest& notificationRequest, const bool includeSnooze) +std::shared_ptr ReminderRequest::CreateButtonWantAgent( + std::vector>& wants, + std::shared_ptr& extraInfo) const { int32_t requestCode = 10; std::vector flags; flags.push_back(AbilityRuntime::WantAgent::WantAgentConstant::Flags::UPDATE_PRESENT_FLAG); + AbilityRuntime::WantAgent::WantAgentInfo buttonWantAgentInfo( + requestCode, + AbilityRuntime::WantAgent::WantAgentConstant::OperationType::SEND_COMMON_EVENT, + flags, wants, extraInfo + ); + std::string identity = IPCSkeleton::ResetCallingIdentity(); + std::shared_ptr buttonWantAgent = + AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(buttonWantAgentInfo, userId_); + IPCSkeleton::SetCallingIdentity(identity); + return buttonWantAgent; +} + +void ReminderRequest::AddActionButtons(NotificationRequest& notificationRequest, const bool includeSnooze) +{ for (auto button : actionButtonMap_) { auto want = std::make_shared(); - auto type = button.first; - switch (type) { + std::shared_ptr extraInfo; + switch (button.first) { case ActionButtonType::CLOSE: want->SetAction(REMINDER_EVENT_CLOSE_ALERT); break; @@ -1565,30 +1587,29 @@ void ReminderRequest::AddActionButtons(NotificationRequest& notificationRequest, if (button.second.wantAgent == nullptr) { return; } - want->SetParam("PkgName", button.second.wantAgent->pkgName); - want->SetParam("AbilityName", button.second.wantAgent->abilityName); + extraInfo = std::make_shared(); + extraInfo->SetParam(WANT_EXTRA_START_BUNDLE, AAFwk::String::Box(button.second.wantAgent->pkgName)); + extraInfo->SetParam(WANT_EXTRA_START_INDEX, AAFwk::Integer::Box(0)); + extraInfo->SetParam("PkgName", AAFwk::String::Box(button.second.wantAgent->pkgName)); + extraInfo->SetParam("AbilityName", AAFwk::String::Box(button.second.wantAgent->abilityName)); break; default: break; } - want->SetParam(PARAM_REMINDER_ID, reminderId_); - want->SetParam(PARAM_REMINDER_SHARE, isShare_); + if (extraInfo == nullptr) { + want->SetParam(PARAM_REMINDER_ID, reminderId_); + want->SetParam(PARAM_REMINDER_SHARE, isShare_); + } else { + extraInfo->SetParam(PARAM_REMINDER_ID, AAFwk::Integer::Box(reminderId_)); + extraInfo->SetParam(PARAM_REMINDER_SHARE, AAFwk::Boolean::Box(isShare_)); + } std::vector> wants; wants.push_back(want); - auto title = static_cast(button.second.title); - AbilityRuntime::WantAgent::WantAgentInfo buttonWantAgentInfo( - requestCode, - AbilityRuntime::WantAgent::WantAgentConstant::OperationType::SEND_COMMON_EVENT, - flags, wants, nullptr - ); - - std::string identity = IPCSkeleton::ResetCallingIdentity(); - std::shared_ptr buttonWantAgent = - AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(buttonWantAgentInfo, userId_); - IPCSkeleton::SetCallingIdentity(identity); + std::shared_ptr wantAgent = CreateButtonWantAgent(wants, extraInfo); + auto title = static_cast(button.second.title); std::shared_ptr actionButton - = NotificationActionButton::Create(nullptr, title, buttonWantAgent); + = NotificationActionButton::Create(nullptr, title, wantAgent); notificationRequest.AddActionButton(actionButton); } } @@ -1622,23 +1643,26 @@ void ReminderRequest::UpdateNotificationAddRemovalWantAgent(NotificationRequest& } std::shared_ptr ReminderRequest::CreateWantAgent( - AppExecFwk::ElementName &element) const + AppExecFwk::ElementName &element, const int32_t index) const { int32_t requestCode = 10; std::vector wantFlags; wantFlags.push_back(AbilityRuntime::WantAgent::WantAgentConstant::Flags::UPDATE_PRESENT_FLAG); auto want = std::make_shared(); want->SetAction(REMINDER_EVENT_CLICK_ALERT); - want->SetParam(PARAM_REMINDER_ID, reminderId_); - want->SetParam(PARAM_REMINDER_SHARE, isShare_); std::vector> wantes; wantes.push_back(want); + std::shared_ptr extraInfo = std::make_shared(); + extraInfo->SetParam(WANT_EXTRA_START_BUNDLE, AAFwk::String::Box(bundleName_)); + extraInfo->SetParam(WANT_EXTRA_START_INDEX, AAFwk::Integer::Box(index)); + extraInfo->SetParam(PARAM_REMINDER_ID, AAFwk::Integer::Box(reminderId_)); + extraInfo->SetParam(PARAM_REMINDER_SHARE, AAFwk::Boolean::Box(isShare_)); AbilityRuntime::WantAgent::WantAgentInfo wantInfo( requestCode, AbilityRuntime::WantAgent::WantAgentConstant::OperationType::SEND_COMMON_EVENT, wantFlags, wantes, - nullptr + extraInfo ); std::string callingIdentity = IPCSkeleton::ResetCallingIdentity(); auto wantAgent = AbilityRuntime::WantAgent::WantAgentHelper::GetWantAgent(wantInfo, userId_); diff --git a/frameworks/reminder/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp b/frameworks/reminder/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp index 49bba2d56..99ac7c164 100644 --- a/frameworks/reminder/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp +++ b/frameworks/reminder/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp @@ -176,7 +176,7 @@ HWTEST_F(ReminderRequestBranchTest, UpdateNotificationRequest_00100, Function | int32_t notificationId_ = 0; NotificationRequest notificationRequest(reminderRequest->GetNotificationId()); bool isSnooze = true; - reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze); + reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze, 0); } /** @@ -193,7 +193,7 @@ HWTEST_F(ReminderRequestBranchTest, UpdateNotificationRequest_00200, Function | int32_t notificationId_ = 0; NotificationRequest notificationRequest(reminderRequest->GetNotificationId()); bool isSnooze = false; - reminderRequest->UpdateNotificationRequest(notificationRequest, false); + reminderRequest->UpdateNotificationRequest(notificationRequest, false, 0); } /** @@ -211,7 +211,7 @@ HWTEST_F(ReminderRequestBranchTest, UpdateNotificationRequest_00300, Function | NotificationRequest notificationRequest(reminderRequest->GetNotificationId()); reminderRequest->wantAgentInfo_ = std::make_shared(); bool isSnooze = true; - reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze); + reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze, 0); } /** @@ -229,7 +229,7 @@ HWTEST_F(ReminderRequestBranchTest, UpdateNotificationRequest_00400, Function | reminderRequest->maxScreenWantAgentInfo_ = std::make_shared(); NotificationRequest notificationRequest(reminderRequest->GetNotificationId()); bool isSnooze = true; - reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze); + reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze, 0); } /** @@ -246,7 +246,7 @@ HWTEST_F(ReminderRequestBranchTest, UpdateNotificationRequest_00500, Function | int32_t notificationId_ = 0; NotificationRequest notificationRequest(reminderRequest->GetNotificationId()); bool isSnooze = true; - reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze); + reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze, 0); } /** @@ -262,7 +262,7 @@ HWTEST_F(ReminderRequestBranchTest, UpdateNotificationRequest_00600, Function | EXPECT_NE(reminderRequest, nullptr); NotificationRequest notificationRequest(reminderRequest->GetNotificationId()); bool isSnooze = true; - reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze); + reminderRequest->UpdateNotificationRequest(notificationRequest, isSnooze, 0); } /** diff --git a/frameworks/reminder/test/unittest/reminder_request_test.cpp b/frameworks/reminder/test/unittest/reminder_request_test.cpp index 2c86c34f0..d3e0adfd0 100644 --- a/frameworks/reminder/test/unittest/reminder_request_test.cpp +++ b/frameworks/reminder/test/unittest/reminder_request_test.cpp @@ -1248,7 +1248,7 @@ HWTEST_F(ReminderRequestTest, CreateWantAgent_00002, Function | SmallTest | Leve std::shared_ptr reminderRequestChild = std::make_shared(); ASSERT_NE(nullptr, reminderRequestChild); std::shared_ptr WantAgent = - reminderRequestChild->CreateWantAgent(element); + reminderRequestChild->CreateWantAgent(element, 0); EXPECT_EQ(WantAgent, nullptr); } @@ -2385,7 +2385,7 @@ HWTEST_F(ReminderRequestTest, ReminderRequestTest_004, Function | SmallTest | Le ReminderRequestChild child; NotificationRequest request; child.wantAgentInfo_->parameters.SetParam("NotificationRequest_extraInfo", nullptr); - child.UpdateNotificationWantAgent(request); + child.UpdateNotificationWantAgent(request, 0); child.OnLanguageChange(nullptr); EXPECT_NE(request.GetAdditionalData(), nullptr); @@ -2472,5 +2472,43 @@ HWTEST_F(ReminderRequestTest, ReminderRequestTest_008, Function | SmallTest | Le child.MarshallingActionButton(p); EXPECT_EQ(child.actionButtonMap_.size(), 1); } + +/** + * @tc.name: ReminderRequestTest_009 + * @tc.desc: Test AddActionButtons parameters. + * @tc.type: FUNC + * @tc.require: issueI8CDH3 + */ +HWTEST_F(ReminderRequestTest, ReminderRequestTest_009, Function | SmallTest | Level1) +{ + NotificationRequest request(1); + ReminderRequestChild child; + child.SetActionButton("test1", ReminderRequest::ActionButtonType::CLOSE, "test1", + nullptr, nullptr); + child.AddActionButtons(request, false); + EXPECT_EQ(request.actionButtons_.size(), 1); + + child.SetActionButton("test2", ReminderRequest::ActionButtonType::SNOOZE, "test2", + nullptr, nullptr); + request.actionButtons_.clear(); + child.AddActionButtons(request, false); + EXPECT_EQ(request.actionButtons_.size(), 1); + request.actionButtons_.clear(); + child.AddActionButtons(request, true); + EXPECT_EQ(request.actionButtons_.size(), 2); + + child.SetActionButton("test3", ReminderRequest::ActionButtonType::CUSTOM, "test3", + nullptr, nullptr); + request.actionButtons_.clear(); + child.AddActionButtons(request, true); + EXPECT_EQ(request.actionButtons_.size(), 2); + auto wantAgent = std::make_shared(); + child.actionButtonMap_.erase(ReminderRequest::ActionButtonType::CUSTOM); + child.SetActionButton("test3", ReminderRequest::ActionButtonType::CUSTOM, "test3", + wantAgent, nullptr); + request.actionButtons_.clear(); + child.AddActionButtons(request, true); + EXPECT_EQ(request.actionButtons_.size(), 3); +} } } diff --git a/interfaces/inner_api/reminder_request.h b/interfaces/inner_api/reminder_request.h index 8ab25fc6d..beaf8d69e 100644 --- a/interfaces/inner_api/reminder_request.h +++ b/interfaces/inner_api/reminder_request.h @@ -952,7 +952,7 @@ public: * @param notificationRequest notification request object * @param isSnooze isSnooze */ - void UpdateNotificationRequest(NotificationRequest& notificationRequest, bool isSnooze); + void UpdateNotificationRequest(NotificationRequest& notificationRequest, bool isSnooze, const int32_t index); /** * @brief Get repeated days of the week. @@ -1107,9 +1107,12 @@ protected: uint64_t GetNowInstantMilli() const; private: - - std::shared_ptr CreateWantAgent(AppExecFwk::ElementName &element) const; + std::shared_ptr CreateWantAgent(AppExecFwk::ElementName &element, + const int32_t index) const; std::shared_ptr CreateMaxWantAgent(AppExecFwk::ElementName &element) const; + std::shared_ptr CreateButtonWantAgent( + std::vector>& wants, + std::shared_ptr& extraInfo) const; std::string GetShowTime(const uint64_t showTime) const; std::string GetTimeInfoInner(const time_t &timeInSecond, const TimeFormat &format, bool keep24Hour) const; std::string GetState(const uint8_t state) const; @@ -1126,7 +1129,7 @@ private: void UpdateNotificationContent(NotificationRequest& notificationRequest, const bool &setSnooze); void UpdateNotificationCommon(NotificationRequest& notificationRequest, bool isSnooze); void UpdateNotificationAddRemovalWantAgent(NotificationRequest& notificationRequest); - void UpdateNotificationWantAgent(NotificationRequest& notificationRequest); + void UpdateNotificationWantAgent(NotificationRequest& notificationRequest, const int32_t index); void UpdateNotificationMaxScreenWantAgent(NotificationRequest& notificationRequest); void UpdateNotificationBundleInfo(NotificationRequest& notificationRequest); diff --git a/services/reminder/src/reminder_data_manager.cpp b/services/reminder/src/reminder_data_manager.cpp index c68da5ef7..fe38e5eac 100644 --- a/services/reminder/src/reminder_data_manager.cpp +++ b/services/reminder/src/reminder_data_manager.cpp @@ -87,7 +87,6 @@ std::mutex ReminderDataManager::SHOW_MUTEX; std::mutex ReminderDataManager::ALERT_MUTEX; std::mutex ReminderDataManager::TIMER_MUTEX; std::mutex ReminderDataManager::ACTIVE_MUTEX; -constexpr int32_t CONNECT_EXTENSION_MAX_RETRY_TIMES = 3; std::shared_ptr ReminderDataManager::serviceQueue_ = nullptr; ReminderDataManager::ReminderDataManager() = default; ReminderDataManager::~ReminderDataManager() = default; @@ -902,7 +901,8 @@ void ReminderDataManager::TerminateAlerting(const sptr &reminde NotificationRequest notificationRequest(reminder->GetNotificationId()); notificationRequest.SetNotificationControlFlags(static_cast( NotificationNapi::NotificationControlFlagStatus::NOTIFICATION_STATUS_CLOSE_SOUND)); - reminder->UpdateNotificationRequest(notificationRequest, false); + int32_t appIndex = ReminderBundleManagerHelper::GetInstance().GetAppIndexByUid(uid); + reminder->UpdateNotificationRequest(notificationRequest, false, appIndex); IN_PROCESS_CALL_WITHOUT_RET(NotificationHelper::PublishNotification( ReminderRequest::NOTIFICATION_LABEL, notificationRequest)); store_->UpdateOrInsert(reminder); @@ -1046,28 +1046,6 @@ void ReminderDataManager::ShowActiveReminderExtendLocked(sptr& } } -bool ReminderDataManager::StartExtensionAbility(const sptr &reminder, const int8_t type) -{ - ANSR_LOGD("called"); - if (reminder->GetReminderType() == ReminderRequest::ReminderType::CALENDAR) { - ReminderRequestCalendar* calendar = static_cast(reminder.GetRefPtr()); - std::shared_ptr wantInfo = calendar->GetRRuleWantAgentInfo(); - if (wantInfo != nullptr && wantInfo->pkgName.size() != 0 && wantInfo->abilityName.size() != 0) { - AAFwk::Want want; - want.SetElementName(wantInfo->pkgName, wantInfo->abilityName); - want.SetParam(ReminderRequest::PARAM_REMINDER_ID, reminder->GetReminderId()); - want.SetParam("PULL_TYPE", type); - int32_t result = IN_PROCESS_CALL( - AAFwk::AbilityManagerClient::GetInstance()->StartExtensionAbility(want, nullptr)); - if (result != ERR_OK) { - ANSR_LOGE("failed[%{public}d]", result); - return false; - } - } - } - return true; -} - void ReminderDataManager::ShowReminder(const sptr& reminder, const bool isNeedToPlaySound, const bool isNeedToStartNext, const bool isSysTimeChanged, const bool needScheduleTimeout, const bool isNeedCloseDefaultSound) @@ -1087,7 +1065,8 @@ void ReminderDataManager::ShowReminder(const sptr& reminder, co reminder->OnShow(toPlaySound, isSysTimeChanged, true); AddToShowedReminders(reminder); NotificationRequest notificationRequest(reminder->GetNotificationId()); - reminder->UpdateNotificationRequest(notificationRequest, false); + int32_t appIndex = ReminderBundleManagerHelper::GetInstance().GetAppIndexByUid(reminder->GetUid()); + reminder->UpdateNotificationRequest(notificationRequest, false, appIndex); if (alertingReminderId_ != -1) { TerminateAlerting(alertingReminder_, "PlaySoundAndVibration"); } @@ -1161,7 +1140,8 @@ void ReminderDataManager::SnoozeReminderImpl(sptr &reminder) ANSR_LOGD("publish(update) notification.(reminderId=%{public}d)", reminder->GetReminderId()); NotificationRequest notificationRequest(reminder->GetNotificationId()); - reminder->UpdateNotificationRequest(notificationRequest, true); + int32_t appIndex = ReminderBundleManagerHelper::GetInstance().GetAppIndexByUid(reminder->GetUid()); + reminder->UpdateNotificationRequest(notificationRequest, true, appIndex); IN_PROCESS_CALL_WITHOUT_RET(NotificationHelper::PublishNotification( ReminderRequest::NOTIFICATION_LABEL, notificationRequest)); StartRecentReminder(); @@ -1315,15 +1295,6 @@ void ReminderDataManager::HandleImmediatelyShow( } } -void ReminderDataManager::HandleExtensionReminder(std::vector>& extensionReminders, - const int8_t type) -{ - int32_t count = 0; - for (auto& reminder : extensionReminders) { - ReminderDataManager::AsyncStartExtensionAbility(reminder, CONNECT_EXTENSION_MAX_RETRY_TIMES, type, count); - } -} - sptr ReminderDataManager::HandleRefreshReminder(const uint8_t &type, sptr &reminder) { reminder->SetReminderTimeInMilli(ReminderRequest::INVALID_LONG_LONG_VALUE); diff --git a/services/reminder/src/reminder_data_manager_inner.cpp b/services/reminder/src/reminder_data_manager_inner.cpp index 36f130e40..423e0ff59 100644 --- a/services/reminder/src/reminder_data_manager_inner.cpp +++ b/services/reminder/src/reminder_data_manager_inner.cpp @@ -65,6 +65,7 @@ static constexpr const char* USER_SETINGS_DATA_SECURE_URI = "datashare:///com.ohos.settingsdata/entry/settingsdata/USER_SETTINGSDATA_SECURE_"; static constexpr const char* FOCUS_MODE_ENABLE_URI = "?Proxy=true&key=focus_mode_enable"; static constexpr const char* FOCUS_MODE_ENABLE = "focus_mode_enable"; +static constexpr int32_t CONNECT_EXTENSION_MAX_RETRY_TIMES = 3; } static uint64_t GetRemainPartitionSize(const std::string& partitionName) @@ -516,5 +517,36 @@ int32_t ReminderDataManager::ConvertRingChannel(ReminderRequest::RingChannel cha return static_cast(AudioStandard::StreamUsage::STREAM_USAGE_ALARM); } } + +void ReminderDataManager::HandleExtensionReminder(std::vector>& extensionReminders, + const int8_t type) +{ + int32_t count = 0; + for (auto& reminder : extensionReminders) { + ReminderDataManager::AsyncStartExtensionAbility(reminder, CONNECT_EXTENSION_MAX_RETRY_TIMES, type, count); + } +} + +bool ReminderDataManager::StartExtensionAbility(const sptr &reminder, const int8_t type) +{ + ANSR_LOGD("called"); + if (reminder->GetReminderType() == ReminderRequest::ReminderType::CALENDAR) { + ReminderRequestCalendar* calendar = static_cast(reminder.GetRefPtr()); + std::shared_ptr wantInfo = calendar->GetRRuleWantAgentInfo(); + if (wantInfo != nullptr && wantInfo->pkgName.size() != 0 && wantInfo->abilityName.size() != 0) { + AAFwk::Want want; + want.SetElementName(wantInfo->pkgName, wantInfo->abilityName); + want.SetParam(ReminderRequest::PARAM_REMINDER_ID, reminder->GetReminderId()); + want.SetParam("PULL_TYPE", type); + int32_t result = IN_PROCESS_CALL( + AAFwk::AbilityManagerClient::GetInstance()->StartExtensionAbility(want, nullptr)); + if (result != ERR_OK) { + ANSR_LOGE("failed[%{public}d]", result); + return false; + } + } + } + return true; +} } } -- Gitee