From 674e6c3cab0f4d8cce38d1b7e540c5cac1caa875 Mon Sep 17 00:00:00 2001 From: wang19954 Date: Tue, 2 Sep 2025 14:33:43 +0800 Subject: [PATCH] IssueNo:#ICVWJ7 Description:fix bm dump bug Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- .../appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp | 9 +++------ .../appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp | 7 +++---- .../acts_bms_kit_system_test.cpp | 3 +++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp index ad58b7d28f..5589a03e1f 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp @@ -2044,12 +2044,9 @@ ErrCode BundleMgrHost::HandleDumpInfos(MessageParcel &data, MessageParcel &reply APP_LOGE("write failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } - if (ret) { - std::vector dumpInfos; - SplitString(result, dumpInfos); - if (!reply.WriteStringVector(dumpInfos)) { - return ERR_APPEXECFWK_PARCEL_ERROR; - } + if (ret && (WriteBigString(result, reply) != ERR_OK)) { + APP_LOGE("write big string failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; } return ERR_OK; } diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp index 91a8ce4182..a10245c348 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp @@ -2083,12 +2083,11 @@ bool BundleMgrProxy::DumpInfos( APP_LOGE("readParcelableInfo failed"); return false; } - std::vector dumpInfos; - if (!reply.ReadStringVector(&dumpInfos)) { - APP_LOGE("fail to dump from reply"); + auto ret = InnerGetBigString(reply, result); + if (ret != ERR_OK) { + APP_LOGE("fail to dump from reply err:%{public}d", ret); return false; } - result = std::accumulate(dumpInfos.begin(), dumpInfos.end(), result); return true; } diff --git a/test/systemtest/common/bms/acts_bms_kit_system_test/acts_bms_kit_system_test.cpp b/test/systemtest/common/bms/acts_bms_kit_system_test/acts_bms_kit_system_test.cpp index 8a235fabaf..9356baaa37 100644 --- a/test/systemtest/common/bms/acts_bms_kit_system_test/acts_bms_kit_system_test.cpp +++ b/test/systemtest/common/bms/acts_bms_kit_system_test/acts_bms_kit_system_test.cpp @@ -9072,6 +9072,9 @@ HWTEST_F(ActsBmsKitSystemTest, DumpInfos_0002, Function | SmallTest | Level1) auto ret = bundleMgrProxy->DumpInfos(DumpFlag::DUMP_BUNDLE_INFO, appName, wrongUser, result); EXPECT_FALSE(ret); + ret = bundleMgrProxy->DumpInfos(DumpFlag::DUMP_BUNDLE_INFO, "not_exist", USERID, result); + EXPECT_EQ(ret, false); + auto dumpLabelRes = bundleMgrProxy->DumpInfos(DumpFlag::DUMP_BUNDLE_LABEL, appName, wrongUser, result); EXPECT_FALSE(dumpLabelRes); -- Gitee