mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2025-02-17 06:28:19 +00:00
commit
2a7a7ff8ed
@ -41,6 +41,7 @@ struct ExtensionFormInfo {
|
||||
std::int32_t defaultDimension;
|
||||
std::vector<int32_t> supportDimensions {};
|
||||
std::vector<FormCustomizeData> metadata {};
|
||||
bool dataProxyEnabled = false;
|
||||
};
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
@ -45,6 +45,7 @@ const std::string SUPPORT_DIMENSIONS = "supportDimensions";
|
||||
const std::string METADATA = "metadata";
|
||||
const std::string METADATA_NAME = "name";
|
||||
const std::string METADATA_VALUE = "value";
|
||||
const std::string DATA_PROXY_ENABLED = "dataProxyEnabled";
|
||||
}
|
||||
|
||||
class ExtensionFormProfile {
|
||||
|
@ -53,6 +53,7 @@ struct FormInfo : public Parcelable {
|
||||
std::vector<std::string> landscapeLayouts;
|
||||
std::vector<std::string> portraitLayouts;
|
||||
std::vector<FormCustomizeData> customizeDatas;
|
||||
bool dataProxyEnabled = false;
|
||||
|
||||
FormInfo() = default;
|
||||
explicit FormInfo(const ExtensionAbilityInfo &abilityInfo, const ExtensionFormInfo &formInfo);
|
||||
|
@ -74,6 +74,7 @@ struct ExtensionFormProfileInfo {
|
||||
std::string defaultDimension;
|
||||
std::vector<std::string> supportDimensions {};
|
||||
std::vector<Metadata> metadata {};
|
||||
bool dataProxyEnabled = false;
|
||||
};
|
||||
|
||||
struct ExtensionFormProfileInfoVec {
|
||||
@ -253,6 +254,14 @@ void from_json(const nlohmann::json &jsonObject, ExtensionFormProfileInfo &exten
|
||||
false,
|
||||
parseResult,
|
||||
ArrayType::OBJECT);
|
||||
GetValueIfFindKey<bool>(jsonObject,
|
||||
jsonObjectEnd,
|
||||
ExtensionFormProfileReader::DATA_PROXY_ENABLED,
|
||||
extensionFormProfileInfo.dataProxyEnabled,
|
||||
JsonType::BOOLEAN,
|
||||
false,
|
||||
parseResult,
|
||||
ArrayType::NOT_ARRAY);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &jsonObject, ExtensionFormProfileInfoVec &infos)
|
||||
@ -357,6 +366,8 @@ bool TransformToExtensionFormInfo(const ExtensionFormProfileInfo &form, Extensio
|
||||
customizeData.value = data.value;
|
||||
info.metadata.emplace_back(customizeData);
|
||||
}
|
||||
|
||||
info.dataProxyEnabled = form.dataProxyEnabled;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ const std::string JSON_KEY_WINDOW = "window";
|
||||
const std::string JSON_KEY_DESIGN_WIDTH = "designWidth";
|
||||
const std::string JSON_KEY_AUTO_DESIGN_WIDTH = "autoDesignWidth";
|
||||
const std::string JSON_KEY_IS_STATIC = "isStatic";
|
||||
const std::string JSON_KEY_DATA_PROXY_ENABLED = "dataProxyEnabled";
|
||||
} // namespace
|
||||
|
||||
FormInfo::FormInfo(const ExtensionAbilityInfo &abilityInfo, const ExtensionFormInfo &formInfo)
|
||||
@ -96,6 +97,7 @@ FormInfo::FormInfo(const ExtensionAbilityInfo &abilityInfo, const ExtensionFormI
|
||||
for (const auto &metadata : formInfo.metadata) {
|
||||
customizeDatas.push_back(metadata);
|
||||
}
|
||||
dataProxyEnabled = formInfo.dataProxyEnabled;
|
||||
}
|
||||
|
||||
bool FormInfo::ReadCustomizeData(Parcel &parcel)
|
||||
@ -176,6 +178,7 @@ bool FormInfo::ReadFromParcel(Parcel &parcel)
|
||||
|
||||
window.designWidth = parcel.ReadInt32();
|
||||
window.autoDesignWidth = parcel.ReadBool();
|
||||
dataProxyEnabled = parcel.ReadBool();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -242,6 +245,7 @@ bool FormInfo::Marshalling(Parcel &parcel) const
|
||||
|
||||
WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, window.designWidth);
|
||||
WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, window.autoDesignWidth);
|
||||
WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, dataProxyEnabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -298,7 +302,8 @@ void to_json(nlohmann::json &jsonObject, const FormInfo &formInfo)
|
||||
{JSON_KEY_CUSTOMIZE_DATA, formInfo.customizeDatas},
|
||||
{JSON_KEY_LANDSCAPE_LAYOUTS, formInfo.landscapeLayouts},
|
||||
{JSON_KEY_PORTRAIT_LAYOUTS, formInfo.portraitLayouts},
|
||||
{JSON_KEY_WINDOW, formInfo.window}
|
||||
{JSON_KEY_WINDOW, formInfo.window},
|
||||
{JSON_KEY_DATA_PROXY_ENABLED, formInfo.dataProxyEnabled}
|
||||
};
|
||||
}
|
||||
|
||||
@ -354,6 +359,14 @@ void from_json(const nlohmann::json &jsonObject, FormInfo &formInfo)
|
||||
false,
|
||||
parseResult,
|
||||
ArrayType::NOT_ARRAY);
|
||||
GetValueIfFindKey<bool>(jsonObject,
|
||||
jsonObjectEnd,
|
||||
JSON_KEY_DATA_PROXY_ENABLED,
|
||||
formInfo.dataProxyEnabled,
|
||||
JsonType::BOOLEAN,
|
||||
false,
|
||||
parseResult,
|
||||
ArrayType::NOT_ARRAY);
|
||||
}
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
Loading…
x
Reference in New Issue
Block a user