diff --git a/frameworks/ets/ani/BUILD.gn b/frameworks/ets/ani/BUILD.gn index f487ec8a1225f3956c9d5fa7ec48d2bfa9ee867f..2526fe9d6b2899a58e8346e75d83838259150795 100644 --- a/frameworks/ets/ani/BUILD.gn +++ b/frameworks/ets/ani/BUILD.gn @@ -21,6 +21,7 @@ group("ani_packages") { "${ability_runtime_path}/frameworks/ets/ani/ani_common:ani_common", "${ability_runtime_path}/frameworks/ets/ani/ani_wantagent_common:ani_wantagent_common", "${ability_runtime_path}/frameworks/ets/ani/app_manager:ability_app_manager_ani_kit", + "${ability_runtime_path}/frameworks/ets/ani/app_startup:appstartup_startup_config_entry_ani_kit", "${ability_runtime_path}/frameworks/ets/ani/form_extension_ability:form_extension_ability_etc", "${ability_runtime_path}/frameworks/ets/ani/insight_intent/insight_intent_driver:insight_intent_driver_ani_kit", "${ability_runtime_path}/frameworks/ets/ani/native_constructor:context_ani", diff --git a/frameworks/ets/ani/app_startup/BUILD.hn b/frameworks/ets/ani/app_startup/BUILD.hn new file mode 100644 index 0000000000000000000000000000000000000000..474f376a294d2b8ca87ddbf9bd7f22f12b1e2171 --- /dev/null +++ b/frameworks/ets/ani/app_startup/BUILD.hn @@ -0,0 +1,82 @@ +# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") + +ohos_shared_library("appstartup_startup_config_entry_ani_kit") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + + include_dirs = [ + "./include", + "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app", + "${ability_runtime_services_path}/common/include", + "${ability_runtime_path}/frameworks/ets/ani/ani_common/include", + "${ability_runtime_path}/interfaces/kits/native/ability/native", + "${ability_runtime_path}/interfaces/inner_api/runtime/include", + "${ability_runtime_path}/frameworks/ets/ani/enum_convert", + "${ability_runtime_path}/interfaces/inner_api/error_utils/include", + "${ability_runtime_path}/interfaces/kits/native/appkit/app_startup", + ] + + configs = [] + + public_configs = [] + + sources = [ + "./src/ets_startup_manager.cpp", + ] + + cflags = [] + if (target_cpu == "arm") { + cflags += [ "-DBINDER_IPC_32BIT" ] + } + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_innerkits_path}/runtime:runtime", + "${ability_runtime_native_path}/appkit:app_context", + "${ability_runtime_path}/frameworks/ets/ani/ani_common:ani_common", + "${ability_runtime_native_path}/appkit:appkit_native", + ] + + external_deps = [ + "ability_base:base", + "ability_base:configuration", + "c_utils:utils", + "eventhandler:libeventhandler", + "hilog:libhilog", + "ipc:ipc_core", + "ipc:ipc_napi", + "napi:ace_napi", + "runtime_core:ani", + "samgr:samgr_proxy", + ] + + if (ability_runtime_graphics) { + external_deps += [ "access_token:libtokenid_sdk" ] + defines = [ "SUPPORT_SCREEN" ] + } + + innerapi_tags = [ "platformsdk" ] + subsystem_name = "ability" + part_name = "ability_runtime" +} \ No newline at end of file diff --git a/frameworks/ets/ani/app_startup/include/ets_startup_manager.h b/frameworks/ets/ani/app_startup/include/ets_startup_manager.h new file mode 100644 index 0000000000000000000000000000000000000000..0b9f37f98a12555169c58f84ae325ae6d155f443 --- /dev/null +++ b/frameworks/ets/ani/app_startup/include/ets_startup_manager.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_ETS_AUTO_FILL_MANAGER_H +#define OHOS_ABILITY_RUNTIME_ETS_AUTO_FILL_MANAGER_H + +#include +#include "ets_startup_manager.h" +#include "sts_runtime.h" +#include "startup_config.h" +#include "startup_manager.h" +#include "native_engine/native_value.h" + +namespace OHOS { +namespace AbilityRuntime { + +class EtsStartupManager { + + std::shared_ptr config_; + + int32_t GetConfig(ani_env *env, ani_int value, std::shared_ptr &config); + + void OnConfig(std::shared_ptr &config); +}; + +} // namespace AbilityRuntime +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_ETS_AUTO_FILL_MANAGER_H \ No newline at end of file diff --git a/frameworks/ets/ani/app_startup/src/ets_startup_manager.cpp b/frameworks/ets/ani/app_startup/src/ets_startup_manager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ad8f51b7a5d88f121ca8ee4530465b442bfdb0d --- /dev/null +++ b/frameworks/ets/ani/app_startup/src/ets_startup_manager.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025 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 "ets_startup_manager.h" +#include "ability_runtime_error_util.h" +#include "hilog_tag_wrapper.h" +#include "napi/native_api.h" +#include "startup_manager.h" +#include "sts_error_utils.h" +#include + + +namespace OHOS { +namespace AbilityRuntime { + +int32_t EtsStartupManager::GetConfig(ani_env *env, ani_int value, std::shared_ptr &config) +{ + TAG_LOGD(AAFwkTag::STARTUP, "called"); + + if (env == nullptr) { + TAG_LOGE(AAFwkTag::STARTUP, "null env"); + return ERR_STARTUP_INVALID_VALUE; + } +} + +void EtsStartupManager::OnConfig(std::shared_ptr &config) +{ + config_ = config; +} + +} // namespace AbilityRuntime +} // namespace OHOS \ No newline at end of file diff --git a/frameworks/ets/ets/@ohos.app.appstartup.StartupConfigEntry.ets b/frameworks/ets/ets/@ohos.app.appstartup.StartupConfigEntry.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0de5f7bec764616044761a238ad069e6dc06c1d --- /dev/null +++ b/frameworks/ets/ets/@ohos.app.appstartup.StartupConfigEntry.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 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 StartupConfig from './@ohos.app.appstartup.StartupConfig'; + +class StartupConfigEntry { + + onConfig?(): StartupConfig {} + +} + +export default StartupConfigEntry; \ No newline at end of file diff --git a/frameworks/ets/ets/BUILD.gn b/frameworks/ets/ets/BUILD.gn index ae9a2fc41a8f842691e9361c2f8754eadd4a9fb2..95012b893492916de7f974e43a545d23e94657a3 100644 --- a/frameworks/ets/ets/BUILD.gn +++ b/frameworks/ets/ets/BUILD.gn @@ -800,6 +800,22 @@ ohos_prebuilt_etc("ability_runtime_insight_intent_executor_abc_etc") { deps = [ ":ability_runtime_insight_intent_executor_abc" ] } +generate_static_abc("ability_runtime_startup_config_entry_abc") { + base_url = "./" + files = [ "./@ohos.app.appstartup.StartupConfigEntry.ets" ] + + is_boot_abc = "True" + device_dst_file = "/system/framework/ability_runtime_startup_config_entry_abc.abc" +} + +ohos_prebuilt_etc("ability_runtime_startup_config_entry_abc_etc") { + source = "$target_out_dir/ability_runtime_startup_config_entry_abc.abc" + module_install_dir = "framework" + subsystem_name = "ability" + part_name = "ability_runtime" + deps = [ ":ability_runtime_startup_config_entry_abc" ] +} + group("ets_packages") { deps = [ ":ability_ability_application_abc_etc", @@ -839,6 +855,7 @@ group("ets_packages") { ":ability_runtime_running_multi_appinfo_abc_etc", ":ability_runtime_shell_cmd_result_abc_etc", ":ability_runtime_start_options_abc_etc", + ":ability_runtime_startup_config_entry_abc_etc", ":ability_runtime_trigger_info_abc_etc", ":ability_runtime_ui_ability_abc_etc", ":ability_runtime_ui_ability_context_abc_etc",