diff --git a/interfaces/inner_api/appexecfwk_base/include/extension_form_info.h b/interfaces/inner_api/appexecfwk_base/include/extension_form_info.h index 270cc7dfcf5146342d78c53861b7e2388ac9c9f5..52b82e082eb6b1feabce9540e841cd937f9f2a9b 100644 --- a/interfaces/inner_api/appexecfwk_base/include/extension_form_info.h +++ b/interfaces/inner_api/appexecfwk_base/include/extension_form_info.h @@ -42,6 +42,7 @@ struct ExtensionFormInfo { std::string src; FormWindow window; std::string formConfigAbility; + std::string formBindAbility; int32_t updateDuration = 0; int32_t defaultDimension = 0; std::vector supportDimensions {}; diff --git a/interfaces/inner_api/appexecfwk_base/include/extension_form_profile.h b/interfaces/inner_api/appexecfwk_base/include/extension_form_profile.h index 5f57c68a0e6537bf46f529d355e1f5dfe86a9cf6..46176483a574e4dde606aa2569d798f43efe86ac 100644 --- a/interfaces/inner_api/appexecfwk_base/include/extension_form_profile.h +++ b/interfaces/inner_api/appexecfwk_base/include/extension_form_profile.h @@ -34,6 +34,7 @@ constexpr const char* WINDOW_DESIGN_WIDTH = "designWidth"; constexpr const char* WINDOW_AUTO_DESIGN_WIDTH = "autoDesignWidth"; constexpr const char* COLOR_MODE = "colorMode"; constexpr const char* FORM_CONFIG_ABILITY = "formConfigAbility"; +constexpr const char* FORM_BIND_ABILITY = "formBindAbility"; constexpr const char* TYPE = "type"; constexpr const char* UI_SYNTAX = "uiSyntax"; constexpr const char* FORM_VISIBLE_NOTIFY = "formVisibleNotify"; diff --git a/interfaces/inner_api/appexecfwk_base/include/form_info.h b/interfaces/inner_api/appexecfwk_base/include/form_info.h index 3e847f7cb923f8481322bc76baa44b03f4902273..a83516528bf96ca2d73be29cf408e9e2f767e5f3 100644 --- a/interfaces/inner_api/appexecfwk_base/include/form_info.h +++ b/interfaces/inner_api/appexecfwk_base/include/form_info.h @@ -37,6 +37,7 @@ struct FormInfo : public Parcelable { std::string jsComponentName; std::string deepLink; std::string formConfigAbility; + std::string formBindAbility; std::string scheduledUpdateTime = ""; std::string src; FormWindow window; 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 1a15060f5655983c847e83c1bb13144a1e2cc2c0..6b9e5861a592a38017728908795b733e74c46e32 100644 --- a/interfaces/inner_api/appexecfwk_base/src/extension_form_profile.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/extension_form_profile.cpp @@ -75,6 +75,7 @@ struct ExtensionFormProfileInfo { Window window; std::string colorMode = "auto"; std::string formConfigAbility; + std::string formBindAbility; std::string type = "JS"; std::string uiSyntax = "hml"; std::string scheduledUpdateTime = ""; @@ -198,6 +199,14 @@ void from_json(const nlohmann::json &jsonObject, ExtensionFormProfileInfo &exten false, g_parseResult, ArrayType::NOT_ARRAY); + GetValueIfFindKey(jsonObject, + jsonObjectEnd, + ExtensionFormProfileReader::FORM_BIND_ABILITY, + extensionFormProfileInfo.formBindAbility, + JsonType::STRING, + false, + g_parseResult, + ArrayType::NOT_ARRAY); GetValueIfFindKey(jsonObject, jsonObjectEnd, ExtensionFormProfileReader::TYPE, @@ -441,6 +450,7 @@ bool TransformToExtensionFormInfo(const ExtensionFormProfileInfo &form, Extensio } info.formConfigAbility = form.formConfigAbility; + info.formBindAbility = form.formBindAbility; info.formVisibleNotify = form.formVisibleNotify; info.isDefault = form.isDefault; info.updateEnabled = form.updateEnabled; diff --git a/interfaces/inner_api/appexecfwk_base/src/form_info.cpp b/interfaces/inner_api/appexecfwk_base/src/form_info.cpp index baf222fc74491bee066edcb1ca77dfa7f346e16c..011add1942f9ad22c116b1c9ad5428edd96d2908 100644 --- a/interfaces/inner_api/appexecfwk_base/src/form_info.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/form_info.cpp @@ -52,6 +52,7 @@ const char* JSON_KEY_TYPE = "type"; const char* JSON_KEY_UI_SYNTAX = "uiSyntax"; const char* JSON_KEY_LANDSCAPE_LAYOUTS = "landscapeLayouts"; const char* JSON_KEY_FORMCONFIG_ABILITY = "formConfigAbility"; +const char* JSON_KEY_FORMBIND_ABILITY = "formBindAbility"; const char* JSON_KEY_FORM_VISIBLE_NOTIFY = "formVisibleNotify"; const char* JSON_KEY_RELATED_BUNDLE_NAME = "relatedBundleName"; const char* JSON_KEY_DEFAULT_FLAG = "defaultFlag"; @@ -85,6 +86,7 @@ FormInfo::FormInfo(const ExtensionAbilityInfo &abilityInfo, const ExtensionFormI jsComponentName = ""; deepLink = ""; formConfigAbility = formInfo.formConfigAbility; + formBindAbility = formInfo.formBindAbility; scheduledUpdateTime = formInfo.scheduledUpdateTime; src = formInfo.src; window.designWidth = formInfo.window.designWidth; @@ -146,6 +148,7 @@ bool FormInfo::ReadFromParcel(Parcel &parcel) displayName = Str16ToStr8(parcel.ReadString16()); description = Str16ToStr8(parcel.ReadString16()); formConfigAbility = Str16ToStr8(parcel.ReadString16()); + formBindAbility = Str16ToStr8(parcel.ReadString16()); scheduledUpdateTime = Str16ToStr8(parcel.ReadString16()); jsComponentName = Str16ToStr8(parcel.ReadString16()); relatedBundleName = Str16ToStr8(parcel.ReadString16()); @@ -240,6 +243,7 @@ bool FormInfo::Marshalling(Parcel &parcel) const WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(displayName)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(description)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(formConfigAbility)); + WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(formBindAbility)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(scheduledUpdateTime)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(jsComponentName)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(relatedBundleName)); @@ -340,6 +344,7 @@ void to_json(nlohmann::json &jsonObject, const FormInfo &formInfo) {JSON_KEY_DEEP_LINK, formInfo.deepLink}, {JSON_KEY_SRC, formInfo.src}, {JSON_KEY_FORMCONFIG_ABILITY, formInfo.formConfigAbility}, + {JSON_KEY_FORMBIND_ABILITY, formInfo.formBindAbility}, {JSON_KEY_SCHEDULED_UPDATE_TIME, formInfo.scheduledUpdateTime}, {JSON_KEY_ORIGINAL_BUNDLE_NAME, formInfo.originalBundleName}, {JSON_KEY_DISPLAY_NAME_ID, formInfo.displayNameId}, @@ -511,6 +516,14 @@ void from_json(const nlohmann::json &jsonObject, FormInfo &formInfo) false, parseResult, ArrayType::NOT_ARRAY); + GetValueIfFindKey(jsonObject, + jsonObjectEnd, + JSON_KEY_FORMBIND_ABILITY, + formInfo.formBindAbility, + JsonType::STRING, + false, + parseResult, + ArrayType::NOT_ARRAY); GetValueIfFindKey(jsonObject, jsonObjectEnd, JSON_KEY_SCHEDULED_UPDATE_TIME, diff --git a/interfaces/kits/js/bundlemgr/bundle_mgr.cpp b/interfaces/kits/js/bundlemgr/bundle_mgr.cpp index 37086fb3e19bf0f4391bfbd349e25c1657e747be..edbb8cc33ff31d646965d1be32e749c6ae81bce6 100644 --- a/interfaces/kits/js/bundlemgr/bundle_mgr.cpp +++ b/interfaces/kits/js/bundlemgr/bundle_mgr.cpp @@ -1011,6 +1011,11 @@ static void ConvertFormInfo(napi_env env, napi_value objformInfo, const FormInfo env, napi_create_string_utf8(env, formInfo.formConfigAbility.c_str(), NAPI_AUTO_LENGTH, &nFormConfigAbility)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, objformInfo, "formConfigAbility", nFormConfigAbility)); + napi_value nFormBindAbility; + NAPI_CALL_RETURN_VOID( + env, napi_create_string_utf8(env, formInfo.formBindAbility.c_str(), NAPI_AUTO_LENGTH, &nFormBindAbility)); + NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, objformInfo, "formBindAbility", nFormBindAbility)); + napi_value nType; NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, static_cast(formInfo.type), &nType)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, objformInfo, "type", nType)); diff --git a/services/bundlemgr/include/common_profile.h b/services/bundlemgr/include/common_profile.h index 927f736636607ee858361010e2ccfa101415edf1..34ea74c56677a109c8478c0cb04eb2f02fb2c3d9 100644 --- a/services/bundlemgr/include/common_profile.h +++ b/services/bundlemgr/include/common_profile.h @@ -212,6 +212,7 @@ constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_DEEP_LINK = "deepLink"; constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_JS_COMPONENT_NAME = "jsComponentName"; constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_VALUE = "value"; constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_FORM_CONFIG_ABILITY = "formConfigAbility"; +constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_FORM_BIND_ABILITY = "formBindAbility"; constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_FORM_VISIBLE_NOTIFY = "formVisibleNotify"; constexpr const char* BUNDLE_MODULE_PROFILE_FORMS_SRC = "src"; // sub BUNDLE_MODULE_PROFILE_KEY_JS diff --git a/services/bundlemgr/src/bundle_profile.cpp b/services/bundlemgr/src/bundle_profile.cpp index 9631224c639588e8fa26a8b58658f5c17b09f41b..37aac657285503a859fed2c5492b29b478670c27 100644 --- a/services/bundlemgr/src/bundle_profile.cpp +++ b/services/bundlemgr/src/bundle_profile.cpp @@ -224,6 +224,7 @@ struct Forms { int32_t updateDuration = 0; std::string deepLink; std::string formConfigAbility; + std::string formBindAbility; bool formVisibleNotify = false; std::string jsComponentName; FormsMetaData metaData; @@ -1119,6 +1120,14 @@ void from_json(const nlohmann::json &jsonObject, Forms &forms) false, g_parseResult, ArrayType::NOT_ARRAY); + GetValueIfFindKey(jsonObject, + jsonObjectEnd, + BUNDLE_MODULE_PROFILE_FORMS_FORM_BIND_ABILITY, + forms.formBindAbility, + JsonType::STRING, + false, + g_parseResult, + ArrayType::NOT_ARRAY); GetValueIfFindKey(jsonObject, jsonObjectEnd, BUNDLE_MODULE_PROFILE_FORMS_FORM_VISIBLE_NOTIFY, @@ -1991,6 +2000,7 @@ bool ConvertFormInfo(FormInfo &formInfo, const ProfileReader::Forms &form) formInfo.description = form.description; formInfo.descriptionId = form.descriptionId; formInfo.formConfigAbility = form.formConfigAbility; + formInfo.formBindAbility = form.formBindAbility; formInfo.formVisibleNotify = form.formVisibleNotify; formInfo.deepLink = form.deepLink; formInfo.defaultFlag = form.isDefault;