From 4cc14794bad3d5e61e25db6a72a7adfc0632bafb Mon Sep 17 00:00:00 2001 From: MisterE Date: Tue, 19 Nov 2024 12:00:58 +0800 Subject: [PATCH 1/3] cherrypick Signed-off-by: MisterE Signed-off-by: MisterE --- .../src/mission/dms_continue_recv_manager.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp b/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp index 70b4687a..5c4db5c5 100644 --- a/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp +++ b/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp @@ -575,16 +575,18 @@ void DMSContinueRecvMgr::NotifyDeviceOffline(const std::string& networkId) HILOGI("NotifyDeviceOffline end"); } -void DMSContinueRecvMgr::NotifyPackageRemove(const std::string& sinkBundleName) +void DMSContinueRecvMgr::NotifyPackageRemoved(const std::string& sinkBundleName) { if (sinkBundleName.empty()) { - HILOGE("NotifyPackageRemove sinkBundleName empty"); + HILOGE("NotifyPackageRemoved sinkBundleName empty"); return; } - if(iconInfo_.bundleName != sinkBundleName) { + if (iconInfo_.bundleName != sinkBundleName) { + HILOGI("NotifyPackageRemoved current sinkBundleName: %{public}s; removed package: %{public}s.", + iconInfo_.bundleName.c_str(), sinkBundleName.c_str()); return; } - HILOGI("NotifyPackageRemove begin. sinkBundleName: %{public}s.", sinkBundleName.c_str()); + HILOGI("NotifyPackageRemoved begin. sinkBundleName: %{public}s.", sinkBundleName.c_str()); std::string senderNetworkId; std::string bundleName; std::string continueType; @@ -612,7 +614,7 @@ void DMSContinueRecvMgr::NotifyPackageRemove(const std::string& sinkBundleName) INACTIVE); } } - HILOGI("NotifyPackageRemove end"); + HILOGI("NotifyPackageRemoved end"); } std::string DMSContinueRecvMgr::GetContinueType(const std::string& bundleName) From fc1dd6e0c16d064d8272500f0bba60073b6561d9 Mon Sep 17 00:00:00 2001 From: MisterE Date: Tue, 19 Nov 2024 12:04:33 +0800 Subject: [PATCH 2/3] cherrypick Signed-off-by: MisterE Signed-off-by: MisterE --- .../dtbschedmgr/include/mission/dms_continue_recv_manager.h | 2 +- services/dtbschedmgr/src/common_event_listener.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h b/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h index f2eced0a..3a76ba08 100644 --- a/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h +++ b/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h @@ -84,7 +84,7 @@ public: int32_t RegisterOffListener(const std::string& type, const sptr& obj); void NotifyDied(const sptr& obj); void NotifyDeviceOffline(const std::string& networkId); - void NotifyPackageRemove(const std::string& sinkBundleName); + void NotifyPackageRemoved(const std::string& sinkBundleName); void OnDeviceScreenOff(); void OnContinueSwitchOff(); std::string GetContinueType(const std::string& bundleName); diff --git a/services/dtbschedmgr/src/common_event_listener.cpp b/services/dtbschedmgr/src/common_event_listener.cpp index 749e3223..c8344a6a 100644 --- a/services/dtbschedmgr/src/common_event_listener.cpp +++ b/services/dtbschedmgr/src/common_event_listener.cpp @@ -83,7 +83,7 @@ void CommonEventListener::OnReceiveEvent(const EventFwk::CommonEventData &eventD case PACKAGE_REMOVED : HILOGI("PACKAGE_REMOVED: %{public}s", want.GetElement().GetBundleName().c_str()); DmsBmStorage::GetInstance()->DeleteStorageDistributeInfo(want.GetElement().GetBundleName()); - DMSContinueRecvMgr::GetInstance().NotifyPackageRemove(want.GetElement().GetBundleName()); + DMSContinueRecvMgr::GetInstance().NotifyPackageRemoved(want.GetElement().GetBundleName()); break; default: HILOGW("OnReceiveEvent undefined action"); From e86321c6a4bf62269ce4bcb5601405a1d0687468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9A=87=E7=94=AB=E6=AF=85?= Date: Tue, 19 Nov 2024 04:05:47 +0000 Subject: [PATCH 3/3] update services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 皇甫毅 --- .../test/unittest/mission/dms_continue_manager_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp b/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp index 9d71ccf9..2634b779 100644 --- a/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp +++ b/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp @@ -870,7 +870,7 @@ HWTEST_F(DMSContinueManagerTest, testSetScreenOffInfo_001, TestSize.Level1) DMSContinueSendMgr::GetInstance().screenOffHandler_->SetScreenOffInfo(missionId, bundleName, bundleNameId, abilityName); EXPECT_EQ(DMSContinueSendMgr::GetInstance().screenOffHandler_->unfoInfo_.abilityName.empty(), false); - + DMSContinueSendMgr::GetInstance().screenOffHandler_->ClearScreenOffInfo(); EXPECT_EQ(DMSContinueSendMgr::GetInstance().screenOffHandler_->unfoInfo_.abilityName.empty(), true); DTEST_LOG << "DMSContinueManagerTest testSetScreenOffInfo_001 end" << std::endl;