From 45d8da1faf26d619b18629df4e0475734d3ffabf Mon Sep 17 00:00:00 2001 From: geng-wenguang Date: Thu, 17 Aug 2023 16:32:54 +0800 Subject: [PATCH 1/9] add image_framework_enable Signed-off-by: geng-wenguang --- dbms.gni | 7 +++++++ services/dbms/BUILD.gn | 8 ++++++-- services/dbms/src/distributed_bms.cpp | 6 ++++++ .../dbms/test/unittest/dbms_services_kit_test/BUILD.gn | 10 +++++++--- .../dbms_services_kit_test/dbms_services_kit_test.cpp | 6 ++++++ .../test/unittest/distributed_bms_host_test/BUILD.gn | 8 ++++++-- 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/dbms.gni b/dbms.gni index 0ea9825..5975576 100644 --- a/dbms.gni +++ b/dbms.gni @@ -28,6 +28,7 @@ declare_args() { account_enable_dbms = true distributed_bundle_framework_enable = true hisysevent_enable_dbms = true + image_framework_enable = false if (defined(global_parts_info) && !defined(global_parts_info.ability_ability_runtime)) { @@ -48,6 +49,11 @@ declare_args() { !defined(global_parts_info.hiviewdfx_hisysevent_native)) { hisysevent_enable_dbms = false } + + if (defined(global_parts_info) && + !defined(global_parts_info.multimedia_image_framework)) { + image_framework_enable = false + } } print("distributed_bundle_framework_graphics = " + @@ -57,3 +63,4 @@ print("account_enable_dbms = " + "$account_enable_dbms") print("distributed_bundle_framework_enable = " + "$distributed_bundle_framework_enable") print("hisysevent_enable_dbms = " + "$hisysevent_enable_dbms") +print("image_framework_enable = " + "$image_framework_enable") diff --git a/services/dbms/BUILD.gn b/services/dbms/BUILD.gn index d02e528..c408d19 100644 --- a/services/dbms/BUILD.gn +++ b/services/dbms/BUILD.gn @@ -31,7 +31,6 @@ ohos_shared_library("libdbms") { "src/distributed_bms.cpp", "src/distributed_bms_host.cpp", "src/distributed_data_storage.cpp", - "src/image_compress.cpp", ] defines = [ @@ -56,7 +55,6 @@ ohos_shared_library("libdbms") { "hicollie:libhicollie", "hilog:libhilog", "i18n:intl_util", - "image_framework:image_native", "init:libbegetutil", "ipc:ipc_core", "kv_store:distributeddata_inner", @@ -76,6 +74,12 @@ ohos_shared_library("libdbms") { defines += [ "ACCOUNT_ENABLE" ] } + if (image_framework_enable) { + sources += [ "src/image_compress.cpp" ] + external_deps += [ "image_framework:image_native" ] + defines += [ "IMAGE_FRAMEWORK" ] + } + shlib_type = "sa" part_name = "distributed_bundle_framework" subsystem_name = "bundlemanager" diff --git a/services/dbms/src/distributed_bms.cpp b/services/dbms/src/distributed_bms.cpp index 1c70f09..e357fc6 100644 --- a/services/dbms/src/distributed_bms.cpp +++ b/services/dbms/src/distributed_bms.cpp @@ -32,8 +32,10 @@ #include "locale_config.h" #include "locale_info.h" #include "image_compress.h" +#ifdef IMAGE_FRAMEWORK #include "image_packer.h" #include "image_source.h" +#endif #include "ipc_skeleton.h" #include "system_ability_definition.h" #include "tokenid_kit.h" @@ -353,6 +355,7 @@ int32_t DistributedBms::GetAbilityIconByContent( APP_LOGE("DistributedBms GetBundleMgr failed"); return ERR_APPEXECFWK_FAILED_SERVICE_DIED; } +#ifdef IMAGE_FRAMEWORK std::unique_ptr imageContent; size_t imageContentSize = 0; ErrCode ret = iBundleMgr->GetMediaData(abilityInfo.bundleName, abilityInfo.moduleName, abilityInfo.name, @@ -378,9 +381,11 @@ int32_t DistributedBms::GetAbilityIconByContent( } else { return Base64WithoutCompress(imageContent, imageContentSize, remoteAbilityInfo); } +#endif return OHOS::NO_ERROR; } +#ifdef IMAGE_FRAMEWORK int32_t DistributedBms::Base64WithoutCompress(std::unique_ptr &imageContent, size_t imageContentSize, RemoteAbilityInfo &remoteAbilityInfo) { @@ -395,6 +400,7 @@ int32_t DistributedBms::Base64WithoutCompress(std::unique_ptr &imageC } return OHOS::NO_ERROR; } +#endif int32_t DistributedBms::GetAbilityInfos( const std::vector &elementNames, std::vector &remoteAbilityInfos) diff --git a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn index 858e0d2..6efb5c6 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn +++ b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn @@ -30,7 +30,6 @@ ohos_unittest("DbmsServicesKitTest") { "${dbms_services_path}/src/distributed_bms.cpp", "${dbms_services_path}/src/distributed_bms_host.cpp", "${dbms_services_path}/src/distributed_data_storage.cpp", - "${dbms_services_path}/src/image_compress.cpp", ] sources += [ "dbms_services_kit_test.cpp" ] @@ -50,7 +49,6 @@ ohos_unittest("DbmsServicesKitTest") { "hicollie:libhicollie", "hilog:libhilog", "i18n:intl_util", - "image_framework:image_native", "init:libbegetutil", "ipc:ipc_core", "kv_store:distributeddata_inner", @@ -70,11 +68,17 @@ ohos_unittest("DbmsServicesKitTest") { external_deps += [ "os_account:os_account_innerkits" ] defines += [ "ACCOUNT_ENABLE" ] } + + if (image_framework_enable) { + sources += [ "${dbms_services_path}/src/image_compress.cpp" ] + external_deps += [ "image_framework:image_native" ] + defines += [ "IMAGE_FRAMEWORK" ] + } } group("unittest") { testonly = true - if (ability_runtime_enable_dbms) { + if (ability_runtime_enable_dbms && image_framework_enable) { deps = [ ":DbmsServicesKitTest" ] } } diff --git a/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp b/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp index 84ff533..18ddd51 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp +++ b/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp @@ -32,7 +32,9 @@ #include "distributed_module_info.h" #include "element_name.h" #include "event_report.h" +#ifdef IMAGE_FRAMEWORK #include "image_compress.h" +#endif #include "json_util.h" #include "service_control.h" @@ -631,6 +633,7 @@ HWTEST_F(DbmsServicesKitTest, DbmsServicesKitTest_0023, Function | SmallTest | L } } +#ifdef IMAGE_FRAMEWORK /** * @tc.number: DbmsServicesKitTest * @tc.name: test IsPathValid @@ -707,6 +710,7 @@ HWTEST_F(DbmsServicesKitTest, DbmsServicesKitTest_0034, Function | SmallTest | L EXPECT_EQ(res, false); } } +#endif #ifdef HISYSEVENT_ENABLE /** @@ -1015,6 +1019,7 @@ HWTEST_F(DbmsServicesKitTest, DbmsServicesKitTest_0052, Function | SmallTest | L } } +#ifdef IMAGE_FRAMEWORK /** * @tc.number: DbmsServicesKitTest_0053 * @tc.name: test IsPathValid @@ -1342,6 +1347,7 @@ HWTEST_F(DbmsServicesKitTest, DbmsServicesKitTest_0069, Function | SmallTest | L EXPECT_EQ(res, false); } } +#endif /** * @tc.number: DbmsServicesKitTest_0070 diff --git a/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn b/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn index 3ed71a9..534c1b7 100644 --- a/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn +++ b/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn @@ -49,7 +49,6 @@ ohos_unittest("DistributedBmsHostTest") { "hicollie:libhicollie", "hilog:libhilog", "i18n:intl_util", - "image_framework:image_native", "init:libbegetutil", "ipc:ipc_core", "kv_store:distributeddata_inner", @@ -69,11 +68,16 @@ ohos_unittest("DistributedBmsHostTest") { external_deps += [ "os_account:os_account_innerkits" ] defines += [ "ACCOUNT_ENABLE" ] } + + if (image_framework_enable) { + external_deps += [ "image_framework:image_native" ] + defines += [ "IMAGE_FRAMEWORK" ] + } } group("unittest") { testonly = true - if (ability_runtime_enable_dbms) { + if (ability_runtime_enable_dbms && image_framework_enable) { deps = [ ":DistributedBmsHostTest" ] } } -- Gitee From 849e6bfb654ef6e5b054f2bf84822aff2cdd3c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:49:25 +0000 Subject: [PATCH 2/9] update dbms.gni. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- dbms.gni | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms.gni b/dbms.gni index 5975576..c0676aa 100644 --- a/dbms.gni +++ b/dbms.gni @@ -28,7 +28,7 @@ declare_args() { account_enable_dbms = true distributed_bundle_framework_enable = true hisysevent_enable_dbms = true - image_framework_enable = false + distributed_bundle_image_framework_enable = false if (defined(global_parts_info) && !defined(global_parts_info.ability_ability_runtime)) { @@ -52,7 +52,7 @@ declare_args() { if (defined(global_parts_info) && !defined(global_parts_info.multimedia_image_framework)) { - image_framework_enable = false + distributed_bundle_image_framework_enable = false } } @@ -63,4 +63,4 @@ print("account_enable_dbms = " + "$account_enable_dbms") print("distributed_bundle_framework_enable = " + "$distributed_bundle_framework_enable") print("hisysevent_enable_dbms = " + "$hisysevent_enable_dbms") -print("image_framework_enable = " + "$image_framework_enable") +print("distributed_bundle_image_framework_enable = " + "$distributed_bundle_image_framework_enable") -- Gitee From aa162ff05071b63dc0a350cda5edabd5ae0209bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:50:44 +0000 Subject: [PATCH 3/9] update services/dbms/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- services/dbms/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/dbms/BUILD.gn b/services/dbms/BUILD.gn index c408d19..8778e66 100644 --- a/services/dbms/BUILD.gn +++ b/services/dbms/BUILD.gn @@ -74,10 +74,10 @@ ohos_shared_library("libdbms") { defines += [ "ACCOUNT_ENABLE" ] } - if (image_framework_enable) { + if (distributed_bundle_image_framework_enable) { sources += [ "src/image_compress.cpp" ] external_deps += [ "image_framework:image_native" ] - defines += [ "IMAGE_FRAMEWORK" ] + defines += [ "DISTRIBUTED_BUNDLE_IMAGE_ENABLE" ] } shlib_type = "sa" -- Gitee From 49ec923b3be61fb5f4654f2542a59c925de8f244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:51:53 +0000 Subject: [PATCH 4/9] update services/dbms/src/distributed_bms.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- services/dbms/src/distributed_bms.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/dbms/src/distributed_bms.cpp b/services/dbms/src/distributed_bms.cpp index e357fc6..58e67fd 100644 --- a/services/dbms/src/distributed_bms.cpp +++ b/services/dbms/src/distributed_bms.cpp @@ -32,7 +32,7 @@ #include "locale_config.h" #include "locale_info.h" #include "image_compress.h" -#ifdef IMAGE_FRAMEWORK +#ifdef DISTRIBUTED_BUNDLE_IMAGE_ENABLE #include "image_packer.h" #include "image_source.h" #endif @@ -355,7 +355,7 @@ int32_t DistributedBms::GetAbilityIconByContent( APP_LOGE("DistributedBms GetBundleMgr failed"); return ERR_APPEXECFWK_FAILED_SERVICE_DIED; } -#ifdef IMAGE_FRAMEWORK +#ifdef DISTRIBUTED_BUNDLE_IMAGE_ENABLE std::unique_ptr imageContent; size_t imageContentSize = 0; ErrCode ret = iBundleMgr->GetMediaData(abilityInfo.bundleName, abilityInfo.moduleName, abilityInfo.name, @@ -385,7 +385,7 @@ int32_t DistributedBms::GetAbilityIconByContent( return OHOS::NO_ERROR; } -#ifdef IMAGE_FRAMEWORK +#ifdef DISTRIBUTED_BUNDLE_IMAGE_ENABLE int32_t DistributedBms::Base64WithoutCompress(std::unique_ptr &imageContent, size_t imageContentSize, RemoteAbilityInfo &remoteAbilityInfo) { -- Gitee From dc0d47049370f35d6e1383ce0c81894218d5ea00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:52:48 +0000 Subject: [PATCH 5/9] update services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn index 6efb5c6..0a8869d 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn +++ b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn @@ -69,10 +69,10 @@ ohos_unittest("DbmsServicesKitTest") { defines += [ "ACCOUNT_ENABLE" ] } - if (image_framework_enable) { + if (distributed_bundle_image_framework_enable) { sources += [ "${dbms_services_path}/src/image_compress.cpp" ] external_deps += [ "image_framework:image_native" ] - defines += [ "IMAGE_FRAMEWORK" ] + defines += [ "DISTRIBUTED_BUNDLE_IMAGE_ENABLE" ] } } -- Gitee From 3c4bfba90926dd92ddd7aa177184008289fc0f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:53:46 +0000 Subject: [PATCH 6/9] update services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn index 0a8869d..b748ba6 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn +++ b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn @@ -78,7 +78,7 @@ ohos_unittest("DbmsServicesKitTest") { group("unittest") { testonly = true - if (ability_runtime_enable_dbms && image_framework_enable) { + if (ability_runtime_enable_dbms && distributed_bundle_image_framework_enable) { deps = [ ":DbmsServicesKitTest" ] } } -- Gitee From 61fe76adbae9fa2ab1f88e41d24da20bc06e38bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:54:27 +0000 Subject: [PATCH 7/9] update services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- .../dbms_services_kit_test/dbms_services_kit_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp b/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp index 18ddd51..434cc10 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp +++ b/services/dbms/test/unittest/dbms_services_kit_test/dbms_services_kit_test.cpp @@ -32,7 +32,7 @@ #include "distributed_module_info.h" #include "element_name.h" #include "event_report.h" -#ifdef IMAGE_FRAMEWORK +#ifdef DISTRIBUTED_BUNDLE_IMAGE_ENABLE #include "image_compress.h" #endif #include "json_util.h" @@ -633,7 +633,7 @@ HWTEST_F(DbmsServicesKitTest, DbmsServicesKitTest_0023, Function | SmallTest | L } } -#ifdef IMAGE_FRAMEWORK +#ifdef DISTRIBUTED_BUNDLE_IMAGE_ENABLE /** * @tc.number: DbmsServicesKitTest * @tc.name: test IsPathValid @@ -1019,7 +1019,7 @@ HWTEST_F(DbmsServicesKitTest, DbmsServicesKitTest_0052, Function | SmallTest | L } } -#ifdef IMAGE_FRAMEWORK +#ifdef DISTRIBUTED_BUNDLE_IMAGE_ENABLE /** * @tc.number: DbmsServicesKitTest_0053 * @tc.name: test IsPathValid -- Gitee From 39bd745c9a97cb8f73b360fc0a223153c8c73f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:55:11 +0000 Subject: [PATCH 8/9] update services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- .../dbms/test/unittest/distributed_bms_host_test/BUILD.gn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn b/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn index 534c1b7..d4c9d74 100644 --- a/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn +++ b/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn @@ -69,15 +69,15 @@ ohos_unittest("DistributedBmsHostTest") { defines += [ "ACCOUNT_ENABLE" ] } - if (image_framework_enable) { + if (distributed_bundle_image_framework_enable) { external_deps += [ "image_framework:image_native" ] - defines += [ "IMAGE_FRAMEWORK" ] + defines += [ "DISTRIBUTED_BUNDLE_IMAGE_ENABLE" ] } } group("unittest") { testonly = true - if (ability_runtime_enable_dbms && image_framework_enable) { + if (ability_runtime_enable_dbms && distributed_bundle_image_framework_enable) { deps = [ ":DistributedBmsHostTest" ] } } -- Gitee From a471efb9694b0be6cc4614a68aea0ac1fb1ec733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Fri, 18 Aug 2023 01:57:22 +0000 Subject: [PATCH 9/9] update dbms.gni. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- dbms.gni | 5 +++-- services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn | 3 ++- .../dbms/test/unittest/distributed_bms_host_test/BUILD.gn | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dbms.gni b/dbms.gni index c0676aa..7d03516 100644 --- a/dbms.gni +++ b/dbms.gni @@ -28,7 +28,7 @@ declare_args() { account_enable_dbms = true distributed_bundle_framework_enable = true hisysevent_enable_dbms = true - distributed_bundle_image_framework_enable = false + distributed_bundle_image_framework_enable = true if (defined(global_parts_info) && !defined(global_parts_info.ability_ability_runtime)) { @@ -63,4 +63,5 @@ print("account_enable_dbms = " + "$account_enable_dbms") print("distributed_bundle_framework_enable = " + "$distributed_bundle_framework_enable") print("hisysevent_enable_dbms = " + "$hisysevent_enable_dbms") -print("distributed_bundle_image_framework_enable = " + "$distributed_bundle_image_framework_enable") +print("distributed_bundle_image_framework_enable = " + + "$distributed_bundle_image_framework_enable") diff --git a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn index b748ba6..9329692 100644 --- a/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn +++ b/services/dbms/test/unittest/dbms_services_kit_test/BUILD.gn @@ -78,7 +78,8 @@ ohos_unittest("DbmsServicesKitTest") { group("unittest") { testonly = true - if (ability_runtime_enable_dbms && distributed_bundle_image_framework_enable) { + if (ability_runtime_enable_dbms && + distributed_bundle_image_framework_enable) { deps = [ ":DbmsServicesKitTest" ] } } diff --git a/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn b/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn index d4c9d74..c8b9729 100644 --- a/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn +++ b/services/dbms/test/unittest/distributed_bms_host_test/BUILD.gn @@ -77,7 +77,8 @@ ohos_unittest("DistributedBmsHostTest") { group("unittest") { testonly = true - if (ability_runtime_enable_dbms && distributed_bundle_image_framework_enable) { + if (ability_runtime_enable_dbms && + distributed_bundle_image_framework_enable) { deps = [ ":DistributedBmsHostTest" ] } } -- Gitee