diff --git a/interfaces/innerkits/wm/window.h b/interfaces/innerkits/wm/window.h index 55468f40b200f982fe3a7dabb562154380e56ee2..ef1cc1a0a9f4463c846a9e1405d0823348c63292 100644 --- a/interfaces/innerkits/wm/window.h +++ b/interfaces/innerkits/wm/window.h @@ -2200,9 +2200,6 @@ public: virtual WMError NapiSetUIContentByName(const std::string& contentName, napi_env env, napi_value storage, BackupAndRestoreType type = BackupAndRestoreType::NONE, sptr token = nullptr, AppExecFwk::Ability* ability = nullptr) { return WMError::WM_OK; } - virtual WMError NapiSetUIContentByName(const std::string& contentName, ani_env* env, ani_object storage, - BackupAndRestoreType type = BackupAndRestoreType::NONE, sptr token = nullptr, - AppExecFwk::Ability* ability = nullptr) { return WMError::WM_OK; } virtual WMError AniSetUIContentByName(const std::string& contentName, ani_env* env, ani_object storage, BackupAndRestoreType type = BackupAndRestoreType::NONE, sptr token = nullptr, AppExecFwk::Ability* ability = nullptr) { return WMError::WM_OK; } diff --git a/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window_listener.cpp b/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window_listener.cpp index ccb884c947d32418cd2a9b3fb5e452093f78d150..15e73319fee613d73fed92dbed264f5a10107f90 100644 --- a/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window_listener.cpp +++ b/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window_listener.cpp @@ -27,8 +27,11 @@ using namespace AbilityRuntime; AniWindowListener::~AniWindowListener() { - ani_status ret = env_->GlobalReference_Delete(aniCallback_); - TLOGI(WmsLogTag::DEFAULT, "[ANI]~AniWindowListener ret:%{public}d", static_cast(ret)); + ani_status ret = ANI_OK; + if (env_ != nullptr && aniCallback_ != nullptr) { + ret = env_->GlobalReference_Delete(aniCallback_); + } + TLOGI(WmsLogTag::DEFAULT, "[ANI]~AniWindowListener ret: %{public}u", ret); } void AniWindowListener::OnLastStrongRef(const void *) diff --git a/wm/include/window_extension_session_impl.h b/wm/include/window_extension_session_impl.h index ead7a8592a696c824d7872c50b93af67e80a977f..29a83d730a70d69b2c877b02f03e55291e2d578a 100644 --- a/wm/include/window_extension_session_impl.h +++ b/wm/include/window_extension_session_impl.h @@ -72,14 +72,10 @@ public: WMError NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; - WMError NapiSetUIContent(const std::string& contentInfo, ani_env* env, ani_object storage, - BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; WMError AniSetUIContent(const std::string& contentInfo, ani_env* env, ani_object storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; WMError NapiSetUIContentByName(const std::string& contentName, napi_env env, napi_value storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; - WMError NapiSetUIContentByName(const std::string& contentName, ani_env* env, ani_object storage, - BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; WMError AniSetUIContentByName(const std::string& contentName, ani_env* env, ani_object storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; void SetUniqueVirtualPixelRatio(bool useUniqueDensity, float virtualPixelRatio) override {} diff --git a/wm/src/window_extension_session_impl.cpp b/wm/src/window_extension_session_impl.cpp index 1337644318c947ee30681d77165066179d8da953..631bf51f4e2d66496b7677852f78e234a23b272e 100644 --- a/wm/src/window_extension_session_impl.cpp +++ b/wm/src/window_extension_session_impl.cpp @@ -705,12 +705,6 @@ WMError WindowExtensionSessionImpl::NapiSetUIContent(const std::string& contentI return SetUIContentInner(contentInfo, env, storage, token, ability, false, EnvironmentType::NAPI); } -WMError WindowExtensionSessionImpl::NapiSetUIContent(const std::string& contentInfo, ani_env* env, ani_object storage, - BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) -{ - return SetUIContentInner(contentInfo, env, storage, token, ability, false, EnvironmentType::ANI); -} - WMError WindowExtensionSessionImpl::AniSetUIContent(const std::string& contentInfo, ani_env* env, ani_object storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) { @@ -724,13 +718,6 @@ WMError WindowExtensionSessionImpl::NapiSetUIContentByName(const std::string& co return SetUIContentInner(contentName, env, storage, token, ability, true, EnvironmentType::NAPI); } -WMError WindowExtensionSessionImpl::NapiSetUIContentByName(const std::string& contentName, ani_env* env, - ani_object storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) -{ - TLOGI(WmsLogTag::WMS_UIEXT, "name: %{public}s", contentName.c_str()); - return SetUIContentInner(contentName, env, storage, token, ability, true, EnvironmentType::ANI); -} - WMError WindowExtensionSessionImpl::AniSetUIContentByName(const std::string& contentName, ani_env* env, ani_object storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) {