mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-27 09:21:28 +00:00
Support ui extension base life cycle.
Sig:SIG_ApplicationFramework Feature or BugFix: Feature Binary Source: No Signed-off-by: zhangyafei.echo <zhangyafei12@huawei.com> Change-Id: I97c309817fa53b7f3f3df064221a373a50764653
This commit is contained in:
parent
c41867355a
commit
8706337f67
@ -421,6 +421,7 @@
|
||||
"//foundation/ability/ability_runtime/test/moduletest:moduletest",
|
||||
"//foundation/ability/ability_runtime/test/fuzztest:fuzztest",
|
||||
"//foundation/ability/ability_runtime/test/unittest:unittest",
|
||||
"//foundation/ability/ability_runtime/test/sample:sample",
|
||||
"//foundation/ability/ability_runtime/tools/test:moduletest",
|
||||
"//foundation/ability/ability_runtime/tools/test:systemtest",
|
||||
"//foundation/ability/ability_runtime/tools/test:unittest",
|
||||
|
@ -1022,7 +1022,15 @@ ohos_shared_library("ui_extension_module") {
|
||||
|
||||
config("share_extension_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/ability/native/share_extension_ability" ]
|
||||
include_dirs = [
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/share_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ui_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native",
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("share_extension") {
|
||||
@ -1064,7 +1072,15 @@ ohos_shared_library("share_extension") {
|
||||
|
||||
config("action_extension_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/ability/native/action_extension_ability" ]
|
||||
include_dirs = [
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/action_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ui_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native",
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("action_extension") {
|
||||
@ -1126,6 +1142,10 @@ ohos_shared_library("share_extension_module") {
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
if (ability_runtime_graphics) {
|
||||
external_deps += [ "window_manager:libwm" ]
|
||||
}
|
||||
|
||||
relative_install_dir = "extensionability/"
|
||||
subsystem_name = "ability"
|
||||
part_name = "ability_runtime"
|
||||
@ -1178,6 +1198,10 @@ ohos_shared_library("action_extension_module") {
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
if (ability_runtime_graphics) {
|
||||
external_deps += [ "window_manager:libwm" ]
|
||||
}
|
||||
|
||||
relative_install_dir = "extensionability/"
|
||||
subsystem_name = "ability"
|
||||
part_name = "ability_runtime"
|
||||
@ -1185,7 +1209,15 @@ ohos_shared_library("action_extension_module") {
|
||||
|
||||
config("embedded_ui_extension_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/ability/native/embedded_ui_extension_ability" ]
|
||||
include_dirs = [
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/embedded_ui_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ui_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native",
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
|
||||
]
|
||||
}
|
||||
|
||||
config("embedded_ui_extension_module_config") {
|
||||
@ -1320,6 +1352,10 @@ ohos_shared_library("embedded_ui_extension_module") {
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
if (ability_runtime_graphics) {
|
||||
external_deps += [ "window_manager:libwm" ]
|
||||
}
|
||||
|
||||
relative_install_dir = "extensionability/"
|
||||
subsystem_name = "ability"
|
||||
part_name = "ability_runtime"
|
||||
|
@ -36,13 +36,5 @@ ActionExtension *ActionExtension::Create(const std::unique_ptr<Runtime> &runtime
|
||||
return new ActionExtension();
|
||||
}
|
||||
}
|
||||
|
||||
void ActionExtension::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
ExtensionBase<UIExtensionContext>::Init(record, application, handler, token);
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -29,150 +29,13 @@ JsActionExtension *JsActionExtension::Create(const std::unique_ptr<Runtime> &run
|
||||
|
||||
JsActionExtension::JsActionExtension(const std::unique_ptr<Runtime> &runtime)
|
||||
{
|
||||
jsUIExtensionBase_ = std::make_shared<JsUIExtensionBase>(runtime);
|
||||
auto uiExtensionBaseImpl = std::make_unique<JsUIExtensionBase>(runtime);
|
||||
SetUIExtensionBaseImpl(std::move(uiExtensionBaseImpl));
|
||||
}
|
||||
|
||||
JsActionExtension::~JsActionExtension()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "destructor.");
|
||||
auto context = GetContext();
|
||||
if (context) {
|
||||
context->Unbind();
|
||||
}
|
||||
}
|
||||
|
||||
void JsActionExtension::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
ActionExtension::Init(record, application, handler, token);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->SetAbilityInfo(abilityInfo_);
|
||||
jsUIExtensionBase_->SetContext(GetContext());
|
||||
auto extensionCommon = jsUIExtensionBase_->Init(record, application, handler, token);
|
||||
SetExtensionCommon(extensionCommon);
|
||||
}
|
||||
|
||||
void JsActionExtension::OnStart(const AAFwk::Want &want)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
Extension::OnStart(want);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnStart(want);
|
||||
}
|
||||
|
||||
void JsActionExtension::OnStop()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
ActionExtension::OnStop();
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnStop();
|
||||
}
|
||||
|
||||
void JsActionExtension::OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "begin. persistentId: %{private}d, winCmd: %{public}d",
|
||||
sessionInfo->persistentId, winCmd);
|
||||
if (sessionInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "sessionInfo is nullptr.");
|
||||
return;
|
||||
}
|
||||
Extension::OnCommandWindow(want, sessionInfo, winCmd);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnCommandWindow(want, sessionInfo, winCmd);
|
||||
}
|
||||
|
||||
void JsActionExtension::OnCommand(const AAFwk::Want &want, bool restart, int32_t startId)
|
||||
{
|
||||
Extension::OnCommand(want, restart, startId);
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "begin restart = %{public}s, startId = %{public}d.",
|
||||
restart ? "true" : "false", startId);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnCommand(want, restart, startId);
|
||||
}
|
||||
|
||||
void JsActionExtension::OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
Extension::OnForeground(want, sessionInfo);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnForeground(want, sessionInfo);
|
||||
}
|
||||
|
||||
void JsActionExtension::OnBackground()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnBackground();
|
||||
Extension::OnBackground();
|
||||
}
|
||||
|
||||
void JsActionExtension::OnConfigurationUpdated(const AppExecFwk::Configuration &configuration)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
Extension::OnConfigurationUpdated(configuration);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnConfigurationUpdated(configuration);
|
||||
}
|
||||
|
||||
void JsActionExtension::Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "called.");
|
||||
Extension::Dump(params, info);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->Dump(params, info);
|
||||
}
|
||||
|
||||
void JsActionExtension::OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ACTION_EXT, "OnAbilityResult called.");
|
||||
Extension::OnAbilityResult(requestCode, resultCode, resultData);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::ACTION_EXT, "jsUIExtensionBase_ is null");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnAbilityResult(requestCode, resultCode, resultData);
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -36,13 +36,5 @@ EmbeddedUIExtension *EmbeddedUIExtension::Create(const std::unique_ptr<Runtime>
|
||||
return new (std::nothrow) EmbeddedUIExtension();
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedUIExtension::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
ExtensionBase<UIExtensionContext>::Init(record, application, handler, token);
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -29,150 +29,13 @@ JsEmbeddedUIExtension *JsEmbeddedUIExtension::Create(const std::unique_ptr<Runti
|
||||
|
||||
JsEmbeddedUIExtension::JsEmbeddedUIExtension(const std::unique_ptr<Runtime> &runtime)
|
||||
{
|
||||
jsUIExtensionBase_ = std::make_shared<JsUIExtensionBase>(runtime);
|
||||
auto uiExtensionBaseImpl = std::make_unique<JsUIExtensionBase>(runtime);
|
||||
SetUIExtensionBaseImpl(std::move(uiExtensionBaseImpl));
|
||||
}
|
||||
|
||||
JsEmbeddedUIExtension::~JsEmbeddedUIExtension()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "destructor.");
|
||||
auto context = GetContext();
|
||||
if (context) {
|
||||
context->Unbind();
|
||||
}
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
EmbeddedUIExtension::Init(record, application, handler, token);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->SetAbilityInfo(abilityInfo_);
|
||||
jsUIExtensionBase_->SetContext(GetContext());
|
||||
auto extensionCommon = jsUIExtensionBase_->Init(record, application, handler, token);
|
||||
SetExtensionCommon(extensionCommon);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnStart(const AAFwk::Want &want)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
Extension::OnStart(want);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnStart(want);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnStop()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
EmbeddedUIExtension::OnStop();
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnStop();
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "begin. persistentId: %{private}d, winCmd: %{public}d",
|
||||
sessionInfo->persistentId, winCmd);
|
||||
if (sessionInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "sessionInfo is nullptr.");
|
||||
return;
|
||||
}
|
||||
Extension::OnCommandWindow(want, sessionInfo, winCmd);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnCommandWindow(want, sessionInfo, winCmd);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnCommand(const AAFwk::Want &want, bool restart, int32_t startId)
|
||||
{
|
||||
Extension::OnCommand(want, restart, startId);
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "begin restart = %{public}s, startId = %{public}d.",
|
||||
restart ? "true" : "false", startId);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnCommand(want, restart, startId);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
Extension::OnForeground(want, sessionInfo);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnForeground(want, sessionInfo);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnBackground()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnBackground();
|
||||
Extension::OnBackground();
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnConfigurationUpdated(const AppExecFwk::Configuration &configuration)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
Extension::OnConfigurationUpdated(configuration);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnConfigurationUpdated(configuration);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "called.");
|
||||
Extension::Dump(params, info);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->Dump(params, info);
|
||||
}
|
||||
|
||||
void JsEmbeddedUIExtension::OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::EMBEDDED_EXT, "OnAbilityResult called.");
|
||||
Extension::OnAbilityResult(requestCode, resultCode, resultData);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::EMBEDDED_EXT, "jsUIExtensionBase_ is null");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnAbilityResult(requestCode, resultCode, resultData);
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -29,149 +29,13 @@ JsShareExtension *JsShareExtension::Create(const std::unique_ptr<Runtime> &runti
|
||||
|
||||
JsShareExtension::JsShareExtension(const std::unique_ptr<Runtime> &runtime)
|
||||
{
|
||||
jsUIExtensionBase_ = std::make_shared<JsUIExtensionBase>(runtime);
|
||||
auto uiExtensionBaseImpl = std::make_unique<JsUIExtensionBase>(runtime);
|
||||
SetUIExtensionBaseImpl(std::move(uiExtensionBaseImpl));
|
||||
}
|
||||
|
||||
JsShareExtension::~JsShareExtension()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "destructor.");
|
||||
auto context = GetContext();
|
||||
if (context) {
|
||||
context->Unbind();
|
||||
}
|
||||
}
|
||||
|
||||
void JsShareExtension::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
ShareExtension::Init(record, application, handler, token);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->SetAbilityInfo(abilityInfo_);
|
||||
jsUIExtensionBase_->SetContext(GetContext());
|
||||
auto extensionCommon = jsUIExtensionBase_->Init(record, application, handler, token);
|
||||
SetExtensionCommon(extensionCommon);
|
||||
}
|
||||
|
||||
void JsShareExtension::OnStart(const AAFwk::Want &want)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
Extension::OnStart(want);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnStart(want);
|
||||
}
|
||||
|
||||
void JsShareExtension::OnStop()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
ShareExtension::OnStop();
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnStop();
|
||||
}
|
||||
|
||||
void JsShareExtension::OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "begin. persistentId: %{private}d, winCmd: %{public}d",
|
||||
sessionInfo->persistentId, winCmd);
|
||||
if (sessionInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "sessionInfo is nullptr.");
|
||||
return;
|
||||
}
|
||||
Extension::OnCommandWindow(want, sessionInfo, winCmd);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnCommandWindow(want, sessionInfo, winCmd);
|
||||
}
|
||||
|
||||
void JsShareExtension::OnCommand(const AAFwk::Want &want, bool restart, int32_t startId)
|
||||
{
|
||||
Extension::OnCommand(want, restart, startId);
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "begin restart = %{public}s, startId = %{public}d.",
|
||||
restart ? "true" : "false", startId);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnCommand(want, restart, startId);
|
||||
}
|
||||
|
||||
void JsShareExtension::OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
Extension::OnForeground(want, sessionInfo);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnForeground(want, sessionInfo);
|
||||
}
|
||||
|
||||
void JsShareExtension::OnBackground()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "OnBackground called.");
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr.");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnBackground();
|
||||
Extension::OnBackground();
|
||||
}
|
||||
|
||||
void JsShareExtension::OnConfigurationUpdated(const AppExecFwk::Configuration &configuration)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
Extension::OnConfigurationUpdated(configuration);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnConfigurationUpdated(configuration);
|
||||
}
|
||||
|
||||
void JsShareExtension::Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
Extension::Dump(params, info);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->Dump(params, info);
|
||||
}
|
||||
|
||||
void JsShareExtension::OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
Extension::OnAbilityResult(requestCode, resultCode, resultData);
|
||||
|
||||
if (jsUIExtensionBase_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::SHARE_EXT, "jsUIExtensionBase_ is nullptr");
|
||||
return;
|
||||
}
|
||||
jsUIExtensionBase_->OnAbilityResult(requestCode, resultCode, resultData);
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
@ -36,13 +36,5 @@ ShareExtension *ShareExtension::Create(const std::unique_ptr<Runtime> &runtime)
|
||||
return new ShareExtension();
|
||||
}
|
||||
}
|
||||
|
||||
void ShareExtension::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::SHARE_EXT, "called.");
|
||||
ExtensionBase<UIExtensionContext>::Init(record, application, handler, token);
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
@ -114,7 +114,7 @@ JsUIExtensionBase::~JsUIExtensionBase()
|
||||
contentSessions_.clear();
|
||||
}
|
||||
|
||||
std::shared_ptr<JsExtensionCommon> JsUIExtensionBase::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
std::shared_ptr<ExtensionCommon> JsUIExtensionBase::Init(const std::shared_ptr<AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<OHOSApplication> &application, std::shared_ptr<AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef OHOS_ABILITY_RUNTIME_ACTION_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_ACTION_EXTENSION_H
|
||||
|
||||
#include "extension_base.h"
|
||||
#include "ui_extension_base.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
@ -25,22 +25,12 @@ class Runtime;
|
||||
/**
|
||||
* @brief Action extension components.
|
||||
*/
|
||||
class ActionExtension : public ExtensionBase<UIExtensionContext>, public std::enable_shared_from_this<ActionExtension> {
|
||||
class ActionExtension : public UIExtensionBase<UIExtensionContext>,
|
||||
public std::enable_shared_from_this<ActionExtension> {
|
||||
public:
|
||||
ActionExtension() = default;
|
||||
virtual ~ActionExtension() = default;
|
||||
|
||||
/**
|
||||
* @brief Init the action extension.
|
||||
*
|
||||
* @param record the action extension record.
|
||||
* @param application the application info.
|
||||
* @param handler the action extension handler.
|
||||
* @param token the remote token.
|
||||
*/
|
||||
void Init(const std::shared_ptr<AbilityLocalRecord> &record, const std::shared_ptr<OHOSApplication> &application,
|
||||
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Create action extension.
|
||||
*
|
||||
|
@ -39,102 +39,6 @@ public:
|
||||
* @return The JsActionExtension instance.
|
||||
*/
|
||||
static JsActionExtension *Create(const std::unique_ptr<Runtime> &runtime);
|
||||
|
||||
/**
|
||||
* @brief Init the action extension.
|
||||
*
|
||||
* @param record the action extension record.
|
||||
* @param application the application info.
|
||||
* @param handler the action extension handler.
|
||||
* @param token the remote token.
|
||||
*/
|
||||
void Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<AppExecFwk::OHOSApplication> &application,
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this action extension is started. You must override this function if you want to perform some
|
||||
* initialization operations during action extension startup.
|
||||
*
|
||||
* This function can be called only once in the entire lifecycle of an action extension.
|
||||
*
|
||||
* @param Want Indicates the {@link Want} structure containing startup information about the action extension.
|
||||
*/
|
||||
void OnStart(const AAFwk::Want &want) override;
|
||||
|
||||
/**
|
||||
* @brief Called back when action extension is started.
|
||||
*
|
||||
* This method can be called only by action extension. You can use the StartAbility(Want) method to start
|
||||
* action extension. Then the system calls back the current method to use the transferred want parameter to
|
||||
* execute its own logic.
|
||||
*
|
||||
* @param want Indicates the want of action extension to start.
|
||||
* @param restart Indicates the startup mode. The value true indicates that action extension is restarted after
|
||||
* being destroyed, and the value false indicates a normal startup.
|
||||
* @param startId Indicates the number of times the action extension has been started. The startId is incremented
|
||||
* by 1 every time the action extension is started. For example, if the action extension has been started for six
|
||||
* times, the value of startId is 6.
|
||||
*/
|
||||
void OnCommand(const AAFwk::Want &want, bool restart, int32_t startId) override;
|
||||
|
||||
void OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this action extension enters the <b>STATE_STOP</b> state.
|
||||
*
|
||||
* The action extension in the <b>STATE_STOP</b> is being destroyed.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnStop() override;
|
||||
|
||||
/**
|
||||
* @brief Called when the system configuration is updated.
|
||||
*
|
||||
* @param configuration Indicates the updated configuration information.
|
||||
*/
|
||||
void OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_FOREGROUND</b> state.
|
||||
*
|
||||
*
|
||||
* The extension in the <b>STATE_FOREGROUND</b> state is visible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_BACKGROUND</b> state.
|
||||
*
|
||||
*
|
||||
* The extension in the <b>STATE_BACKGROUND</b> state is invisible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnBackground() override;
|
||||
|
||||
/**
|
||||
* @brief Called when action extension need dump info.
|
||||
*
|
||||
* @param params The params from action extension.
|
||||
* @param info The dump info to show.
|
||||
*/
|
||||
void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info) override;
|
||||
|
||||
/**
|
||||
* @brief Called when startAbilityForResult(ohos.aafwk.content.Want,int32_t) is called to start an extension ability
|
||||
* and the result is returned.
|
||||
* @param requestCode Indicates the request code returned after the ability is started. You can define the request
|
||||
* code to identify the results returned by abilities. The value ranges from 0 to 65535.
|
||||
* @param resultCode Indicates the result code returned after the ability is started. You can define the result
|
||||
* code to identify an error.
|
||||
* @param resultData Indicates the data returned after the ability is started. You can define the data returned. The
|
||||
* value can be null.
|
||||
*/
|
||||
void OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData) override;
|
||||
private:
|
||||
std::shared_ptr<JsUIExtensionBase> jsUIExtensionBase_;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_ACTION_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_ACTION_EXTENSION_H
|
||||
#ifndef OHOS_ABILITY_RUNTIME_EMBEDDED_UI_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_EMBEDDED_UI_EXTENSION_H
|
||||
|
||||
#include "extension_base.h"
|
||||
#include "ui_extension_base.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
@ -26,23 +26,12 @@ class Runtime;
|
||||
* @brief embedded UI extension components.
|
||||
*/
|
||||
class EmbeddedUIExtension
|
||||
: public ExtensionBase<UIExtensionContext>, public std::enable_shared_from_this<EmbeddedUIExtension> {
|
||||
: public UIExtensionBase<UIExtensionContext>, public std::enable_shared_from_this<EmbeddedUIExtension> {
|
||||
public:
|
||||
EmbeddedUIExtension() = default;
|
||||
|
||||
~EmbeddedUIExtension() override = default;
|
||||
|
||||
/**
|
||||
* @brief Init the embedded UI extension.
|
||||
*
|
||||
* @param record the embedded UI extension record.
|
||||
* @param application the application info.
|
||||
* @param handler the embedded UI extension handler.
|
||||
* @param token the remote token.
|
||||
*/
|
||||
void Init(const std::shared_ptr<AbilityLocalRecord> &record, const std::shared_ptr<OHOSApplication> &application,
|
||||
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Create embedded UI extension.
|
||||
*
|
||||
@ -53,4 +42,4 @@ public:
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_ACTION_EXTENSION_H
|
||||
#endif // OHOS_ABILITY_RUNTIME_EMBEDDED_UI_EXTENSION_H
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_JS_ACTION_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_JS_ACTION_EXTENSION_H
|
||||
#ifndef OHOS_ABILITY_RUNTIME_JS_EMBEDDED_UI_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_JS_EMBEDDED_UI_EXTENSION_H
|
||||
|
||||
#include "embedded_ui_extension.h"
|
||||
#include "configuration.h"
|
||||
@ -39,103 +39,7 @@ public:
|
||||
* @return The JsEmbeddedUIExtension instance.
|
||||
*/
|
||||
static JsEmbeddedUIExtension *Create(const std::unique_ptr<Runtime> &runtime);
|
||||
|
||||
/**
|
||||
* @brief Init the embedded UI extension.
|
||||
*
|
||||
* @param record the embedded UI extension record.
|
||||
* @param application the application info.
|
||||
* @param handler the embedded UI extension handler.
|
||||
* @param token the remote token.
|
||||
*/
|
||||
void Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<AppExecFwk::OHOSApplication> &application,
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this embedded UI extension is started. You must override this function if you want to perform
|
||||
* some initialization operations during embedded UI extension startup.
|
||||
*
|
||||
* This function can be called only once in the entire lifecycle of an embedded UI extension.
|
||||
*
|
||||
* @param Want Indicates the {@link Want} structure containing startup information about the embedded UI extension.
|
||||
*/
|
||||
void OnStart(const AAFwk::Want &want) override;
|
||||
|
||||
/**
|
||||
* @brief Called back when embedded UI extension is started.
|
||||
*
|
||||
* This method can be called only by embedded UI extension. You can use the StartAbility(Want) method to start
|
||||
* embedded UI extension. Then the system calls back the current method to use the transferred want parameter to
|
||||
* execute its own logic.
|
||||
*
|
||||
* @param want Indicates the want of embedded UI extension to start.
|
||||
* @param restart Indicates the startup mode. The value true indicates that embedded UI extension is restarted after
|
||||
* being destroyed, and the value false indicates a normal startup.
|
||||
* @param startId Indicates the number of times the embedded UI extension has been started.
|
||||
* The startId is incremented by 1 every time the embedded UI extension is started. For example,
|
||||
* if the embedded UI extension has been started for six times, the value of startId is 6.
|
||||
*/
|
||||
void OnCommand(const AAFwk::Want &want, bool restart, int32_t startId) override;
|
||||
|
||||
void OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this embedded UI extension enters the <b>STATE_STOP</b> state.
|
||||
*
|
||||
* The embedded UI extension in the <b>STATE_STOP</b> is being destroyed.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnStop() override;
|
||||
|
||||
/**
|
||||
* @brief Called when the system configuration is updated.
|
||||
*
|
||||
* @param configuration Indicates the updated configuration information.
|
||||
*/
|
||||
void OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_FOREGROUND</b> state.
|
||||
*
|
||||
*
|
||||
* The extension in the <b>STATE_FOREGROUND</b> state is visible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_BACKGROUND</b> state.
|
||||
*
|
||||
*
|
||||
* The extension in the <b>STATE_BACKGROUND</b> state is invisible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnBackground() override;
|
||||
|
||||
/**
|
||||
* @brief Called when embedded UI extension need dump info.
|
||||
*
|
||||
* @param params The params from embedded UI extension.
|
||||
* @param info The dump info to show.
|
||||
*/
|
||||
void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info) override;
|
||||
|
||||
/**
|
||||
* @brief Called when startAbilityForResult(ohos.aafwk.content.Want,int32_t) is called to start an extension ability
|
||||
* and the result is returned.
|
||||
* @param requestCode Indicates the request code returned after the ability is started. You can define the request
|
||||
* code to identify the results returned by abilities. The value ranges from 0 to 65535.
|
||||
* @param resultCode Indicates the result code returned after the ability is started. You can define the result
|
||||
* code to identify an error.
|
||||
* @param resultData Indicates the data returned after the ability is started. You can define the data returned. The
|
||||
* value can be null.
|
||||
*/
|
||||
void OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData) override;
|
||||
private:
|
||||
std::shared_ptr<JsUIExtensionBase> jsUIExtensionBase_;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_JS_ACTION_EXTENSION_H
|
||||
#endif // OHOS_ABILITY_RUNTIME_JS_EMBEDDED_UI_EXTENSION_H
|
||||
|
@ -41,103 +41,6 @@ public:
|
||||
* @return The JsShareExtension instance.
|
||||
*/
|
||||
static JsShareExtension *Create(const std::unique_ptr<Runtime> &runtime);
|
||||
|
||||
/**
|
||||
* @brief Init the share extension.
|
||||
*
|
||||
* @param record the share extension record.
|
||||
* @param application the application info.
|
||||
* @param handler the share extension handler.
|
||||
* @param token the remote token.
|
||||
*/
|
||||
void Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<AppExecFwk::OHOSApplication> &application,
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this share extension is started. You must override this function if you want to perform some
|
||||
* initialization operations during share extension startup.
|
||||
*
|
||||
* This function can be called only once in the entire lifecycle of an share extension.
|
||||
*
|
||||
* @param Want Indicates the {@link Want} structure containing startup information about the share extension.
|
||||
*/
|
||||
void OnStart(const AAFwk::Want &want) override;
|
||||
|
||||
/**
|
||||
* @brief Called back when share extension is started.
|
||||
*
|
||||
* This method can be called only by share extension. You can use the StartAbility(Want) method to start
|
||||
* share extension. Then the system calls back the current method to use the transferred want parameter to
|
||||
* execute its own logic.
|
||||
*
|
||||
* @param want Indicates the want of share extension to start.
|
||||
* @param restart Indicates the startup mode. The value true indicates that share extension is restarted after being
|
||||
* destroyed, and the value false indicates a normal startup.
|
||||
* @param startId Indicates the number of times the share extension has been started. The startId is incremented
|
||||
* by 1 every time the share extension is started. For example, if the share extension has been started for six
|
||||
* times, the value of startId is 6.
|
||||
*/
|
||||
void OnCommand(const AAFwk::Want &want, bool restart, int32_t startId) override;
|
||||
|
||||
void OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this share extension enters the <b>STATE_STOP</b> state.
|
||||
*
|
||||
* The share extension in the <b>STATE_STOP</b> is being destroyed.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnStop() override;
|
||||
|
||||
/**
|
||||
* @brief Called when the system configuration is updated.
|
||||
*
|
||||
* @param configuration Indicates the updated configuration information.
|
||||
*/
|
||||
void OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_FOREGROUND</b> state.
|
||||
*
|
||||
*
|
||||
* The extension in the <b>STATE_FOREGROUND</b> state is visible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_BACKGROUND</b> state.
|
||||
*
|
||||
*
|
||||
* The extension in the <b>STATE_BACKGROUND</b> state is invisible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnBackground() override;
|
||||
|
||||
/**
|
||||
* @brief Called when share extension need dump info.
|
||||
*
|
||||
* @param params The params from share extension.
|
||||
* @param info The dump info to show.
|
||||
*/
|
||||
void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info) override;
|
||||
|
||||
/**
|
||||
* @brief Called when startAbilityForResult(ohos.aafwk.content.Want,int32_t) is called to start an extension ability
|
||||
* and the result is returned.
|
||||
* @param requestCode Indicates the request code returned after the ability is started. You can define the request
|
||||
* code to identify the results returned by abilities. The value ranges from 0 to 65535.
|
||||
* @param resultCode Indicates the result code returned after the ability is started. You can define the result
|
||||
* code to identify an error.
|
||||
* @param resultData Indicates the data returned after the ability is started. You can define the data returned. The
|
||||
* value can be null.
|
||||
*/
|
||||
void OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<JsUIExtensionBase> jsUIExtensionBase_;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef OHOS_ABILITY_RUNTIME_SHARE_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_SHARE_EXTENSION_H
|
||||
|
||||
#include "extension_base.h"
|
||||
#include "ui_extension_base.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
@ -25,22 +25,12 @@ class Runtime;
|
||||
/**
|
||||
* @brief Share extension components.
|
||||
*/
|
||||
class ShareExtension : public ExtensionBase<UIExtensionContext>, public std::enable_shared_from_this<ShareExtension> {
|
||||
class ShareExtension : public UIExtensionBase<UIExtensionContext>,
|
||||
public std::enable_shared_from_this<ShareExtension> {
|
||||
public:
|
||||
ShareExtension() = default;
|
||||
virtual ~ShareExtension() = default;
|
||||
|
||||
/**
|
||||
* @brief Init the share extension.
|
||||
*
|
||||
* @param record the share extension record.
|
||||
* @param application the application info.
|
||||
* @param handler the share extension handler.
|
||||
* @param token the remote token.
|
||||
*/
|
||||
void Init(const std::shared_ptr<AbilityLocalRecord> &record, const std::shared_ptr<OHOSApplication> &application,
|
||||
std::shared_ptr<AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Create share extension.
|
||||
*
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "native_engine/native_engine.h"
|
||||
#include "ohos_application.h"
|
||||
#include "session_info.h"
|
||||
#include "ui_extension_base.h"
|
||||
#include "ui_extension_context.h"
|
||||
#include "ui_extension_window_command.h"
|
||||
#include "want.h"
|
||||
@ -38,7 +39,8 @@ class JsRuntime;
|
||||
/**
|
||||
* @brief Js ui extension base.
|
||||
*/
|
||||
class JsUIExtensionBase : public std::enable_shared_from_this<JsUIExtensionBase> {
|
||||
class JsUIExtensionBase : public UIExtensionBaseImpl,
|
||||
public std::enable_shared_from_this<JsUIExtensionBase> {
|
||||
public:
|
||||
explicit JsUIExtensionBase(const std::unique_ptr<Runtime> &runtime);
|
||||
virtual ~JsUIExtensionBase();
|
||||
@ -52,9 +54,9 @@ public:
|
||||
* @param token the remote token.
|
||||
* @return js extension common object.
|
||||
*/
|
||||
std::shared_ptr<JsExtensionCommon> Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
std::shared_ptr<ExtensionCommon> Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<AppExecFwk::OHOSApplication> &application,
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler, const sptr<IRemoteObject> &token);
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this ui extension is started. You must override this function if you want to perform some
|
||||
@ -64,7 +66,7 @@ public:
|
||||
*
|
||||
* @param Want Indicates the {@link Want} structure containing startup information about the ui extension.
|
||||
*/
|
||||
void OnStart(const AAFwk::Want &want);
|
||||
void OnStart(const AAFwk::Want &want) override;
|
||||
|
||||
/**
|
||||
* @brief Called back when ui extension is started.
|
||||
@ -80,10 +82,10 @@ public:
|
||||
* by 1 every time the ui extension is started. For example, if the ui extension has been started for six
|
||||
* times, the value of startId is 6.
|
||||
*/
|
||||
void OnCommand(const AAFwk::Want &want, bool restart, int32_t startId);
|
||||
void OnCommand(const AAFwk::Want &want, bool restart, int32_t startId) override;
|
||||
|
||||
void OnCommandWindow(
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd);
|
||||
const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo, AAFwk::WindowCommand winCmd) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this ui extension enters the <b>STATE_STOP</b> state.
|
||||
@ -91,14 +93,14 @@ public:
|
||||
* The ui extension in the <b>STATE_STOP</b> is being destroyed.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnStop();
|
||||
void OnStop() override;
|
||||
|
||||
/**
|
||||
* @brief Called when the system configuration is updated.
|
||||
*
|
||||
* @param configuration Indicates the updated configuration information.
|
||||
*/
|
||||
void OnConfigurationUpdated(const AppExecFwk::Configuration &configuration);
|
||||
void OnConfigurationUpdated(const AppExecFwk::Configuration &configuration) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_FOREGROUND</b> state.
|
||||
@ -107,7 +109,7 @@ public:
|
||||
* The extension in the <b>STATE_FOREGROUND</b> state is visible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo);
|
||||
void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) override;
|
||||
|
||||
/**
|
||||
* @brief Called when this extension enters the <b>STATE_BACKGROUND</b> state.
|
||||
@ -116,7 +118,7 @@ public:
|
||||
* The extension in the <b>STATE_BACKGROUND</b> state is invisible.
|
||||
* You can override this function to implement your own processing logic.
|
||||
*/
|
||||
void OnBackground();
|
||||
void OnBackground() override;
|
||||
|
||||
/**
|
||||
* @brief Called when ui extension need dump info.
|
||||
@ -124,7 +126,7 @@ public:
|
||||
* @param params The params from ui extension.
|
||||
* @param info The dump info to show.
|
||||
*/
|
||||
void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info);
|
||||
void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info) override;
|
||||
|
||||
/**
|
||||
* @brief Called when startAbilityForResult(ohos.aafwk.content.Want,int32_t) is called to start an extension ability
|
||||
@ -136,17 +138,17 @@ public:
|
||||
* @param resultData Indicates the data returned after the ability is started. You can define the data returned. The
|
||||
* value can be null.
|
||||
*/
|
||||
void OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData);
|
||||
void OnAbilityResult(int32_t requestCode, int32_t resultCode, const Want &resultData) override;
|
||||
|
||||
/**
|
||||
* @brief Set ability info.
|
||||
*/
|
||||
void SetAbilityInfo(const std::shared_ptr<AppExecFwk::AbilityInfo> &abilityInfo);
|
||||
void SetAbilityInfo(const std::shared_ptr<AppExecFwk::AbilityInfo> &abilityInfo) override;
|
||||
|
||||
/**
|
||||
* @brief Set ui extension context.
|
||||
*/
|
||||
void SetContext(const std::shared_ptr<UIExtensionContext> &context);
|
||||
void SetContext(const std::shared_ptr<UIExtensionContext> &context) override;
|
||||
|
||||
private:
|
||||
void BindContext(napi_env env, napi_value obj);
|
||||
|
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_UI_EXTENSION_BASE_H
|
||||
#define OHOS_ABILITY_RUNTIME_UI_EXTENSION_BASE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "extension.h"
|
||||
#include "extension_base.h"
|
||||
#include "iremote_object.h"
|
||||
#include "ui_extension_context.h"
|
||||
#include "ui_extension_base_impl.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
template<class C = UIExtensionContext>
|
||||
class UIExtensionBase : public ExtensionBase<C> {
|
||||
public:
|
||||
UIExtensionBase() = default;
|
||||
virtual ~UIExtensionBase()
|
||||
{
|
||||
auto context = ExtensionBase<C>::GetContext();
|
||||
if (context != nullptr) {
|
||||
context->Unbind();
|
||||
}
|
||||
}
|
||||
|
||||
void Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<AppExecFwk::OHOSApplication> &application,
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token) override
|
||||
{
|
||||
ExtensionBase<C>::Init(record, application, handler, token);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->SetAbilityInfo(Extension::abilityInfo_);
|
||||
impl_->SetContext(ExtensionBase<C>::GetContext());
|
||||
auto extensionCommon = impl_->Init(record, application, handler, token);
|
||||
ExtensionBase<C>::SetExtensionCommon(extensionCommon);
|
||||
}
|
||||
}
|
||||
|
||||
void OnStart(const AAFwk::Want &want) override
|
||||
{
|
||||
Extension::OnStart(want);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnStart(want);
|
||||
}
|
||||
}
|
||||
|
||||
void OnCommand(const AAFwk::Want &want, bool restart, int startId) override
|
||||
{
|
||||
Extension::OnCommand(want, restart, startId);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnCommand(want, restart, startId);
|
||||
}
|
||||
}
|
||||
|
||||
void OnCommandWindow(const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo,
|
||||
AAFwk::WindowCommand winCmd) override
|
||||
{
|
||||
Extension::OnCommandWindow(want, sessionInfo, winCmd);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnCommandWindow(want, sessionInfo, winCmd);
|
||||
}
|
||||
}
|
||||
|
||||
void OnStop() override
|
||||
{
|
||||
Extension::OnStop();
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnStop();
|
||||
}
|
||||
}
|
||||
|
||||
void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) override
|
||||
{
|
||||
Extension::OnForeground(want, sessionInfo);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnForeground(want, sessionInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void OnBackground() override
|
||||
{
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnBackground();
|
||||
}
|
||||
Extension::OnBackground();
|
||||
}
|
||||
|
||||
void OnConfigurationUpdated(const AppExecFwk::Configuration& configuration) override
|
||||
{
|
||||
Extension::OnConfigurationUpdated(configuration);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnConfigurationUpdated(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info) override
|
||||
{
|
||||
Extension::Dump(params, info);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->Dump(params, info);
|
||||
}
|
||||
}
|
||||
|
||||
void OnAbilityResult(int requestCode, int resultCode, const Want &resultData) override
|
||||
{
|
||||
Extension::OnAbilityResult(requestCode, resultCode, resultData);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->OnAbilityResult(requestCode, resultCode, resultData);
|
||||
}
|
||||
}
|
||||
|
||||
void SetUIExtensionBaseImpl(std::unique_ptr<UIExtensionBaseImpl> impl)
|
||||
{
|
||||
impl_ = std::move(impl);
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<UIExtensionBaseImpl> impl_ = nullptr;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_UI_EXTENSION_BASE_H
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_UI_EXTENSION_BASE_IMPL_H
|
||||
#define OHOS_ABILITY_RUNTIME_UI_EXTENSION_BASE_IMPL_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "extension_common.h"
|
||||
#include "iremote_object.h"
|
||||
#include "ui_extension_context.h"
|
||||
#include "ui_extension_base_impl.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
class UIExtensionBaseImpl {
|
||||
public:
|
||||
UIExtensionBaseImpl() = default;
|
||||
virtual ~UIExtensionBaseImpl() = default;
|
||||
|
||||
virtual std::shared_ptr<ExtensionCommon> Init(const std::shared_ptr<AppExecFwk::AbilityLocalRecord> &record,
|
||||
const std::shared_ptr<AppExecFwk::OHOSApplication> &application,
|
||||
std::shared_ptr<AppExecFwk::AbilityHandler> &handler,
|
||||
const sptr<IRemoteObject> &token) = 0;
|
||||
|
||||
virtual void OnStart(const AAFwk::Want &want) = 0;
|
||||
|
||||
virtual void OnCommand(const AAFwk::Want &want, bool restart, int startId) = 0;
|
||||
|
||||
virtual void OnCommandWindow(const AAFwk::Want &want, const sptr<AAFwk::SessionInfo> &sessionInfo,
|
||||
AAFwk::WindowCommand winCmd) = 0;
|
||||
|
||||
virtual void OnStop() = 0;
|
||||
|
||||
virtual void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) = 0;
|
||||
|
||||
virtual void OnBackground() = 0;
|
||||
|
||||
virtual void OnConfigurationUpdated(const AppExecFwk::Configuration& configuration) = 0;
|
||||
|
||||
virtual void Dump(const std::vector<std::string> ¶ms, std::vector<std::string> &info) = 0;
|
||||
|
||||
virtual void OnAbilityResult(int requestCode, int resultCode, const Want &resultData) = 0;
|
||||
|
||||
virtual void SetAbilityInfo(const std::shared_ptr<AppExecFwk::AbilityInfo> &abilityInfo) = 0;
|
||||
|
||||
virtual void SetContext(const std::shared_ptr<UIExtensionContext> &context) = 0;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_UI_EXTENSION_BASE_IMPL_H
|
20
test/sample/BUILD.gn
Normal file
20
test/sample/BUILD.gn
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/ability/ability_runtime/ability_runtime.gni")
|
||||
|
||||
group("sample") {
|
||||
testonly = true
|
||||
|
||||
deps = [ "demo_ui_extension:ui_extension_sample" ]
|
||||
}
|
24
test/sample/demo_ui_extension/BUILD.gn
Normal file
24
test/sample/demo_ui_extension/BUILD.gn
Normal file
@ -0,0 +1,24 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/ability/ability_runtime/ability_runtime.gni")
|
||||
|
||||
group("ui_extension_sample") {
|
||||
deps = [
|
||||
"js/napi/demo_ui_extension_ability:demouiextensionability_napi",
|
||||
|
||||
# Compiling below so to a same so is also fine.
|
||||
"native/demo_ui_extension_ability:demo_ui_extension",
|
||||
"native/demo_ui_extension_ability:demo_ui_extension_module",
|
||||
]
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
es2abc_gen_abc("gen_demo_ui_extension_ability_abc") {
|
||||
src_js = rebase_path("demo_ui_extension_ability.js")
|
||||
dst_file = rebase_path(target_out_dir + "/demo_ui_extension_ability.abc")
|
||||
in_puts = [ "demo_ui_extension_ability.js" ]
|
||||
out_puts = [ target_out_dir + "/demo_ui_extension_ability.abc" ]
|
||||
extra_args = [ "--module" ]
|
||||
}
|
||||
|
||||
gen_js_obj("demo_ui_extension_ability_js") {
|
||||
input = "demo_ui_extension_ability.js"
|
||||
output = target_out_dir + "/demo_ui_extension_ability.o"
|
||||
}
|
||||
|
||||
gen_js_obj("demo_ui_extension_ability_abc") {
|
||||
input = get_label_info(":gen_demo_ui_extension_ability_abc",
|
||||
"target_out_dir") + "/demo_ui_extension_ability.abc"
|
||||
output = target_out_dir + "/demo_ui_extension_ability_abc.o"
|
||||
dep = ":gen_demo_ui_extension_ability_abc"
|
||||
}
|
||||
|
||||
ohos_shared_library("demouiextensionability_napi") {
|
||||
sanitize = {
|
||||
integer_overflow = true
|
||||
ubsan = true
|
||||
boundary_sanitize = true
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sources = [ "demo_ui_extension_ability_module.cpp" ]
|
||||
|
||||
deps = [
|
||||
":demo_ui_extension_ability_abc",
|
||||
":demo_ui_extension_ability_js",
|
||||
]
|
||||
|
||||
external_deps = [ "napi:ace_napi" ]
|
||||
|
||||
relative_install_dir = "module/app/ability"
|
||||
subsystem_name = "ability"
|
||||
part_name = "ability_runtime"
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
let UIExtensionAbility = requireNapi('app.ability.UIExtensionAbility');
|
||||
|
||||
class DemoUIExtensionAbility extends UIExtensionAbility {
|
||||
}
|
||||
|
||||
export default DemoUIExtensionAbility;
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "native_engine/native_engine.h"
|
||||
|
||||
extern const char _binary_demo_ui_extension_ability_js_start[];
|
||||
extern const char _binary_demo_ui_extension_ability_js_end[];
|
||||
extern const char _binary_demo_ui_extension_ability_abc_start[];
|
||||
extern const char _binary_demo_ui_extension_ability_abc_end[];
|
||||
|
||||
static napi_module demo_ui_extension_ability_module = {
|
||||
.nm_version = 1,
|
||||
.nm_flags = 0,
|
||||
.nm_filename = "app/ability/libdemouiextensionability_napi.so/demo_ui_extension_ability.js",
|
||||
.nm_register_func = nullptr,
|
||||
// Attension: the name should consistent with the DemoUIExtensionAbility.d.ts path
|
||||
.nm_modname = "app.ability.DemoUIExtensionAbility",
|
||||
.nm_priv = ((void *)0),
|
||||
.reserved = {0}
|
||||
};
|
||||
|
||||
extern "C" __attribute__((constructor))
|
||||
void NAPI_app_ability_DemoUIExtensionAbility_AutoRegister()
|
||||
{
|
||||
napi_module_register(&demo_ui_extension_ability_module);
|
||||
}
|
||||
|
||||
extern "C" __attribute__((visibility("default")))
|
||||
void NAPI_app_ability_DemoUIExtensionAbility_GetJSCode(const char **buf, int *bufLen)
|
||||
{
|
||||
if (buf != nullptr) {
|
||||
*buf = _binary_demo_ui_extension_ability_js_start;
|
||||
}
|
||||
|
||||
if (bufLen != nullptr) {
|
||||
*bufLen = _binary_demo_ui_extension_ability_js_end - _binary_demo_ui_extension_ability_js_start;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" __attribute__((visibility("default")))
|
||||
void NAPI_app_ability_DemoUIExtensionAbility_GetABCCode(const char **buf, int *buflen)
|
||||
{
|
||||
if (buf != nullptr) {
|
||||
*buf = _binary_demo_ui_extension_ability_abc_start;
|
||||
}
|
||||
if (buflen != nullptr) {
|
||||
*buflen = _binary_demo_ui_extension_ability_abc_end - _binary_demo_ui_extension_ability_abc_start;
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//foundation/ability/ability_runtime/ability_runtime.gni")
|
||||
|
||||
config("demo_ui_extension_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ui_extension_ability",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("demo_ui_extension") {
|
||||
sanitize = {
|
||||
integer_overflow = true
|
||||
ubsan = true
|
||||
boundary_sanitize = true
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
configs = [ ":demo_ui_extension_config" ]
|
||||
|
||||
sources = [
|
||||
"src/demo_ui_extension.cpp",
|
||||
"src/js_demo_ui_extension.cpp",
|
||||
]
|
||||
|
||||
# If not in ability_runtime repo, use external_deps
|
||||
deps = [
|
||||
"${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_napi_path}/inner/napi_common:napi_common",
|
||||
"${ability_runtime_native_path}/ability:ability_context_native",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"${ability_runtime_native_path}/appkit:app_context",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
"c_utils:utils",
|
||||
"eventhandler:libeventhandler",
|
||||
"hilog:libhilog",
|
||||
"hitrace:hitrace_meter",
|
||||
"ipc:ipc_napi",
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
if (ability_runtime_graphics) {
|
||||
external_deps += [ "window_manager:libwm" ]
|
||||
}
|
||||
|
||||
subsystem_name = "ability"
|
||||
part_name = "ability_runtime"
|
||||
}
|
||||
|
||||
config("demo_ui_extension_module_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native/ui_extension_ability",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
|
||||
"${ability_runtime_path}/interfaces/kits/native/ability/native",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("demo_ui_extension_module") {
|
||||
sanitize = {
|
||||
integer_overflow = true
|
||||
ubsan = true
|
||||
boundary_sanitize = true
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sources = [ "src/demo_ui_extension_module_loader.cpp" ]
|
||||
|
||||
configs = [
|
||||
":demo_ui_extension_module_config",
|
||||
":demo_ui_extension_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":demo_ui_extension",
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:extensionkit_native",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:configuration",
|
||||
"ability_base:session_info",
|
||||
"ability_base:want",
|
||||
"bundle_framework:appexecfwk_core",
|
||||
"hilog:libhilog",
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
relative_install_dir = "extensionability/"
|
||||
subsystem_name = "ability"
|
||||
part_name = "ability_runtime"
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_DEMO_UI_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_DEMO_UI_EXTENSION_H
|
||||
|
||||
#include "runtime.h"
|
||||
#include "ui_extension_base.h"
|
||||
#include "ui_extension_context.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
class DemoUIExtension : public UIExtensionBase<UIExtensionContext>,
|
||||
public std::enable_shared_from_this<DemoUIExtension> {
|
||||
public:
|
||||
DemoUIExtension() = default;
|
||||
~DemoUIExtension() override = default;
|
||||
|
||||
/**
|
||||
* @brief Create demo UI extension.
|
||||
*
|
||||
* @param runtime The runtime.
|
||||
* @return The demo UI extension instance.
|
||||
*/
|
||||
static DemoUIExtension *Create(const std::unique_ptr<Runtime> &runtime);
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_DEMO_UI_EXTENSION_H
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_DEMO_UI_EXTENSION_MODULE_LOADER_H
|
||||
#define OHOS_ABILITY_RUNTIME_DEMO_UI_EXTENSION_MODULE_LOADER_H
|
||||
|
||||
#include "extension_module_loader.h"
|
||||
#include "runtime.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
class DemoUIExtensionModuleLoader : public ExtensionModuleLoader,
|
||||
public Singleton<DemoUIExtensionModuleLoader> {
|
||||
DECLARE_SINGLETON(DemoUIExtensionModuleLoader);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Create Extension.
|
||||
*
|
||||
* @param runtime The runtime.
|
||||
* @return The Extension instance.
|
||||
*/
|
||||
Extension *Create(const std::unique_ptr<Runtime> &runtime) const override;
|
||||
|
||||
/**
|
||||
* @brief Get the Params object
|
||||
*
|
||||
* @return std::map<std::string, std::string> The map of extension type and extension name.
|
||||
*/
|
||||
std::map<std::string, std::string> GetParams() override;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_DEMO_UI_EXTENSION_MODULE_LOADER_H
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_ABILITY_RUNTIME_JS_DEMO_UI_EXTENSION_H
|
||||
#define OHOS_ABILITY_RUNTIME_JS_DEMO_UI_EXTENSION_H
|
||||
|
||||
#include "demo_ui_extension.h"
|
||||
#include "runtime.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
class JsDemoUIExtension : public DemoUIExtension,
|
||||
public std::enable_shared_from_this<JsDemoUIExtension> {
|
||||
public:
|
||||
explicit JsDemoUIExtension(const std::unique_ptr<Runtime> &runtime);
|
||||
~JsDemoUIExtension() override;
|
||||
|
||||
/**
|
||||
* @brief Create JsDemoUIExtension.
|
||||
*
|
||||
* @param runtime The runtime.
|
||||
* @return The JsDemoUIExtension instance.
|
||||
*/
|
||||
static JsDemoUIExtension *Create(const std::unique_ptr<Runtime> &runtime);
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ABILITY_RUNTIME_JS_DEMO_UI_EXTENSION_H
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "demo_ui_extension.h"
|
||||
|
||||
#include "hilog_tag_wrapper.h"
|
||||
#include "js_demo_ui_extension.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
DemoUIExtension *DemoUIExtension::Create(const std::unique_ptr<Runtime> &runtime)
|
||||
{
|
||||
HILOG_DEBUG("Create demo extension.");
|
||||
if (runtime == nullptr) {
|
||||
return new DemoUIExtension();
|
||||
}
|
||||
|
||||
switch (runtime->GetLanguage()) {
|
||||
case Runtime::Language::JS:
|
||||
return JsDemoUIExtension::Create(runtime);
|
||||
default:
|
||||
return new (std::nothrow) DemoUIExtension();
|
||||
}
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "demo_ui_extension_module_loader.h"
|
||||
|
||||
#include "demo_ui_extension.h"
|
||||
#include "hilog_tag_wrapper.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
DemoUIExtensionModuleLoader::DemoUIExtensionModuleLoader() = default;
|
||||
DemoUIExtensionModuleLoader::~DemoUIExtensionModuleLoader() = default;
|
||||
|
||||
Extension *DemoUIExtensionModuleLoader::Create(const std::unique_ptr<Runtime> &runtime) const
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::TEST, "Create demo uiextension module loader.");
|
||||
return DemoUIExtension::Create(runtime);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> DemoUIExtensionModuleLoader::GetParams()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::TEST, "Get demo uiextension module params.");
|
||||
std::map<std::string, std::string> params;
|
||||
// type means extension type in ExtensionAbilityType of extension_ability_info.h, 5000 means demo_ui_extension.
|
||||
params.insert(std::pair<std::string, std::string>("type", "5000"));
|
||||
params.insert(std::pair<std::string, std::string>("name", "DemoUIExtensionAbility"));
|
||||
return params;
|
||||
}
|
||||
|
||||
extern "C" __attribute__((visibility("default"))) void *OHOS_EXTENSION_GetExtensionModule()
|
||||
{
|
||||
return &DemoUIExtensionModuleLoader::GetInstance();
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "js_demo_ui_extension.h"
|
||||
|
||||
#include "hilog_wrapper.h"
|
||||
#include "js_ui_extension_base.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
JsDemoUIExtension *JsDemoUIExtension::Create(const std::unique_ptr<Runtime> &runtime)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::TEST, "Create js demo uiextension.");
|
||||
return new JsDemoUIExtension(runtime);
|
||||
}
|
||||
|
||||
JsDemoUIExtension::JsDemoUIExtension(const std::unique_ptr<Runtime> &runtime)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::TEST, "Js demo uiextension constructor.");
|
||||
auto uiExtensionBaseImpl = std::make_unique<JsUIExtensionBase>(runtime);
|
||||
SetUIExtensionBaseImpl(std::move(uiExtensionBaseImpl));
|
||||
}
|
||||
|
||||
JsDemoUIExtension::~JsDemoUIExtension()
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::TEST, "Js demo uiextension destructor.");
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
@ -2355,6 +2355,7 @@ ohos_unittest("action_extension_module_loader_test") {
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:action_extension",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"//third_party/googletest:gmock_main",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
@ -2382,6 +2383,7 @@ ohos_unittest("action_extension_test") {
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:action_extension",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"${ability_runtime_native_path}/appkit:app_context",
|
||||
"${ability_runtime_native_path}/appkit:appkit_native",
|
||||
"//third_party/googletest:gmock_main",
|
||||
@ -2415,6 +2417,7 @@ ohos_unittest("share_extension_module_loader_test") {
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:share_extension",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"${ability_runtime_native_path}/appkit:app_context",
|
||||
"${ability_runtime_native_path}/appkit:appkit_native",
|
||||
"//third_party/googletest:gmock_main",
|
||||
@ -2446,6 +2449,7 @@ ohos_unittest("share_extension_test") {
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:share_extension",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"${ability_runtime_native_path}/appkit:app_context",
|
||||
"${ability_runtime_native_path}/appkit:appkit_native",
|
||||
"//third_party/googletest:gmock_main",
|
||||
@ -2541,6 +2545,7 @@ ohos_unittest("embedded_ui_extension_module_loader_test") {
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:embedded_ui_extension",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"//third_party/googletest:gmock_main",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
@ -2568,6 +2573,7 @@ ohos_unittest("embedded_ui_extension_test") {
|
||||
"${ability_runtime_innerkits_path}/runtime:runtime",
|
||||
"${ability_runtime_native_path}/ability/native:abilitykit_native",
|
||||
"${ability_runtime_native_path}/ability/native:embedded_ui_extension",
|
||||
"${ability_runtime_native_path}/ability/native:ui_extension",
|
||||
"${ability_runtime_native_path}/appkit:app_context",
|
||||
"${ability_runtime_native_path}/appkit:appkit_native",
|
||||
"//third_party/googletest:gmock_main",
|
||||
|
Loading…
Reference in New Issue
Block a user