diff --git a/frameworks/ets/ani/ani_common/BUILD.gn b/frameworks/ets/ani/ani_common/BUILD.gn index aa4d97e986e2cfa66713c082d598e48c76d61e83..6ea77a0ed840b0b491fe7126c3b4b3bd5647b36d 100644 --- a/frameworks/ets/ani/ani_common/BUILD.gn +++ b/frameworks/ets/ani/ani_common/BUILD.gn @@ -60,7 +60,6 @@ ohos_shared_library("ani_common") { "src/ets_error_utils.cpp", "src/ets_extension_context.cpp", "src/ets_free_install_observer.cpp", - "src/ani_common_remote.cpp", ] cflags = [] @@ -96,10 +95,9 @@ ohos_shared_library("ani_common") { "hilog:libhilog", "hitrace:hitrace_meter", "image_framework:image_ani", - "ipc:rpc_ani", + "ipc:rpc_taihe", "ipc:ipc_core", "ipc:ipc_napi", - "ipc:rpc_ani", "json:nlohmann_json_static", "napi:ace_napi", "resource_management:global_resmgr", diff --git a/frameworks/ets/ani/ani_common/include/ani_common_remote.h b/frameworks/ets/ani/ani_common/include/ani_common_remote.h deleted file mode 100644 index a8fe380d9d7f59842db651c00a77a99b88503299..0000000000000000000000000000000000000000 --- a/frameworks/ets/ani/ani_common/include/ani_common_remote.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -#ifndef OHOS_ABILITY_RUNTIME_ANI_REMOTE_H -#define OHOS_ABILITY_RUNTIME_ANI_REMOTE_H - -#include "ani.h" -#include "ani_remote_object.h" - -namespace OHOS { -namespace AbilityRuntime { - -class AniRemote { -public: - static ani_object CreateAniRemoteObject(ani_env *env, const sptr target); -}; -} // namespace AbilityRuntime -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ANI_REMOTE_H \ No newline at end of file diff --git a/frameworks/ets/ani/ani_common/src/ani_common_remote.cpp b/frameworks/ets/ani/ani_common/src/ani_common_remote.cpp deleted file mode 100644 index f74600380b2d68ca5ee3d2364a5600f9ce27a8ff..0000000000000000000000000000000000000000 --- a/frameworks/ets/ani/ani_common/src/ani_common_remote.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 "ani_common_remote.h" - -#include "hilog_tag_wrapper.h" - -namespace OHOS { -namespace AbilityRuntime { -ani_object AniRemote::CreateAniRemoteObject(ani_env *env, const sptr target) -{ - ani_status status = ANI_ERROR; - ani_class cls {}; - ani_method method = nullptr; - if ((status = env->FindClass("L@ohos/rpc/rpc/RemoteProxy;", &cls)) != ANI_OK) { - TAG_LOGE(AAFwkTag::ABILITY, "FindClass RemoteProxy: %{public}d", status); - return nullptr; - } - if ((status = env->Class_FindMethod(cls, "", "l:", &method)) != ANI_OK) { - TAG_LOGE(AAFwkTag::ABILITY, "RemoteProxy ctor: %{public}d", status); - return nullptr; - } - ani_object remoteObj = nullptr; - if ((status = env->Object_New(cls, method, &remoteObj, (ani_long)(target.GetRefPtr()))) != ANI_OK) { - TAG_LOGE(AAFwkTag::ABILITY, "RemoteProxy create: %{public}d", status); - return nullptr; - } - return remoteObj; -} -} // namespace AbilityRuntime -} // namespace OHOS \ No newline at end of file diff --git a/frameworks/ets/ani/ani_common/src/ani_common_want.cpp b/frameworks/ets/ani/ani_common/src/ani_common_want.cpp index 9c638af8fb9f22d9289661001af94ef2cd370d0f..e84a544fc1f25095c03fb59ae080ae5a1c1ad69e 100644 --- a/frameworks/ets/ani/ani_common/src/ani_common_want.cpp +++ b/frameworks/ets/ani/ani_common/src/ani_common_want.cpp @@ -15,7 +15,7 @@ #include "ani_common_want.h" #include "ani_common_util.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "array_wrapper.h" #include "bool_wrapper.h" #include "byte_wrapper.h" diff --git a/frameworks/ets/ani/caller_complex/BUILD.gn b/frameworks/ets/ani/caller_complex/BUILD.gn index 8f835927e4b0b1efb517fa3d5fb47a00a9d4b503..ef58253a9764eb3c1b19c84fa02b29ea23550780 100644 --- a/frameworks/ets/ani/caller_complex/BUILD.gn +++ b/frameworks/ets/ani/caller_complex/BUILD.gn @@ -49,7 +49,7 @@ ohos_shared_library("caller_complex_ani") { "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", - "ipc:rpc_ani", + "ipc:rpc_taihe", "napi:ace_napi", "runtime_core:ani", "runtime_core:ani_helpers", diff --git a/frameworks/ets/ani/caller_complex/src/ets_caller_complex.cpp b/frameworks/ets/ani/caller_complex/src/ets_caller_complex.cpp index 16983755c594c7acd6308a4c360e7d80d18f85aa..58d8540e2806feb112a2e0fc9091d53b5caa3e9a 100644 --- a/frameworks/ets/ani/caller_complex/src/ets_caller_complex.cpp +++ b/frameworks/ets/ani/caller_complex/src/ets_caller_complex.cpp @@ -17,7 +17,7 @@ #include "ability_business_error.h" #include "ability_runtime/js_caller_complex.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "ets_error_utils.h" #include "hilog_tag_wrapper.h" #include "interop_js/arkts_esvalue.h" diff --git a/frameworks/ets/ani/service_extension_ability/src/ets_service_extension.cpp b/frameworks/ets/ani/service_extension_ability/src/ets_service_extension.cpp index c5e26b60281f1aa4d36b0ae67311f08766869379..fc0ad5044d2efd29b2520cd7a20962fd11c1ab8e 100644 --- a/frameworks/ets/ani/service_extension_ability/src/ets_service_extension.cpp +++ b/frameworks/ets/ani/service_extension_ability/src/ets_service_extension.cpp @@ -20,7 +20,7 @@ #include "ability_manager_client.h" #include "ani_common_configuration.h" #include "ani_common_want.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "configuration_utils.h" #include "ets_service_extension_context.h" #include "hilog_tag_wrapper.h" diff --git a/frameworks/ets/ani/service_extension_ability/src/ets_service_extension_context.cpp b/frameworks/ets/ani/service_extension_ability/src/ets_service_extension_context.cpp index 965c6196e9618d7cd50e60df92e755bc9a08ee55..f5c5686f099b417b5d92e1f17f49dc393a293946 100644 --- a/frameworks/ets/ani/service_extension_ability/src/ets_service_extension_context.cpp +++ b/frameworks/ets/ani/service_extension_ability/src/ets_service_extension_context.cpp @@ -16,9 +16,8 @@ #include "ability_manager_client.h" #include "ani_common_start_options.h" -#include "ani_common_remote.h" #include "ani_common_want.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "common_fun_ani.h" #include "ets_context_utils.h" #include "ets_error_utils.h" @@ -667,7 +666,7 @@ void ETSServiceExtensionConnection::OnAbilityConnectDone( DetachCurrentThread(); return; } - ani_object refRemoteObject = AniRemote::CreateAniRemoteObject(env, remoteObject); + ani_object refRemoteObject = ANI_ohos_rpc_CreateJsRemoteObject(env, remoteObject); if (refRemoteObject == nullptr) { TAG_LOGE(AAFwkTag::SERVICE_EXT, "null refRemoteObject"); DetachCurrentThread(); diff --git a/frameworks/ets/ani/ui_ability/src/ets_ability_context.cpp b/frameworks/ets/ani/ui_ability/src/ets_ability_context.cpp index 709f81007be98d8a03194650e464f0a5b1b534cd..b37a4e3d9e72ebbbf4d3767b27015a03fd378cad 100644 --- a/frameworks/ets/ani/ui_ability/src/ets_ability_context.cpp +++ b/frameworks/ets/ani/ui_ability/src/ets_ability_context.cpp @@ -20,10 +20,9 @@ #include "ani_common_ability_result.h" #include "ani_common_configuration.h" #include "ani_common_start_options.h" -#include "ani_common_remote.h" #include "ani_common_want.h" #include "ani_enum_convert.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "app_utils.h" #include "common_fun_ani.h" #include "interop_js/arkts_esvalue.h" @@ -1545,7 +1544,7 @@ void ETSAbilityConnection::OnAbilityConnectDone( DetachCurrentThread(); return; } - ani_object refRemoteObject = AniRemote::CreateAniRemoteObject(env, remoteObject); + ani_object refRemoteObject = ANI_ohos_rpc_CreateJsRemoteObject(env, remoteObject); if (refRemoteObject == nullptr) { TAG_LOGE(AAFwkTag::CONTEXT, "null refRemoteObject"); DetachCurrentThread(); diff --git a/frameworks/ets/ani/ui_ability/src/ets_ui_ability.cpp b/frameworks/ets/ani/ui_ability/src/ets_ui_ability.cpp index 6aeb0e9b8a35f3ac622c2aa6fcff30682d7df833..d4d6f6eaeb77c5b8646a92d5bb78335a7b6fcc44 100644 --- a/frameworks/ets/ani/ui_ability/src/ets_ui_ability.cpp +++ b/frameworks/ets/ani/ui_ability/src/ets_ui_ability.cpp @@ -21,7 +21,7 @@ #include "ani_common_configuration.h" #include "ani_common_want.h" #include "ani_enum_convert.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #ifdef SUPPORT_SCREEN #include "ani_window_stage.h" #endif diff --git a/frameworks/ets/ani/ui_extension_ability/src/ets_ui_extension_context.cpp b/frameworks/ets/ani/ui_extension_ability/src/ets_ui_extension_context.cpp index d02e40c9dfa26587efc4ed92da9f2ac46f72795d..cd6a1df7db11580ba2aef91eb30cd08dd8e1eac9 100644 --- a/frameworks/ets/ani/ui_extension_ability/src/ets_ui_extension_context.cpp +++ b/frameworks/ets/ani/ui_extension_ability/src/ets_ui_extension_context.cpp @@ -17,10 +17,9 @@ #include "ability_manager_client.h" #include "ani_common_ability_result.h" #include "ani_common_start_options.h" -#include "ani_common_remote.h" #include "ani_common_want.h" #include "ani_enum_convert.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "common_fun_ani.h" #include "ets_context_utils.h" #include "ets_error_utils.h" @@ -786,7 +785,7 @@ void EtsUIExtensionConnection::OnAbilityConnectDone(const AppExecFwk::ElementNam DetachCurrentThread(); return; } - ani_object refRemoteObject = AniRemote::CreateAniRemoteObject(env, remoteObject); + ani_object refRemoteObject = ANI_ohos_rpc_CreateJsRemoteObject(env, remoteObject); if (refRemoteObject == nullptr) { TAG_LOGE(AAFwkTag::UI_EXT, "null refRemoteObject"); DetachCurrentThread(); diff --git a/frameworks/ets/ani/want/BUILD.gn b/frameworks/ets/ani/want/BUILD.gn index 51e2f6360d178eac88ba8bcd6741aa56fecaa355..33017fcaae327580980b5a622e7aa99994bd8ad1 100644 --- a/frameworks/ets/ani/want/BUILD.gn +++ b/frameworks/ets/ani/want/BUILD.gn @@ -42,7 +42,7 @@ ohos_shared_library("want_ani_kit") { "ability_base:base", "c_utils:utils", "hilog:libhilog", - "ipc:rpc_ani", + "ipc:rpc_taihe", "runtime_core:ani", ] diff --git a/frameworks/ets/ani/want/src/ani_want_module.cpp b/frameworks/ets/ani/want/src/ani_want_module.cpp index 1726c10222da825b35185f5cdd78366598285259..7d8368c21961a949d1ebb6b2a277f91105dfad61 100644 --- a/frameworks/ets/ani/want/src/ani_want_module.cpp +++ b/frameworks/ets/ani/want/src/ani_want_module.cpp @@ -16,7 +16,7 @@ #include "ani_want_module.h" #include "ani_common_util.h" -#include "ani_remote_object.h" +#include "remote_object_taihe_ani.h" #include "array_wrapper.h" #include "bool_wrapper.h" #include "double_wrapper.h" diff --git a/frameworks/native/ability/native/BUILD.gn b/frameworks/native/ability/native/BUILD.gn index b4759c3826c7336da6e84f1dad60aa2b35349a09..971c17c74e1bc3af649e1185638d9ee78cc03bf8 100644 --- a/frameworks/native/ability/native/BUILD.gn +++ b/frameworks/native/ability/native/BUILD.gn @@ -930,7 +930,7 @@ ohos_shared_library("ui_ability_ani") { "hitrace:hitrace_meter", "ipc:ipc_core", "ipc:ipc_napi", - "ipc:rpc_ani", + "ipc:rpc_taihe", "resource_management:global_resmgr", "runtime_core:ani", "runtime_core:ani_helpers", @@ -1434,7 +1434,7 @@ ohos_shared_library("service_extension") { "hitrace:hitrace_meter", "ipc:ipc_core", "ipc:ipc_napi", - "ipc:rpc_ani", + "ipc:rpc_taihe", "napi:ace_napi", "safwk:system_ability_fwk", "samgr:samgr_proxy", @@ -1507,7 +1507,7 @@ ohos_shared_library("service_extension_ani") { "hitrace:hitrace_meter", "ipc:ipc_core", "ipc:ipc_napi", - "ipc:rpc_ani", + "ipc:rpc_taihe", "runtime_core:ani", "safwk:system_ability_fwk", "samgr:samgr_proxy", @@ -2153,7 +2153,7 @@ ohos_shared_library("ui_extension_ani") { "hitrace:hitrace_meter", "ipc:ipc_core", "ipc:ipc_napi", - "ipc:rpc_ani", + "ipc:rpc_taihe", "window_manager:embeddablewindowstage_kit", "window_manager:embeddablewindowstageani_kit", "window_manager:extensionwindow_napi",