mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-27 00:51:35 +00:00
回退 'Pull Request !6654 : uiextension新增GetMode'
This commit is contained in:
parent
f0f40ba75d
commit
666cd47ad1
@ -52,7 +52,6 @@ public:
|
||||
MOCK_METHOD3(UpdateViewportConfig, void(const ViewportConfig& config, OHOS::Rosen::WindowSizeChangeReason reason,
|
||||
const std::shared_ptr<OHOS::Rosen::RSTransaction>& rsTransaction));
|
||||
MOCK_METHOD2(UpdateWindowMode, void(OHOS::Rosen::WindowMode mode, bool hasDeco));
|
||||
MOCK_METHOD1(NotifyWindowMode, void(OHOS::Rosen::WindowMode mode));
|
||||
MOCK_METHOD3(HideWindowTitleButton, void(bool hideSplit, bool hideMaximize, bool hideMinimize));
|
||||
MOCK_METHOD2(UpdateTitleInTargetPos, void(bool isShow, int32_t height));
|
||||
MOCK_METHOD0(GetBackgroundColor, uint32_t());
|
||||
|
@ -89,10 +89,6 @@ public:
|
||||
{
|
||||
return WSError::WS_OK;
|
||||
}
|
||||
virtual WSError NotifyHostWindowMode(WindowMode mode)
|
||||
{
|
||||
return WSError::WS_OK;
|
||||
}
|
||||
virtual WSError NotifySearchElementInfoByAccessibilityId(int64_t elementId, int32_t mode, int64_t baseParent,
|
||||
std::list<Accessibility::AccessibilityElementInfo>& infos)
|
||||
{
|
||||
|
@ -53,7 +53,6 @@ enum class SessionStageInterfaceCode {
|
||||
TRANS_ID_GET_UI_CONTENT_REMOTE_OBJ,
|
||||
TRANS_ID_NOTIFY_KEYBOARD_INFO_CHANGE,
|
||||
TRANS_ID_NOTIFY_DENSITY_FOLLOW_HOST,
|
||||
TRANS_ID_NOTIFY_HOST_WINDOW_MODE,
|
||||
};
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
@ -54,7 +54,6 @@ public:
|
||||
void NotifySessionForeground(uint32_t reason, bool withAnimation) override;
|
||||
void NotifySessionBackground(uint32_t reason, bool withAnimation, bool isFromInnerkits) override;
|
||||
WSError NotifyDensityFollowHost(bool isFollowHost, float densityValue) override;
|
||||
WSError NotifyHostWindowMode(WindowMode mode) override;
|
||||
WSError UpdateTitleInTargetPos(bool isShow, int32_t height) override;
|
||||
void NotifyTransformChange(const Transform& transform) override;
|
||||
WSError NotifyDialogStateChange(bool isForeground) override;
|
||||
|
@ -59,7 +59,6 @@ private:
|
||||
int HandleNotifySessionBackground(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleUpdateTitleInTargetPos(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleNotifyDensityFollowHost(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleNotifyHostWindowMode(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleNotifyWindowVisibilityChange(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleNotifyTransformChange(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleNotifyDialogStateChange(MessageParcel& data, MessageParcel& reply);
|
||||
|
@ -678,30 +678,6 @@ WSError SessionStageProxy::NotifyDensityFollowHost(bool isFollowHost, float dens
|
||||
return WSError::WS_OK;
|
||||
}
|
||||
|
||||
WSError SessionStageProxy::NotifyHostWindowMode(WindowMode mode)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option(MessageOption::TF_ASYNC);
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
TLOGE(WmsLogTag::WMS_UIEXT, "WriteInterfaceToken failed");
|
||||
return WSError::WS_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(mode))) {
|
||||
TLOGE(WmsLogTag::WMS_UIEXT, "Write mode failed");
|
||||
return WSError::WS_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (Remote()->SendRequest(static_cast<uint32_t>(SessionStageInterfaceCode::TRANS_ID_NOTIFY_HOST_WINDOW_MODE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
TLOGE(WmsLogTag::WMS_UIEXT, "SendRequest failed");
|
||||
return WSError::WS_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
return WSError::WS_OK;
|
||||
}
|
||||
|
||||
WSError SessionStageProxy::NotifyDialogStateChange(bool isForeground)
|
||||
{
|
||||
MessageParcel data;
|
||||
|
@ -71,8 +71,6 @@ const std::map<uint32_t, SessionStageStubFunc> SessionStageStub::stubFuncMap_{
|
||||
&SessionStageStub::HandleUpdateTitleInTargetPos),
|
||||
std::make_pair(static_cast<uint32_t>(SessionStageInterfaceCode::TRANS_ID_NOTIFY_DENSITY_FOLLOW_HOST),
|
||||
&SessionStageStub::HandleNotifyDensityFollowHost),
|
||||
std::make_pair(static_cast<uint32_t>(SessionStageInterfaceCode::TRANS_ID_NOTIFY_HOST_WINDOW_MODE),
|
||||
&SessionStageStub::HandleNotifyHostWindowMode),
|
||||
std::make_pair(static_cast<uint32_t>(SessionStageInterfaceCode::TRANS_ID_NOTIFY_WINDOW_VISIBILITY_CHANGE),
|
||||
&SessionStageStub::HandleNotifyWindowVisibilityChange),
|
||||
std::make_pair(static_cast<uint32_t>(SessionStageInterfaceCode::TRANS_ID_NOTIFY_TRANSFORM_CHANGE),
|
||||
@ -355,14 +353,6 @@ int SessionStageStub::HandleNotifyDensityFollowHost(MessageParcel& data, Message
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int SessionStageStub::HandleNotifyHostWindowMode(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
TLOGD(WmsLogTag::WMS_UIEXT, "called");
|
||||
WindowMode mode = static_cast<WindowMode>(data.ReadUint32());
|
||||
NotifyHostWindowMode(mode);
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int SessionStageStub::HandleNotifyDialogStateChange(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGD("HandleNotifyDialogStateChange!");
|
||||
|
@ -91,7 +91,6 @@ public:
|
||||
void NotifySyncOn() override;
|
||||
void NotifyAsyncOn() override;
|
||||
WSError NotifyDensityFollowHost(bool isFollowHost, float densityValue = 1.0f);
|
||||
WSError NotifyHostWindowMode(WindowMode mode);
|
||||
void TriggerBindModalUIExtension() override;
|
||||
void RegisterExtensionSessionEventCallback(const sptr<ExtensionSessionEventCallback>& extSessionEventCallback);
|
||||
WSError TransferKeyEventForConsumed(const std::shared_ptr<MMI::KeyEvent>& keyEvent, bool& isConsumed,
|
||||
|
@ -265,19 +265,6 @@ WSError ExtensionSession::NotifyDensityFollowHost(bool isFollowHost, float densi
|
||||
return sessionStage_->NotifyDensityFollowHost(isFollowHost, densityValue);
|
||||
}
|
||||
|
||||
WSError ExtensionSession::NotifyHostWindowMode(WindowMode mode)
|
||||
{
|
||||
if (!IsSessionValid()) {
|
||||
return WSError::WS_ERROR_INVALID_SESSION;
|
||||
}
|
||||
if (!sessionStage_) {
|
||||
TLOGE(WmsLogTag::WMS_UIEXT, "session stage is null!");
|
||||
return WSError::WS_ERROR_NULLPTR;
|
||||
}
|
||||
|
||||
return sessionStage_->NotifyHostWindowMode(mode);
|
||||
}
|
||||
|
||||
void ExtensionSession::TriggerBindModalUIExtension()
|
||||
{
|
||||
if (isFirstTriggerBindModal_ && extSessionEventCallback_ != nullptr &&
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
MOCK_METHOD3(NotifySessionBackground, void(uint32_t reason, bool withAnimation, bool isFromInnerkits));
|
||||
MOCK_METHOD2(UpdateTitleInTargetPos, WSError(bool isShow, int32_t height));
|
||||
MOCK_METHOD2(NotifyDensityFollowHost, WSError(bool isFollowHost, float densityValue));
|
||||
MOCK_METHOD1(NotifyHostWindowMode, WSError(WindowMode mode));
|
||||
MOCK_METHOD1(UpdateWindowDrawingContentInfo, void(const WindowDrawingContentInfo& info));
|
||||
MOCK_METHOD1(NotifyWindowVisibility, WSError(bool isVisible));
|
||||
MOCK_METHOD1(NotifyTransformChange, void(const Transform& transform));
|
||||
|
@ -332,27 +332,6 @@ HWTEST_F(ExtensionSessionTest, NotifyDensityFollowHost03, Function | SmallTest |
|
||||
ASSERT_EQ(WSError::WS_ERROR_NULLPTR, res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: NotifyHostWindowMode
|
||||
* @tc.desc: NotifyHostWindowMode
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ExtensionSessionTest, NotifyHostWindowMode, Function | SmallTest | Level1)
|
||||
{
|
||||
WindowMode mode = WindowMode::WINDOW_MODE_FLOATING;
|
||||
auto res = extensionSession_->NotifyHostWindowMode(mode);
|
||||
ASSERT_EQ(res, WSError::WS_ERROR_INVALID_SESSION);
|
||||
|
||||
extensionSession_->state_ = SessionState::STATE_CONNECT;
|
||||
res = extensionSession_->NotifyHostWindowMode(mode);
|
||||
ASSERT_EQ(res, WSError::WS_ERROR_NULLPTR);
|
||||
|
||||
extensionSession_->sessionStage_ = mockSessionStage_;
|
||||
EXPECT_CALL(*mockSessionStage_, NotifyHostWindowMode).Times(1).WillOnce(Return(WSError::WS_OK));
|
||||
res = extensionSession_->NotifyHostWindowMode(mode);
|
||||
ASSERT_EQ(res, WSError::WS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: TriggerBindModalUIExtension
|
||||
* @tc.desc: test function : TriggerBindModalUIExtension
|
||||
|
@ -302,18 +302,6 @@ HWTEST_F(SessionStageProxyTest, NotifyDensityFollowHost, Function | SmallTest |
|
||||
ASSERT_EQ(WSError::WS_OK, sessionStage_->NotifyDensityFollowHost(true, 1.0f));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: NotifyHostWindowMode
|
||||
* @tc.desc: test function : NotifyHostWindowMode
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(SessionStageProxyTest, NotifyHostWindowMode, Function | SmallTest | Level1)
|
||||
{
|
||||
ASSERT_TRUE((sessionStage_ != nullptr));
|
||||
WindowMode mode = WindowMode::WINDOW_MODE_FLOATING;
|
||||
ASSERT_EQ(WSError::WS_OK, sessionStage_->NotifyHostWindowMode(mode));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetPipActionEvent
|
||||
* @tc.desc: test function : SetPipActionEvent
|
||||
|
@ -341,19 +341,6 @@ HWTEST_F(SessionStageStubTest, HandleUpdateDensity, Function | SmallTest | Level
|
||||
ASSERT_EQ(0, sessionStageStub_->HandleNotifyWindowVisibilityChange(data, reply));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: HandleNotifyHostWindowMode
|
||||
* @tc.desc: test function : HandleNotifyHostWindowMode
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(SessionStageStubTest, HandleNotifyHostWindowMode, Function | SmallTest | Level1)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
ASSERT_TRUE((sessionStageStub_ != nullptr));
|
||||
ASSERT_EQ(0, sessionStageStub_->HandleNotifyHostWindowMode(data, reply));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: HandleUpdateOrientation
|
||||
* @tc.desc: test function : HandleUpdateOrientation
|
||||
|
@ -82,8 +82,6 @@ public:
|
||||
WMError Show(uint32_t reason = 0, bool withAnimation = false) override;
|
||||
WMError Hide(uint32_t reason, bool withAnimation, bool isFromInnerkits) override;
|
||||
WSError NotifyDensityFollowHost(bool isFollowHost, float densityValue) override;
|
||||
WSError NotifyHostWindowMode(WindowMode mode) override;
|
||||
WindowMode GetMode() const override;
|
||||
float GetVirtualPixelRatio(sptr<DisplayInfo> displayInfo) override;
|
||||
WMError HideNonSecureWindows(bool shouldHide) override;
|
||||
WMError SetWaterMarkFlag(bool isEnable) override;
|
||||
@ -106,7 +104,6 @@ private:
|
||||
|
||||
std::atomic<bool> isDensityFollowHost_ { false };
|
||||
std::optional<std::atomic<float>> hostDensityValue_ = std::nullopt;
|
||||
std::atomic<WindowMode> hostWindowMode_ = WindowMode::WINDOW_MODE_UNDEFINED;
|
||||
sptr<IOccupiedAreaChangeListener> occupiedAreaChangeListener_;
|
||||
std::optional<std::atomic<bool>> focusState_ = std::nullopt;
|
||||
static std::set<sptr<WindowSessionImpl>> windowExtensionSessionSet_;
|
||||
|
@ -715,18 +715,6 @@ float WindowExtensionSessionImpl::GetVirtualPixelRatio(sptr<DisplayInfo> display
|
||||
return vpr;
|
||||
}
|
||||
|
||||
WSError WindowExtensionSessionImpl::NotifyHostWindowMode(WindowMode mode)
|
||||
{
|
||||
TLOGI(WmsLogTag::WMS_UIEXT, "mode:%{public}d", static_cast<int32_t>(mode));
|
||||
hostWindowMode_ = mode;
|
||||
return WSError::WS_OK;
|
||||
}
|
||||
|
||||
WindowMode WindowExtensionSessionImpl::GetMode() const
|
||||
{
|
||||
return hostWindowMode_;
|
||||
}
|
||||
|
||||
WMError WindowExtensionSessionImpl::HideNonSecureWindows(bool shouldHide)
|
||||
{
|
||||
if (state_ != WindowState::STATE_SHOWN) {
|
||||
|
@ -999,7 +999,6 @@ void WindowSessionImpl::UpdateDecorEnable(bool needNotify, WindowMode mode)
|
||||
}
|
||||
WLOGFD("[WSLayout]Notify uiContent window mode change end,decorVisible:%{public}d", decorVisible);
|
||||
uiContent->UpdateDecorVisible(decorVisible, IsDecorEnable());
|
||||
uiContent->NotifyWindowMode(mode);
|
||||
}
|
||||
}
|
||||
NotifyModeChange(mode, IsDecorEnable());
|
||||
|
@ -1083,18 +1083,6 @@ HWTEST_F(WindowExtensionSessionImplTest, GetVirtualPixelRatio04, Function | Smal
|
||||
ASSERT_EQ(1.0f, window_->GetVirtualPixelRatio(nullptr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: NotifyHostWindowMode
|
||||
* @tc.desc: NotifyHostWindowMode
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(WindowExtensionSessionImplTest, NotifyHostWindowMode, Function | SmallTest | Level3)
|
||||
{
|
||||
WindowMode mode = WindowMode::WINDOW_MODE_FLOATING;
|
||||
ASSERT_EQ(WSError::WS_OK, window_->NotifyHostWindowMode(mode));
|
||||
ASSERT_EQ(mode, window_->GetMode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: UpdateConfiguration
|
||||
* @tc.desc: UpdateConfiguration Test
|
||||
|
Loading…
Reference in New Issue
Block a user