From 2e0cf008ecb20164c8227218998a79be1fcd7422 Mon Sep 17 00:00:00 2001 From: xiahaiqin Date: Wed, 14 Dec 2022 17:03:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=90=8C=E5=90=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8CAbilityInfo->SceneAbilityInfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiahaiqin Change-Id: I3b100537bfdbf7583e7189504e79506ff0f46ab7 --- .../interfaces/innerkits/scene_session_interface.h | 2 +- window_scene/interfaces/innerkits/scene_session_stage.h | 2 +- window_scene/interfaces/innerkits/window_scene_common.h | 2 +- .../kits/napi/host/js_scene_session_manager.cpp | 4 ++-- window_scene/interfaces/kits/napi/host/js_scene_utils.cpp | 2 +- window_scene/interfaces/kits/napi/host/js_scene_utils.h | 2 +- .../session/container/src/scene_session_stage.cpp | 2 +- window_scene/session/host/include/scene_session.h | 8 ++++---- window_scene/session/host/include/scene_session_manager.h | 2 +- .../session/host/include/zidl/scene_session_proxy.h | 2 +- window_scene/session/host/src/scene_session.cpp | 6 +++--- window_scene/session/host/src/scene_session_manager.cpp | 2 +- .../session/host/src/zidl/scene_session_proxy.cpp | 2 +- window_scene/session/host/src/zidl/scene_session_stub.cpp | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/window_scene/interfaces/innerkits/scene_session_interface.h b/window_scene/interfaces/innerkits/scene_session_interface.h index 4b985e516a..93a766fb3e 100644 --- a/window_scene/interfaces/innerkits/scene_session_interface.h +++ b/window_scene/interfaces/innerkits/scene_session_interface.h @@ -40,7 +40,7 @@ public: virtual WSError Close() = 0; virtual WSError Recover() = 0; virtual WSError Maximum() = 0; - virtual WSError StartScene(const AbilityInfo& info, SessionOption sessionOption) = 0; + virtual WSError StartScene(const SceneAbilityInfo& info, SessionOption sessionOption) = 0; }; } #endif // OHOS_SCENE_SESSION_INTERFACE_H \ No newline at end of file diff --git a/window_scene/interfaces/innerkits/scene_session_stage.h b/window_scene/interfaces/innerkits/scene_session_stage.h index e19cb5de93..e2c8a966e4 100644 --- a/window_scene/interfaces/innerkits/scene_session_stage.h +++ b/window_scene/interfaces/innerkits/scene_session_stage.h @@ -34,7 +34,7 @@ public: virtual WSError Background() override; virtual WSError Disconnect() override; - WSError StartScene(const AbilityInfo& info, SessionOption sessionOption); + WSError StartScene(const SceneAbilityInfo& info, SessionOption sessionOption); WSError Minimize(); WSError Close(); WSError Recover(); diff --git a/window_scene/interfaces/innerkits/window_scene_common.h b/window_scene/interfaces/innerkits/window_scene_common.h index 345109b559..21b71b2ceb 100644 --- a/window_scene/interfaces/innerkits/window_scene_common.h +++ b/window_scene/interfaces/innerkits/window_scene_common.h @@ -61,7 +61,7 @@ enum class SessionState : uint32_t { STATE_BACKGROUND, }; -struct AbilityInfo { +struct SceneAbilityInfo { std::string bundleName_ = ""; std::string abilityName_ = ""; }; diff --git a/window_scene/interfaces/kits/napi/host/js_scene_session_manager.cpp b/window_scene/interfaces/kits/napi/host/js_scene_session_manager.cpp index 9668670251..172d4d6692 100644 --- a/window_scene/interfaces/kits/napi/host/js_scene_session_manager.cpp +++ b/window_scene/interfaces/kits/napi/host/js_scene_session_manager.cpp @@ -101,13 +101,13 @@ NativeValue* JsSceneSessionManager::OnRequestSceneSession(NativeEngine& engine, WLOGFE("[NAPI]Argc is invalid: %{public}zu", info.argc); errCode = WSErrorCode::WS_ERROR_INVALID_PARAM; } - AbilityInfo abilityInfo; + SceneAbilityInfo abilityInfo; SessionOption sessionOption = SessionOption::SESSION_MODE_FULLSCREEN; if (errCode == WSErrorCode::WS_OK) { // parse ability info NativeObject* nativeObj = ConvertNativeValueTo(info.argv[0]); if (nativeObj == nullptr) { - WLOGFE("[NAPI]Failed to convert object to AbilityInfo"); + WLOGFE("[NAPI]Failed to convert object to SceneAbilityInfo"); errCode = WSErrorCode::WS_ERROR_INVALID_PARAM; } else { if (!GetAbilityInfoFromJs(engine, nativeObj, abilityInfo)) { diff --git a/window_scene/interfaces/kits/napi/host/js_scene_utils.cpp b/window_scene/interfaces/kits/napi/host/js_scene_utils.cpp index 90c8a65268..2529c8aff7 100644 --- a/window_scene/interfaces/kits/napi/host/js_scene_utils.cpp +++ b/window_scene/interfaces/kits/napi/host/js_scene_utils.cpp @@ -27,7 +27,7 @@ namespace { } bool GetAbilityInfoFromJs(NativeEngine& engine, NativeObject* jsObject, - AbilityInfo& abilityInfo) + SceneAbilityInfo& abilityInfo) { NativeValue* jsBundleName = jsObject->GetProperty("bundleName"); NativeValue* jsAbilityName = jsObject->GetProperty("abilityName"); diff --git a/window_scene/interfaces/kits/napi/host/js_scene_utils.h b/window_scene/interfaces/kits/napi/host/js_scene_utils.h index 5fea665d39..20567970aa 100644 --- a/window_scene/interfaces/kits/napi/host/js_scene_utils.h +++ b/window_scene/interfaces/kits/napi/host/js_scene_utils.h @@ -24,7 +24,7 @@ #include "window_scene_common.h" namespace OHOS::Rosen { bool GetAbilityInfoFromJs(NativeEngine& engine, NativeObject* jsObject, - AbilityInfo& abilityInfo); + SceneAbilityInfo& abilityInfo); NativeValue* CreateJsAbilityInfo(NativeEngine& engine, const sptr& session); } diff --git a/window_scene/session/container/src/scene_session_stage.cpp b/window_scene/session/container/src/scene_session_stage.cpp index 0041d863c6..8cb6087efd 100644 --- a/window_scene/session/container/src/scene_session_stage.cpp +++ b/window_scene/session/container/src/scene_session_stage.cpp @@ -76,7 +76,7 @@ WSError SceneSessionStage::Disconnect() return WSError::WS_OK; } -WSError SceneSessionStage::StartScene(const AbilityInfo& info, SessionOption sessionOption) +WSError SceneSessionStage::StartScene(const SceneAbilityInfo& info, SessionOption sessionOption) { if (sceneSession_ == nullptr) { WLOGFE("sceneSession is invalid"); diff --git a/window_scene/session/host/include/scene_session.h b/window_scene/session/host/include/scene_session.h index e7417b83a8..704799dee0 100644 --- a/window_scene/session/host/include/scene_session.h +++ b/window_scene/session/host/include/scene_session.h @@ -26,7 +26,7 @@ class SceneSession; using NotifyStartSceneFunc = std::function& session)>; class SceneSession : public SceneSessionStub, public Session { public: - explicit SceneSession(const AbilityInfo& info); + explicit SceneSession(const SceneAbilityInfo& info); ~SceneSession() = default; virtual WSError Connect(const sptr& sessionStage, @@ -38,16 +38,16 @@ public: virtual WSError Close() override; virtual WSError Recover() override; virtual WSError Maximum() override; - virtual WSError StartScene(const AbilityInfo& info, SessionOption sessionOption) override; + virtual WSError StartScene(const SceneAbilityInfo& info, SessionOption sessionOption) override; virtual WSError SetActive(bool active) override; - const AbilityInfo& GetAbilityInfo() const; + const SceneAbilityInfo& GetAbilityInfo() const; void RegisterStartSceneEventListener(const NotifyStartSceneFunc& func); private: sptr sceneSessionStage_; sptr windowEventChannel_; - AbilityInfo abilityInfo_; + SceneAbilityInfo abilityInfo_; std::string sessionType_ = ""; bool isActive_ = false; NotifyStartSceneFunc startSceneFunc_; diff --git a/window_scene/session/host/include/scene_session_manager.h b/window_scene/session/host/include/scene_session_manager.h index f29d4f8fbc..9280657f93 100644 --- a/window_scene/session/host/include/scene_session_manager.h +++ b/window_scene/session/host/include/scene_session_manager.h @@ -29,7 +29,7 @@ namespace OHOS::Rosen { class SceneSessionManager { WS_DECLARE_SINGLE_INSTANCE(SceneSessionManager) public: - sptr RequestSceneSession(const AbilityInfo& abilityInfo, SessionOption option); + sptr RequestSceneSession(const SceneAbilityInfo& abilityInfo, SessionOption option); WSError RequestSceneSessionActivation(const sptr& sceneSession); WSError RequestSceneSessionBackground(const sptr& sceneSession); WSError RequestSceneSessionDestruction(const sptr& sceneSession); diff --git a/window_scene/session/host/include/zidl/scene_session_proxy.h b/window_scene/session/host/include/zidl/scene_session_proxy.h index a6df59be64..d420d8e6b7 100644 --- a/window_scene/session/host/include/zidl/scene_session_proxy.h +++ b/window_scene/session/host/include/zidl/scene_session_proxy.h @@ -37,7 +37,7 @@ public: virtual WSError Close() override; virtual WSError Recover() override; virtual WSError Maximum() override; - virtual WSError StartScene(const AbilityInfo& abilityInfo, SessionOption sessionOption) override; + virtual WSError StartScene(const SceneAbilityInfo& abilityInfo, SessionOption sessionOption) override; private: static inline BrokerDelegator delegator_; }; diff --git a/window_scene/session/host/src/scene_session.cpp b/window_scene/session/host/src/scene_session.cpp index 60569dad59..41fb052de9 100644 --- a/window_scene/session/host/src/scene_session.cpp +++ b/window_scene/session/host/src/scene_session.cpp @@ -23,7 +23,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "SceneSession"}; } -SceneSession::SceneSession(const AbilityInfo& info) : Session(info.bundleName_), abilityInfo_(info) +SceneSession::SceneSession(const SceneAbilityInfo& info) : Session(info.bundleName_), abilityInfo_(info) { } @@ -145,7 +145,7 @@ WSError SceneSession::Maximum() return WSError::WS_OK; } -WSError SceneSession::StartScene(const AbilityInfo& info, SessionOption sessionOption) +WSError SceneSession::StartScene(const SceneAbilityInfo& info, SessionOption sessionOption) { auto sceneSession = SceneSessionManager::GetInstance().RequestSceneSession(info, sessionOption); if (sceneSession == nullptr) { @@ -180,7 +180,7 @@ WSError SceneSession::SetActive(bool active) return WSError::WS_OK; } -const AbilityInfo& SceneSession::GetAbilityInfo() const +const SceneAbilityInfo& SceneSession::GetAbilityInfo() const { return abilityInfo_; } diff --git a/window_scene/session/host/src/scene_session_manager.cpp b/window_scene/session/host/src/scene_session_manager.cpp index 164fede9d0..e0fb367256 100644 --- a/window_scene/session/host/src/scene_session_manager.cpp +++ b/window_scene/session/host/src/scene_session_manager.cpp @@ -24,7 +24,7 @@ namespace { WS_IMPLEMENT_SINGLE_INSTANCE(SceneSessionManager) -sptr SceneSessionManager::RequestSceneSession(const AbilityInfo& abilityInfo, SessionOption option) +sptr SceneSessionManager::RequestSceneSession(const SceneAbilityInfo& abilityInfo, SessionOption option) { WLOGFI("abilityInfo: bundleName: %{public}s, abilityName: %{public}s", abilityInfo.bundleName_.c_str(), abilityInfo.abilityName_.c_str()); diff --git a/window_scene/session/host/src/zidl/scene_session_proxy.cpp b/window_scene/session/host/src/zidl/scene_session_proxy.cpp index cda51417a1..7439a111bf 100644 --- a/window_scene/session/host/src/zidl/scene_session_proxy.cpp +++ b/window_scene/session/host/src/zidl/scene_session_proxy.cpp @@ -179,7 +179,7 @@ WSError SceneSessionProxy::Maximum() return static_cast(ret); } -WSError SceneSessionProxy::StartScene(const AbilityInfo& info, SessionOption sessionOption) +WSError SceneSessionProxy::StartScene(const SceneAbilityInfo& info, SessionOption sessionOption) { MessageParcel data; MessageParcel reply; diff --git a/window_scene/session/host/src/zidl/scene_session_stub.cpp b/window_scene/session/host/src/zidl/scene_session_stub.cpp index 32fb03dbb7..4886f27177 100644 --- a/window_scene/session/host/src/zidl/scene_session_stub.cpp +++ b/window_scene/session/host/src/zidl/scene_session_stub.cpp @@ -127,7 +127,7 @@ int SceneSessionStub::HandleMaximum(MessageParcel& data, MessageParcel& reply) int SceneSessionStub::HandleStartScene(MessageParcel& data, MessageParcel& reply) { WLOGFD("RequestActivation!"); - AbilityInfo info = { data.ReadString(), data.ReadString() }; + SceneAbilityInfo info = { data.ReadString(), data.ReadString() }; SessionOption sessionOption = static_cast(data.ReadUint32()); WSError errCode = StartScene(info, sessionOption); reply.WriteUint32(static_cast(errCode));