解决同名问题,AbilityInfo->SceneAbilityInfo

Signed-off-by: xiahaiqin <xiahaiqin1@huawei.com>
Change-Id: I3b100537bfdbf7583e7189504e79506ff0f46ab7
This commit is contained in:
xiahaiqin 2022-12-14 17:03:12 +08:00
parent dc3934a72f
commit 2e0cf008ec
14 changed files with 20 additions and 20 deletions

View File

@ -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

View File

@ -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();

View File

@ -61,7 +61,7 @@ enum class SessionState : uint32_t {
STATE_BACKGROUND,
};
struct AbilityInfo {
struct SceneAbilityInfo {
std::string bundleName_ = "";
std::string abilityName_ = "";
};

View File

@ -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<NativeObject>(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)) {

View File

@ -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");

View File

@ -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<SceneSession>& session);
}

View File

@ -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");

View File

@ -26,7 +26,7 @@ class SceneSession;
using NotifyStartSceneFunc = std::function<void(const sptr<SceneSession>& 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<ISceneSessionStage>& 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<ISceneSessionStage> sceneSessionStage_;
sptr<IWindowEventChannel> windowEventChannel_;
AbilityInfo abilityInfo_;
SceneAbilityInfo abilityInfo_;
std::string sessionType_ = "";
bool isActive_ = false;
NotifyStartSceneFunc startSceneFunc_;

View File

@ -29,7 +29,7 @@ namespace OHOS::Rosen {
class SceneSessionManager {
WS_DECLARE_SINGLE_INSTANCE(SceneSessionManager)
public:
sptr<SceneSession> RequestSceneSession(const AbilityInfo& abilityInfo, SessionOption option);
sptr<SceneSession> RequestSceneSession(const SceneAbilityInfo& abilityInfo, SessionOption option);
WSError RequestSceneSessionActivation(const sptr<SceneSession>& sceneSession);
WSError RequestSceneSessionBackground(const sptr<SceneSession>& sceneSession);
WSError RequestSceneSessionDestruction(const sptr<SceneSession>& sceneSession);

View File

@ -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<SceneSessionProxy> delegator_;
};

View File

@ -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_;
}

View File

@ -24,7 +24,7 @@ namespace {
WS_IMPLEMENT_SINGLE_INSTANCE(SceneSessionManager)
sptr<SceneSession> SceneSessionManager::RequestSceneSession(const AbilityInfo& abilityInfo, SessionOption option)
sptr<SceneSession> SceneSessionManager::RequestSceneSession(const SceneAbilityInfo& abilityInfo, SessionOption option)
{
WLOGFI("abilityInfo: bundleName: %{public}s, abilityName: %{public}s", abilityInfo.bundleName_.c_str(),
abilityInfo.abilityName_.c_str());

View File

@ -179,7 +179,7 @@ WSError SceneSessionProxy::Maximum()
return static_cast<WSError>(ret);
}
WSError SceneSessionProxy::StartScene(const AbilityInfo& info, SessionOption sessionOption)
WSError SceneSessionProxy::StartScene(const SceneAbilityInfo& info, SessionOption sessionOption)
{
MessageParcel data;
MessageParcel reply;

View File

@ -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<SessionOption>(data.ReadUint32());
WSError errCode = StartScene(info, sessionOption);
reply.WriteUint32(static_cast<uint32_t>(errCode));