!7353 【bundlemanager_bundle_framework】穿戴设备定制尺寸2*3 ,3*3卡片,并过滤非穿戴设备使用此定制尺寸

Merge pull request !7353 from 刘政宏/master
This commit is contained in:
openharmony_ci 2024-11-08 16:24:20 +00:00 committed by Gitee
commit 63f4da87da
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 40 additions and 3 deletions

View File

@ -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

View File

@ -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"

View File

@ -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",

View File

@ -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++) {