From 1b9d5d9e8311bb9b6cb668baa48377b73593abe1 Mon Sep 17 00:00:00 2001 From: "hqliuzhenghong@h-partners.com" Date: Wed, 30 Oct 2024 09:16:18 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90bundlemanager=5Fbundle=5Fframework?= =?UTF-8?q?=E3=80=91=E7=A9=BF=E6=88=B4=E8=AE=BE=E5=A4=87=E5=AE=9A=E5=88=B6?= =?UTF-8?q?=E5=B0=BA=E5=AF=B82*3=20=EF=BC=8C3*3=E5=8D=A1=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E8=BF=87=E6=BB=A4=E9=9D=9E=E7=A9=BF=E6=88=B4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BD=BF=E7=94=A8=E6=AD=A4=E5=AE=9A=E5=88=B6=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hqliuzhenghong@h-partners.com --- appexecfwk.gni | 2 ++ bundle.json | 4 ++- interfaces/inner_api/appexecfwk_base/BUILD.gn | 7 +++++ .../src/extension_form_profile.cpp | 30 +++++++++++++++++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/appexecfwk.gni b/appexecfwk.gni index 6db4981e5..ef688b617 100644 --- a/appexecfwk.gni +++ b/appexecfwk.gni @@ -50,6 +50,8 @@ declare_args() { distributed_bundle_framework = true bundle_framework_overlay_install = true bundle_framework_bundle_resource = true + bundle_framework_form_dimension_2_3 = false + bundle_framework_form_dimension_3_3 = false ability_runtime_enable = true account_enable = true diff --git a/bundle.json b/bundle.json index 6482077ad..2e46d9d15 100644 --- a/bundle.json +++ b/bundle.json @@ -26,7 +26,9 @@ "bundle_framework_default_app", "bundle_framework_launcher", "bundle_framework_sandbox_app", - "bundle_framework_quick_fix" + "bundle_framework_quick_fix", + "bundle_framework_form_dimension_2_3", + "bundle_framework_form_dimension_3_3" ], "hisysevent_config": [ "//foundation/bundlemanager/bundle_framework/hisysevent.yaml" diff --git a/interfaces/inner_api/appexecfwk_base/BUILD.gn b/interfaces/inner_api/appexecfwk_base/BUILD.gn index 851fe27b7..e99c525b8 100644 --- a/interfaces/inner_api/appexecfwk_base/BUILD.gn +++ b/interfaces/inner_api/appexecfwk_base/BUILD.gn @@ -114,6 +114,13 @@ ohos_shared_library("appexecfwk_base") { external_deps += [ "udmf:utd_client" ] } + if (bundle_framework_form_dimension_2_3) { + defines += [ "FORM_DIMENSION_2_3" ] + } + if (bundle_framework_form_dimension_3_3) { + defines += [ "FORM_DIMENSION_3_3" ] + } + public_external_deps = [ "ability_base:base", "ability_base:want", diff --git a/interfaces/inner_api/appexecfwk_base/src/extension_form_profile.cpp b/interfaces/inner_api/appexecfwk_base/src/extension_form_profile.cpp index 3d57fcaab..c6ace93e5 100644 --- a/interfaces/inner_api/appexecfwk_base/src/extension_form_profile.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/extension_form_profile.cpp @@ -29,6 +29,12 @@ std::mutex g_mutex; const int8_t MAX_FORM_NAME = 127; const int8_t DEFAULT_RECT_SHAPE = 1; +#ifndef FORM_DIMENSION_2_3 +const int8_t DIMENSION_2_3 = 8; +#endif +#ifndef FORM_DIMENSION_3_3 +const int8_t DIMENSION_3_3 = 9; +#endif constexpr const char* FORM_COLOR_MODE_MAP_KEY[] = { "auto", "dark", @@ -46,7 +52,9 @@ constexpr const char* DIMENSION_MAP_KEY[] = { "4*4", "2*1", "1*1", - "6*4" + "6*4", + "2*3", + "3*3" }; const int32_t DIMENSION_MAP_VALUE[] = { 1, @@ -55,7 +63,9 @@ const int32_t DIMENSION_MAP_VALUE[] = { 4, 5, 6, - 7 + 7, + 8, + 9 }; constexpr const char* SHAPE_MAP_KEY[] = { "rect", @@ -353,6 +363,22 @@ bool GetMetadata(const ExtensionFormProfileInfo &form, ExtensionFormInfo &info) APP_LOGW("dimension invalid form %{public}s", form.name.c_str()); continue; } + + int32_t dimensionItem = DIMENSION_MAP_VALUE[i]; + #ifndef FORM_DIMENSION_2_3 + if (dimensionItem == DIMENSION_2_3) { + APP_LOGW("dimension invalid in wearable Device form %{public}d", dimensionItem); + continue; + } + #endif + + #ifndef FORM_DIMENSION_3_3 + if (dimensionItem == DIMENSION_3_3) { + APP_LOGW("dimension invalid in wearable Device form %{public}d", dimensionItem); + continue; + } + #endif + supportDimensionSet.emplace(DIMENSION_MAP_VALUE[i]); } for (i = 0; i < len; i++) {