mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-27 00:51:35 +00:00
fix: refactor dm_lite
Signed-off-by: hxf233333 <huxiaofei11@huawei.com>
This commit is contained in:
parent
d32bbec663
commit
cbdec7bce8
@ -18,6 +18,7 @@ config("libdm_private_config") {
|
||||
include_dirs = [
|
||||
"include",
|
||||
"../dm/include",
|
||||
"../dmserver/include",
|
||||
]
|
||||
}
|
||||
|
||||
@ -43,11 +44,10 @@ ohos_shared_library("libdm_lite") {
|
||||
}
|
||||
sources = [
|
||||
"../dm/src/zidl/display_manager_agent_stub.cpp",
|
||||
"../window_scene/screen_session_manager/src/zidl/screen_session_manager_lite_proxy.cpp",
|
||||
"../wmserver/src/zidl/mock_session_manager_service_proxy.cpp",
|
||||
"src/display_lite.cpp",
|
||||
"src/display_manager_adapter_lite.cpp",
|
||||
"src/display_manager_lite.cpp",
|
||||
"src/display_manager_lite_proxy.cpp",
|
||||
"src/screen_manager_lite.cpp",
|
||||
]
|
||||
|
||||
@ -75,6 +75,10 @@ ohos_shared_library("libdm_lite") {
|
||||
if (build_variant == "user") {
|
||||
defines += [ "IS_RELEASE_VERSION" ]
|
||||
}
|
||||
|
||||
if (window_manager_use_sceneboard) {
|
||||
defines += [ "SCENE_BOARD_ENABLED" ]
|
||||
}
|
||||
}
|
||||
|
||||
group("test") {
|
||||
|
@ -22,7 +22,8 @@
|
||||
#include "display_lite.h"
|
||||
#include "dm_common.h"
|
||||
#include "singleton_delegator.h"
|
||||
#include "zidl/screen_session_manager_lite_interface.h"
|
||||
#include "display_manager_lite_proxy.h"
|
||||
#include "zidl/display_manager_agent_interface.h"
|
||||
|
||||
namespace OHOS::Rosen {
|
||||
class BaseAdapterLite {
|
||||
@ -36,7 +37,7 @@ public:
|
||||
protected:
|
||||
bool InitDMSProxy();
|
||||
std::recursive_mutex mutex_;
|
||||
sptr<IScreenSessionManagerLite> displayManagerServiceProxy_ = nullptr;
|
||||
sptr<DisplayManagerLiteProxy> displayManagerServiceProxy_ = nullptr;
|
||||
sptr<IRemoteObject::DeathRecipient> dmsDeath_ = nullptr;
|
||||
bool isProxyValid_ { false };
|
||||
};
|
||||
@ -67,8 +68,11 @@ public:
|
||||
virtual bool WakeUpEnd();
|
||||
virtual bool SuspendBegin(PowerStateChangeReason reason);
|
||||
virtual bool SuspendEnd();
|
||||
virtual ScreenId GetInternalScreenId();
|
||||
virtual bool SetScreenPowerById(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason);
|
||||
virtual bool SetDisplayState(DisplayState state);
|
||||
virtual DisplayState GetDisplayState(DisplayId displayId);
|
||||
virtual bool TryToCancelScreenOff();
|
||||
virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level);
|
||||
virtual uint32_t GetScreenBrightness(uint64_t screenId);
|
||||
private:
|
||||
|
83
dm_lite/include/display_manager_lite_proxy.h
Normal file
83
dm_lite/include/display_manager_lite_proxy.h
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2024 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_ROSEN_DISPLAY_MANAGER_LITE_PROXY_H
|
||||
#define OHOS_ROSEN_DISPLAY_MANAGER_LITE_PROXY_H
|
||||
|
||||
#include "display_manager_interface_code.h"
|
||||
|
||||
#include <iremote_broker.h>
|
||||
#include <iremote_proxy.h>
|
||||
#include <cinttypes>
|
||||
#include "dm_common.h"
|
||||
#include "zidl/display_manager_agent_interface.h"
|
||||
#include "display_info.h"
|
||||
#include "fold_screen_info.h"
|
||||
#include "screen_group_info.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
|
||||
class DisplayManagerLiteProxy : public IRemoteBroker {
|
||||
public:
|
||||
#ifdef SCENE_BOARD_ENABLED
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IScreenSessionManager");
|
||||
#else
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IDisplayManager");
|
||||
#endif
|
||||
|
||||
explicit DisplayManagerLiteProxy(const sptr<IRemoteObject>& impl) : remoteObject(impl) {}
|
||||
|
||||
~DisplayManagerLiteProxy() = default;
|
||||
|
||||
sptr<IRemoteObject> AsObject() { return remoteObject; };
|
||||
virtual DMError RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
|
||||
DisplayManagerAgentType type);
|
||||
virtual DMError UnregisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
|
||||
DisplayManagerAgentType type);
|
||||
|
||||
virtual FoldDisplayMode GetFoldDisplayMode();
|
||||
virtual void SetFoldDisplayMode(const FoldDisplayMode displayMode);
|
||||
virtual bool IsFoldable();
|
||||
FoldStatus GetFoldStatus();
|
||||
virtual sptr<DisplayInfo> GetDefaultDisplayInfo();
|
||||
virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId);
|
||||
virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId);
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
virtual bool WakeUpBegin(PowerStateChangeReason reason);
|
||||
virtual bool WakeUpEnd();
|
||||
virtual bool SuspendBegin(PowerStateChangeReason reason);
|
||||
virtual bool SuspendEnd();
|
||||
virtual ScreenId GetInternalScreenId();
|
||||
virtual bool SetScreenPowerById(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason);
|
||||
virtual bool SetSpecifiedScreenPower(ScreenId, ScreenPowerState, PowerStateChangeReason);
|
||||
virtual bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason);
|
||||
virtual ScreenPowerState GetScreenPower(ScreenId dmsScreenId);
|
||||
virtual bool SetDisplayState(DisplayState state);
|
||||
virtual DisplayState GetDisplayState(DisplayId displayId);
|
||||
virtual bool TryToCancelScreenOff();
|
||||
virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level);
|
||||
virtual uint32_t GetScreenBrightness(uint64_t screenId);
|
||||
virtual std::vector<DisplayId> GetAllDisplayIds();
|
||||
private:
|
||||
sptr<IRemoteObject> Remote() { return remoteObject; };
|
||||
sptr<IRemoteObject> remoteObject = nullptr;
|
||||
};
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
||||
#endif // OHOS_ROSEN_SCREEN_SESSION_MANAGER_LITE_PROXY_H
|
@ -20,9 +20,9 @@
|
||||
#include <system_ability_definition.h>
|
||||
|
||||
#include "display_manager_lite.h"
|
||||
#include "screen_manager_lite.h"
|
||||
#include "dm_common.h"
|
||||
#include "window_manager_hilog.h"
|
||||
#include "zidl/mock_session_manager_service_interface.h"
|
||||
|
||||
namespace OHOS::Rosen {
|
||||
namespace {
|
||||
@ -61,40 +61,31 @@ bool BaseAdapterLite::InitDMSProxy()
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
if (!isProxyValid_) {
|
||||
sptr<ISystemAbilityManager> systemAbilityManager =
|
||||
SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
|
||||
SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
|
||||
if (!systemAbilityManager) {
|
||||
WLOGFE("Failed to get system ability mgr.");
|
||||
return false;
|
||||
}
|
||||
sptr<IRemoteObject> mockRemoteObject = systemAbilityManager->GetSystemAbility(WINDOW_MANAGER_SERVICE_ID);
|
||||
if (!mockRemoteObject) {
|
||||
WLOGFI("Remote object is nullptr");
|
||||
|
||||
sptr<IRemoteObject> remoteObject
|
||||
= systemAbilityManager->GetSystemAbility(DISPLAY_MANAGER_SERVICE_SA_ID);
|
||||
if (!remoteObject) {
|
||||
WLOGFE("Failed to get display manager service.");
|
||||
return false;
|
||||
}
|
||||
auto mockSessionManagerServiceProxy_ = iface_cast<IMockSessionManagerInterface>(mockRemoteObject);
|
||||
if (!mockSessionManagerServiceProxy_) {
|
||||
WLOGFW("Get mock session manager service proxy failed, nullptr");
|
||||
displayManagerServiceProxy_ = new(std::nothrow) DisplayManagerLiteProxy(remoteObject);
|
||||
if ((!displayManagerServiceProxy_) || (!displayManagerServiceProxy_->AsObject())) {
|
||||
WLOGFW("Failed to get system display manager services");
|
||||
return false;
|
||||
}
|
||||
|
||||
sptr<IRemoteObject> displayRemoteObject = mockSessionManagerServiceProxy_->GetScreenSessionManagerLite();
|
||||
if (!displayRemoteObject) {
|
||||
WLOGFE("displayRemoteObject is nullptr");
|
||||
dmsDeath_ = new(std::nothrow) DMSDeathRecipientLite(*this);
|
||||
if (dmsDeath_ == nullptr) {
|
||||
WLOGFE("Failed to create death Recipient ptr DMSDeathRecipient");
|
||||
return false;
|
||||
}
|
||||
displayManagerServiceProxy_ = iface_cast<IScreenSessionManagerLite>(displayRemoteObject);
|
||||
if ((!displayManagerServiceProxy_) || (!displayManagerServiceProxy_->AsObject())) {
|
||||
WLOGFE("Failed to get system scene session manager services");
|
||||
return false;
|
||||
}
|
||||
dmsDeath_ = new (std::nothrow) DMSDeathRecipientLite(*this);
|
||||
if (!dmsDeath_) {
|
||||
WLOGFE("Failed to create death Recipient ptr DMSDeathRecipientLite");
|
||||
return false;
|
||||
}
|
||||
sptr<IRemoteObject> remoteObject = displayManagerServiceProxy_->AsObject();
|
||||
if (remoteObject->IsProxyObject() && !remoteObject->AddDeathRecipient(dmsDeath_)) {
|
||||
WLOGFE("Failed to add death recipient.");
|
||||
WLOGFE("Failed to add death recipient");
|
||||
return false;
|
||||
}
|
||||
isProxyValid_ = true;
|
||||
@ -189,6 +180,21 @@ bool DisplayManagerAdapterLite::SuspendEnd()
|
||||
return displayManagerServiceProxy_->SuspendEnd();
|
||||
}
|
||||
|
||||
ScreenId DisplayManagerAdapterLite::GetInternalScreenId()
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN(false);
|
||||
|
||||
return displayManagerServiceProxy_->GetInternalScreenId();
|
||||
}
|
||||
|
||||
bool DisplayManagerAdapterLite::SetScreenPowerById(ScreenId screenId, ScreenPowerState state,
|
||||
PowerStateChangeReason reason)
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN(false);
|
||||
|
||||
return displayManagerServiceProxy_->SetScreenPowerById(screenId, state, reason);
|
||||
}
|
||||
|
||||
bool DisplayManagerAdapterLite::SetDisplayState(DisplayState state)
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN(false);
|
||||
@ -203,6 +209,13 @@ DisplayState DisplayManagerAdapterLite::GetDisplayState(DisplayId displayId)
|
||||
return displayManagerServiceProxy_->GetDisplayState(displayId);
|
||||
}
|
||||
|
||||
bool DisplayManagerAdapterLite::TryToCancelScreenOff()
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN(false);
|
||||
|
||||
return displayManagerServiceProxy_->TryToCancelScreenOff();
|
||||
}
|
||||
|
||||
bool DisplayManagerAdapterLite::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN(false);
|
||||
@ -219,7 +232,7 @@ uint32_t DisplayManagerAdapterLite::GetScreenBrightness(uint64_t screenId)
|
||||
|
||||
std::vector<DisplayId> DisplayManagerAdapterLite::GetAllDisplayIds()
|
||||
{
|
||||
WLOGFD("DisplayManagerAdapter::GetAllDisplayIds enter");
|
||||
WLOGFD("DisplayManagerAdapterLite::GetAllDisplayIds enter");
|
||||
INIT_PROXY_CHECK_RETURN(std::vector<DisplayId>());
|
||||
|
||||
return displayManagerServiceProxy_->GetAllDisplayIds();
|
||||
@ -266,6 +279,7 @@ void DMSDeathRecipientLite::OnRemoteDied(const wptr<IRemoteObject>& wptrDeath)
|
||||
WLOGFI("dms OnRemoteDied");
|
||||
adapter_.Clear();
|
||||
SingletonContainer::Get<DisplayManagerLite>().OnRemoteDied();
|
||||
SingletonContainer::Get<ScreenManagerLite>().OnRemoteDied();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -590,6 +590,18 @@ bool DisplayManagerLite::SuspendEnd()
|
||||
return SingletonContainer::Get<DisplayManagerAdapterLite>().SuspendEnd();
|
||||
}
|
||||
|
||||
ScreenId DisplayManagerLite::GetInternalScreenId()
|
||||
{
|
||||
WLOGFD("[UL_POWER]GetInternalScreenId start");
|
||||
return SingletonContainer::Get<DisplayManagerAdapterLite>().GetInternalScreenId();
|
||||
}
|
||||
|
||||
bool DisplayManagerLite::SetScreenPowerById(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason)
|
||||
{
|
||||
WLOGFD("[UL_POWER]SetScreenPowerById start");
|
||||
return SingletonContainer::Get<DisplayManagerAdapterLite>().SetScreenPowerById(screenId, state, reason);
|
||||
}
|
||||
|
||||
bool DisplayManagerLite::SetDisplayState(DisplayState state, DisplayStateCallback callback)
|
||||
{
|
||||
return pImpl_->SetDisplayState(state, callback);
|
||||
@ -661,9 +673,15 @@ void DisplayManagerLite::Impl::ClearDisplayStateCallback()
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayManagerLite::TryToCancelScreenOff()
|
||||
{
|
||||
WLOGFD("[UL_POWER]TryToCancelScreenOff start");
|
||||
return SingletonContainer::Get<DisplayManagerAdapterLite>().TryToCancelScreenOff();
|
||||
}
|
||||
|
||||
bool DisplayManagerLite::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
WLOGFI("[UL_POWER]SetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
WLOGFD("[UL_POWER]SetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
SingletonContainer::Get<DisplayManagerAdapterLite>().SetScreenBrightness(screenId, level);
|
||||
return true;
|
||||
}
|
||||
@ -671,7 +689,7 @@ bool DisplayManagerLite::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
uint32_t DisplayManagerLite::GetScreenBrightness(uint64_t screenId) const
|
||||
{
|
||||
uint32_t level = SingletonContainer::Get<DisplayManagerAdapterLite>().GetScreenBrightness(screenId);
|
||||
WLOGFI("GetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
WLOGFD("[UL_POWER]GetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
return level;
|
||||
}
|
||||
|
||||
|
714
dm_lite/src/display_manager_lite_proxy.cpp
Normal file
714
dm_lite/src/display_manager_lite_proxy.cpp
Normal file
@ -0,0 +1,714 @@
|
||||
/*
|
||||
* Copyright (c) 2024 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 "display_manager_lite_proxy.h"
|
||||
|
||||
#include <ipc_types.h>
|
||||
#include <message_option.h>
|
||||
#include <message_parcel.h>
|
||||
|
||||
#include "dm_common.h"
|
||||
#include "marshalling_helper.h"
|
||||
#include "window_manager_hilog.h"
|
||||
|
||||
namespace OHOS::Rosen {
|
||||
namespace {
|
||||
constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_DOMAIN_DISPLAY, "DisplayManagerLiteProxy" };
|
||||
}
|
||||
|
||||
DMError DisplayManagerLiteProxy::RegisterDisplayManagerAgent(
|
||||
const sptr<IDisplayManagerAgent>& displayManagerAgent, DisplayManagerAgentType type)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
WLOGFD("DisplayManagerLiteProxy::RegisterDisplayManagerAgent");
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("RegisterDisplayManagerAgent WriteInterfaceToken failed");
|
||||
return DMError::DM_ERROR_WRITE_INTERFACE_TOKEN_FAILED;
|
||||
}
|
||||
|
||||
if (displayManagerAgent == nullptr) {
|
||||
WLOGFE("IDisplayManagerAgent is null");
|
||||
return DMError::DM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (!data.WriteRemoteObject(displayManagerAgent->AsObject())) {
|
||||
WLOGFE("Write IDisplayManagerAgent failed");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(type))) {
|
||||
WLOGFE("Write DisplayManagerAgent type failed");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
return static_cast<DMError>(reply.ReadInt32());
|
||||
}
|
||||
|
||||
DMError DisplayManagerLiteProxy::UnregisterDisplayManagerAgent(
|
||||
const sptr<IDisplayManagerAgent>& displayManagerAgent, DisplayManagerAgentType type)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
WLOGFD("DisplayManagerLiteProxy::UnregisterDisplayManagerAgent");
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("UnregisterDisplayManagerAgent WriteInterfaceToken failed");
|
||||
return DMError::DM_ERROR_WRITE_INTERFACE_TOKEN_FAILED;
|
||||
}
|
||||
|
||||
if (displayManagerAgent == nullptr) {
|
||||
WLOGFE("IDisplayManagerAgent is null");
|
||||
return DMError::DM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (!data.WriteRemoteObject(displayManagerAgent->AsObject())) {
|
||||
WLOGFE("Write IWindowManagerAgent failed");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(type))) {
|
||||
WLOGFE("Write DisplayManagerAgent type failed");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
return DMError::DM_ERROR_IPC_FAILED;
|
||||
}
|
||||
return static_cast<DMError>(reply.ReadInt32());
|
||||
}
|
||||
|
||||
FoldDisplayMode DisplayManagerLiteProxy::GetFoldDisplayMode()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return FoldDisplayMode::UNKNOWN;
|
||||
}
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken Failed");
|
||||
return FoldDisplayMode::UNKNOWN;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("Send TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE request failed");
|
||||
return FoldDisplayMode::UNKNOWN;
|
||||
}
|
||||
return static_cast<FoldDisplayMode>(reply.ReadUint32());
|
||||
}
|
||||
|
||||
void DisplayManagerLiteProxy::SetFoldDisplayMode(const FoldDisplayMode displayMode)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return;
|
||||
}
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken Failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(displayMode))) {
|
||||
WLOGFE("Write displayMode failed");
|
||||
return;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("Send TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE request failed");
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::IsFoldable()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("IsFoldable WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCENE_BOARD_IS_FOLDABLE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
FoldStatus DisplayManagerLiteProxy::GetFoldStatus()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return FoldStatus::UNKNOWN;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return FoldStatus::UNKNOWN;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
return FoldStatus::UNKNOWN;
|
||||
}
|
||||
return static_cast<FoldStatus>(reply.ReadUint32());
|
||||
}
|
||||
|
||||
sptr<DisplayInfo> OHOS::Rosen::DisplayManagerLiteProxy::GetDefaultDisplayInfo()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("remote is null");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return nullptr;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sptr<DisplayInfo> info = reply.ReadParcelable<DisplayInfo>();
|
||||
if (info == nullptr) {
|
||||
WLOGFW("read display info failed, info is nullptr.");
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
sptr<DisplayInfo> DisplayManagerLiteProxy::GetDisplayInfoById(DisplayId displayId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("GetDisplayInfoById: remote is nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("GetDisplayInfoById: WriteInterfaceToken failed");
|
||||
return nullptr;
|
||||
}
|
||||
if (!data.WriteUint64(displayId)) {
|
||||
WLOGFW("GetDisplayInfoById: WriteUint64 displayId failed");
|
||||
return nullptr;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("GetDisplayInfoById: SendRequest failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sptr<DisplayInfo> info = reply.ReadParcelable<DisplayInfo>();
|
||||
if (info == nullptr) {
|
||||
WLOGFW("DisplayManagerProxy::GetDisplayInfoById SendRequest nullptr.");
|
||||
return nullptr;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
sptr<CutoutInfo> DisplayManagerLiteProxy::GetCutoutInfo(DisplayId displayId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFW("get cutout info : remote is null");
|
||||
return nullptr;
|
||||
}
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("get cutout info : failed");
|
||||
return nullptr;
|
||||
}
|
||||
if (!data.WriteUint64(displayId)) {
|
||||
WLOGFE("get cutout info: write displayId failed");
|
||||
return nullptr;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_CUTOUT_INFO),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("GetCutoutInfo: GetCutoutInfo failed");
|
||||
return nullptr;
|
||||
}
|
||||
sptr<CutoutInfo> info = reply.ReadParcelable<CutoutInfo>();
|
||||
return info;
|
||||
}
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
bool DisplayManagerLiteProxy::WakeUpBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]WakeUpBegin remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WakeUpBegin: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]WakeUpBegin: Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]WakeUpBegin: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::WakeUpEnd()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]WakeUpEnd remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WakeUpEnd: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_WAKE_UP_END),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]WakeUpEnd: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SuspendBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SuspendBegin remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]SuspendBegin: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]SuspendBegin: Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SuspendBegin: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SuspendEnd()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SuspendEnd remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]SuspendEnd: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SUSPEND_END),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SuspendEnd: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
ScreenId DisplayManagerLiteProxy::GetInternalScreenId()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]GetInternalScreenId remote is nullptr");
|
||||
return SCREEN_ID_INVALID;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option(MessageOption::TF_SYNC);
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]GetInternalScreenId: WriteInterfaceToken failed");
|
||||
return SCREEN_ID_INVALID;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_INTERNAL_SCREEN_ID),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]GetInternalScreenId: SendRequest failed");
|
||||
return SCREEN_ID_INVALID;
|
||||
}
|
||||
return reply.ReadUint64();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SetScreenPowerById(ScreenId screenId, ScreenPowerState state,
|
||||
PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetScreenPowerById remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option(MessageOption::TF_SYNC);
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint64(screenId)) {
|
||||
WLOGFE("[UL_POWER]Write ScreenId failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenPowerState failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_BY_ID),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SetSpecifiedScreenPower(ScreenId screenId, ScreenPowerState state,
|
||||
PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetSpecifiedScreenPower remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(screenId))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenId failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenPowerState failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetScreenPowerForAll remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenPowerState failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
ScreenPowerState DisplayManagerLiteProxy::GetScreenPower(ScreenId dmsScreenId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("GetScreenPower remote is nullptr");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
if (!data.WriteUint64(static_cast<uint64_t>(dmsScreenId))) {
|
||||
WLOGFE("Write dmsScreenId failed");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
return static_cast<ScreenPowerState>(reply.ReadUint32());
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SetDisplayState(DisplayState state)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetDisplayState remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write DisplayState failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
DisplayState DisplayManagerLiteProxy::GetDisplayState(DisplayId displayId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("GetDisplayState remote is nullptr");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
if (!data.WriteUint64(displayId)) {
|
||||
WLOGFE("Write displayId failed");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
return static_cast<DisplayState>(reply.ReadUint32());
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::TryToCancelScreenOff()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]TryToCancelScreenOff remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]TryToCancelScreenOff: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_TRY_TO_CANCEL_SCREEN_OFF),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]TryToCancelScreenOff: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool DisplayManagerLiteProxy::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("SetScreenBrightness remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint64(screenId)) {
|
||||
WLOGFE("Write screenId failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint64(level)) {
|
||||
WLOGFE("Write level failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_SCREEN_BRIGHTNESS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
uint32_t DisplayManagerLiteProxy::GetScreenBrightness(uint64_t screenId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("GetScreenBrightness remote is nullptr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return 0;
|
||||
}
|
||||
if (!data.WriteUint64(static_cast<uint64_t>(screenId))) {
|
||||
WLOGFE("Write screenId failed");
|
||||
return 0;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_SCREEN_BRIGHTNESS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return 0;
|
||||
}
|
||||
return reply.ReadUint32();
|
||||
}
|
||||
|
||||
std::vector<DisplayId> DisplayManagerLiteProxy::GetAllDisplayIds()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]GetAllDisplayIds remote is nullptr");
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<DisplayId> allDisplayIds;
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return allDisplayIds;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return allDisplayIds;
|
||||
}
|
||||
reply.ReadUInt64Vector(&allDisplayIds);
|
||||
return allDisplayIds;
|
||||
}
|
||||
|
||||
} // namespace OHOS::Rosen
|
@ -13,8 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "screen_manager_lite.h"
|
||||
|
||||
#include <cinttypes>
|
||||
#include "display_manager_adapter_lite.h"
|
||||
#include "display_manager_agent_default.h"
|
||||
#include "singleton_delegator.h"
|
||||
#include "window_manager_hilog.h"
|
||||
|
||||
@ -23,10 +24,95 @@ namespace {
|
||||
constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_DISPLAY, "ScreenManagerLite"};
|
||||
}
|
||||
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
class ScreenManagerLite::Impl : public RefBase {
|
||||
public:
|
||||
Impl() = default;
|
||||
~Impl();
|
||||
|
||||
static inline SingletonDelegator<ScreenManagerLite> delegator;
|
||||
DMError RegisterScreenListener(sptr<IScreenListener> listener);
|
||||
DMError UnregisterScreenListener(sptr<IScreenListener> listener);
|
||||
DMError RegisterDisplayManagerAgent();
|
||||
DMError UnregisterDisplayManagerAgent();
|
||||
void OnRemoteDied();
|
||||
|
||||
private:
|
||||
void NotifyScreenConnect(sptr<ScreenInfo> info);
|
||||
void NotifyScreenDisconnect(ScreenId);
|
||||
void NotifyScreenChange(const sptr<ScreenInfo>& screenInfo);
|
||||
|
||||
class ScreenManagerListener;
|
||||
sptr<ScreenManagerListener> screenManagerListener_;
|
||||
std::mutex mutex_;
|
||||
std::set<sptr<IScreenListener>> screenListeners_;
|
||||
};
|
||||
|
||||
class ScreenManagerLite::Impl::ScreenManagerListener : public DisplayManagerAgentDefault {
|
||||
public:
|
||||
explicit ScreenManagerListener(sptr<Impl> impl) : pImpl_(impl)
|
||||
{
|
||||
}
|
||||
|
||||
void OnScreenConnect(sptr<ScreenInfo> screenInfo)
|
||||
{
|
||||
if (screenInfo == nullptr || screenInfo->GetScreenId() == SCREEN_ID_INVALID) {
|
||||
WLOGFE("OnScreenConnect, screenInfo is invalid.");
|
||||
return;
|
||||
}
|
||||
if (pImpl_ == nullptr) {
|
||||
WLOGFE("OnScreenConnect, impl is nullptr.");
|
||||
return;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(pImpl_->mutex_);
|
||||
for (auto listener : pImpl_->screenListeners_) {
|
||||
listener->OnConnect(screenInfo->GetScreenId());
|
||||
}
|
||||
};
|
||||
|
||||
void OnScreenDisconnect(ScreenId screenId)
|
||||
{
|
||||
if (screenId == SCREEN_ID_INVALID) {
|
||||
WLOGFE("OnScreenDisconnect, screenId is invalid.");
|
||||
return;
|
||||
}
|
||||
if (pImpl_ == nullptr) {
|
||||
WLOGFE("OnScreenDisconnect, impl is nullptr.");
|
||||
return;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(pImpl_->mutex_);
|
||||
for (auto listener : pImpl_->screenListeners_) {
|
||||
listener->OnDisconnect(screenId);
|
||||
}
|
||||
};
|
||||
|
||||
void OnScreenChange(const sptr<ScreenInfo>& screenInfo, ScreenChangeEvent event)
|
||||
{
|
||||
if (screenInfo == nullptr) {
|
||||
WLOGFE("OnScreenChange, screenInfo is null.");
|
||||
return;
|
||||
}
|
||||
if (pImpl_ == nullptr) {
|
||||
WLOGFE("OnScreenChange, impl is nullptr.");
|
||||
return;
|
||||
}
|
||||
WLOGFD("OnScreenChange. event %{public}u", event);
|
||||
std::lock_guard<std::mutex> lock(pImpl_->mutex_);
|
||||
for (auto listener: pImpl_->screenListeners_) {
|
||||
listener->OnChange(screenInfo->GetScreenId());
|
||||
}
|
||||
};
|
||||
private:
|
||||
sptr<Impl> pImpl_;
|
||||
};
|
||||
|
||||
WM_IMPLEMENT_SINGLE_INSTANCE(ScreenManagerLite)
|
||||
|
||||
ScreenManagerLite::ScreenManagerLite()
|
||||
{
|
||||
pImpl_ = new Impl();
|
||||
WLOGFD("Create ScreenManagerLite instance");
|
||||
}
|
||||
|
||||
@ -35,9 +121,81 @@ ScreenManagerLite::~ScreenManagerLite()
|
||||
WLOGFD("Destroy ScreenManagerLite instance");
|
||||
}
|
||||
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
ScreenManagerLite::Impl::~Impl()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
UnregisterDisplayManagerAgent();
|
||||
}
|
||||
|
||||
DMError ScreenManagerLite::Impl::RegisterDisplayManagerAgent()
|
||||
{
|
||||
DMError regSucc = DMError::DM_OK;
|
||||
if (screenManagerListener_ == nullptr) {
|
||||
screenManagerListener_ = new ScreenManagerListener(this);
|
||||
regSucc = SingletonContainer::Get<ScreenManagerAdapterLite>().RegisterDisplayManagerAgent(
|
||||
screenManagerListener_, DisplayManagerAgentType::SCREEN_EVENT_LISTENER);
|
||||
if (regSucc != DMError::DM_OK) {
|
||||
screenManagerListener_ = nullptr;
|
||||
WLOGFW("RegisterDisplayManagerAgent failed !");
|
||||
}
|
||||
}
|
||||
return regSucc;
|
||||
}
|
||||
|
||||
DMError ScreenManagerLite::Impl::UnregisterDisplayManagerAgent()
|
||||
{
|
||||
DMError unRegSucc = DMError::DM_OK;
|
||||
if (screenManagerListener_ != nullptr) {
|
||||
unRegSucc = SingletonContainer::Get<ScreenManagerAdapterLite>().UnregisterDisplayManagerAgent(
|
||||
screenManagerListener_, DisplayManagerAgentType::SCREEN_EVENT_LISTENER);
|
||||
screenManagerListener_ = nullptr;
|
||||
if (unRegSucc != DMError::DM_OK) {
|
||||
WLOGFW("UnregisterDisplayManagerAgent failed!");
|
||||
}
|
||||
}
|
||||
return unRegSucc;
|
||||
}
|
||||
|
||||
DMError ScreenManagerLite::Impl::RegisterScreenListener(sptr<IScreenListener> listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
DMError regSucc = RegisterDisplayManagerAgent();
|
||||
if (regSucc == DMError::DM_OK) {
|
||||
screenListeners_.insert(listener);
|
||||
}
|
||||
return regSucc;
|
||||
}
|
||||
|
||||
DMError ScreenManagerLite::RegisterScreenListener(sptr<IScreenListener> listener)
|
||||
{
|
||||
if (listener == nullptr) {
|
||||
WLOGFE("RegisterScreenListener listener is nullptr.");
|
||||
return DMError::DM_ERROR_NULLPTR;
|
||||
}
|
||||
return pImpl_->RegisterScreenListener(listener);
|
||||
}
|
||||
|
||||
DMError ScreenManagerLite::Impl::UnregisterScreenListener(sptr<IScreenListener> listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto iter = std::find(screenListeners_.begin(), screenListeners_.end(), listener);
|
||||
if (iter == screenListeners_.end()) {
|
||||
WLOGFE("could not find this listener");
|
||||
return DMError::DM_ERROR_NULLPTR;
|
||||
}
|
||||
screenListeners_.erase(iter);
|
||||
return UnregisterDisplayManagerAgent();
|
||||
}
|
||||
|
||||
DMError ScreenManagerLite::UnregisterScreenListener(sptr<IScreenListener> listener)
|
||||
{
|
||||
if (listener == nullptr) {
|
||||
WLOGFE("UnregisterScreenListener listener is nullptr.");
|
||||
return DMError::DM_ERROR_NULLPTR;
|
||||
}
|
||||
return pImpl_->UnregisterScreenListener(listener);
|
||||
}
|
||||
|
||||
bool ScreenManagerLite::SetSpecifiedScreenPower(ScreenId screenId,
|
||||
ScreenPowerState state, PowerStateChangeReason reason)
|
||||
{
|
||||
@ -56,4 +214,16 @@ ScreenPowerState ScreenManagerLite::GetScreenPower(ScreenId dmsScreenId)
|
||||
return SingletonContainer::Get<ScreenManagerAdapterLite>().GetScreenPower(dmsScreenId);
|
||||
}
|
||||
|
||||
void ScreenManagerLite::Impl::OnRemoteDied()
|
||||
{
|
||||
WLOGFD("dms is died");
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
screenManagerListener_ = nullptr;
|
||||
}
|
||||
|
||||
void ScreenManagerLite::OnRemoteDied()
|
||||
{
|
||||
pImpl_->OnRemoteDied();
|
||||
}
|
||||
|
||||
} // namespace OHOS::Rosen
|
@ -28,6 +28,7 @@
|
||||
#include "screen.h"
|
||||
#include "screen_info.h"
|
||||
#include "screen_group_info.h"
|
||||
#include "display_manager_interface_code.h"
|
||||
#include "zidl/display_manager_agent_interface.h"
|
||||
|
||||
namespace OHOS::Rosen {
|
||||
@ -35,122 +36,6 @@ class IDisplayManager : public IRemoteBroker {
|
||||
public:
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IDisplayManager");
|
||||
|
||||
enum class DisplayManagerMessage : uint32_t {
|
||||
TRANS_ID_GET_DEFAULT_DISPLAY_INFO = 0,
|
||||
TRANS_ID_GET_DISPLAY_BY_ID,
|
||||
TRANS_ID_GET_DISPLAY_BY_SCREEN,
|
||||
TRANS_ID_GET_DISPLAY_SNAPSHOT,
|
||||
TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT,
|
||||
TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT,
|
||||
TRANS_ID_WAKE_UP_BEGIN,
|
||||
TRANS_ID_WAKE_UP_END,
|
||||
TRANS_ID_SUSPEND_BEGIN,
|
||||
TRANS_ID_SUSPEND_END,
|
||||
TRANS_ID_GET_INTERNAL_SCREEN_ID,
|
||||
TRANS_ID_SET_SCREEN_POWER_BY_ID,
|
||||
TRANS_ID_SET_SPECIFIED_SCREEN_POWER,
|
||||
TRANS_ID_SET_SCREEN_POWER_FOR_ALL,
|
||||
TRANS_ID_GET_SCREEN_POWER,
|
||||
TRANS_ID_SET_DISPLAY_STATE,
|
||||
TRANS_ID_GET_DISPLAY_STATE,
|
||||
TRANS_ID_GET_ALL_DISPLAYIDS,
|
||||
TRANS_ID_NOTIFY_DISPLAY_EVENT,
|
||||
TRANS_ID_TRY_TO_CANCEL_SCREEN_OFF,
|
||||
TRANS_ID_SET_FREEZE_EVENT,
|
||||
TRANS_ID_SCREEN_BASE = 1000,
|
||||
TRANS_ID_CREATE_VIRTUAL_SCREEN = TRANS_ID_SCREEN_BASE,
|
||||
TRANS_ID_DESTROY_VIRTUAL_SCREEN,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_CANVAS_ROTATION,
|
||||
TRANS_ID_GET_SCREEN_INFO_BY_ID,
|
||||
TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID,
|
||||
TRANS_ID_SET_SCREEN_ACTIVE_MODE,
|
||||
TRANS_ID_GET_ALL_SCREEN_INFOS,
|
||||
TRANS_ID_SET_ORIENTATION,
|
||||
TRANS_ID_SET_VIRTUAL_PIXEL_RATIO,
|
||||
TRANS_ID_SET_VIRTUAL_PIXEL_RATIO_SYSTEM,
|
||||
TRANS_ID_SET_RESOLUTION,
|
||||
TRANS_ID_GET_DENSITY_IN_CURRENT_RESOLUTION,
|
||||
TRANS_ID_SCREENGROUP_BASE = 1100,
|
||||
TRANS_ID_SCREEN_MAKE_MIRROR = TRANS_ID_SCREENGROUP_BASE,
|
||||
TRANS_ID_MULTI_SCREEN_MODE_SWITCH,
|
||||
TRANS_ID_SET_MULTI_SCREEN_POSITION,
|
||||
TRANS_ID_SCREEN_MAKE_EXPAND,
|
||||
TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP,
|
||||
TRANS_ID_SCREEN_GAMUT_BASE = 1200,
|
||||
TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS = TRANS_ID_SCREEN_GAMUT_BASE,
|
||||
TRANS_ID_SCREEN_GET_COLOR_GAMUT,
|
||||
TRANS_ID_SCREEN_SET_COLOR_GAMUT,
|
||||
TRANS_ID_SCREEN_GET_GAMUT_MAP,
|
||||
TRANS_ID_SCREEN_SET_GAMUT_MAP,
|
||||
TRANS_ID_SCREEN_SET_COLOR_TRANSFORM,
|
||||
TRANS_ID_SCREEN_GET_PIXEL_FORMAT,
|
||||
TRANS_ID_SCREEN_SET_PIXEL_FORMAT,
|
||||
TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT,
|
||||
TRANS_ID_SCREEN_GET_HDR_FORMAT,
|
||||
TRANS_ID_SCREEN_SET_HDR_FORMAT,
|
||||
TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE,
|
||||
TRANS_ID_SCREEN_GET_COLOR_SPACE,
|
||||
TRANS_ID_SCREEN_SET_COLOR_SPACE,
|
||||
TRANS_ID_IS_SCREEN_ROTATION_LOCKED,
|
||||
TRANS_ID_SET_SCREEN_ROTATION_LOCKED,
|
||||
TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS,
|
||||
TRANS_ID_HAS_PRIVATE_WINDOW,
|
||||
TRANS_ID_GET_CUTOUT_INFO,
|
||||
TRANS_ID_HAS_IMMERSIVE_WINDOW,
|
||||
TRANS_ID_ADD_SURFACE_NODE,
|
||||
TRANS_ID_REMOVE_SURFACE_NODE,
|
||||
TRANS_ID_SCREEN_STOP_MIRROR,
|
||||
TRANS_ID_SCREEN_STOP_EXPAND,
|
||||
TRANS_ID_SCREEN_DISABLE_MIRROR,
|
||||
TRANS_ID_SCENE_BOARD_SCREEN_BASE = 2000,
|
||||
TRANS_ID_SCENE_BOARD_DUMP_ALL_SCREEN,
|
||||
TRANS_ID_SCENE_BOARD_DUMP_SPECIAL_SCREEN,
|
||||
TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE,
|
||||
TRANS_ID_SET_FOLD_DISPLAY_MODE_FROM_JS,
|
||||
TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE,
|
||||
TRANS_ID_SCENE_BOARD_SET_DISPLAY_SCALE,
|
||||
TRANS_ID_SCENE_BOARD_IS_FOLDABLE,
|
||||
TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS,
|
||||
TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION,
|
||||
TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN,
|
||||
TRANS_ID_SCENE_BOARD_LOCK_FOLD_DISPLAY_STATUS,
|
||||
TRANS_ID_SET_LOCK_FOLD_DISPLAY_STATUS_FROM_JS,
|
||||
TRANS_ID_SET_CLIENT = 2500,
|
||||
TRANS_ID_GET_SCREEN_PROPERTY,
|
||||
TRANS_ID_GET_DISPLAY_NODE,
|
||||
TRANS_ID_UPDATE_SCREEN_ROTATION_PROPERTY,
|
||||
TRANS_ID_UPDATE_AVAILABLE_AREA,
|
||||
TRANS_ID_SET_SCREEN_OFF_DELAY_TIME,
|
||||
TRANS_ID_GET_CURVED_SCREEN_COMPRESSION_AREA,
|
||||
TRANS_ID_GET_PHY_SCREEN_PROPERTY,
|
||||
TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO,
|
||||
TRANS_ID_SET_SCREEN_PRIVACY_STATE,
|
||||
TRANS_ID_SET_SCREENID_PRIVACY_STATE,
|
||||
TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_LIST,
|
||||
TRANS_ID_RESIZE_VIRTUAL_SCREEN,
|
||||
TRANS_ID_GET_AVAILABLE_AREA,
|
||||
TRANS_ID_NOTIFY_FOLD_TO_EXPAND_COMPLETION,
|
||||
TRANS_ID_CONVERT_SCREENID_TO_RSSCREENID,
|
||||
TRANS_ID_GET_VIRTUAL_SCREEN_FLAG,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_FLAG,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_SCALE_MODE,
|
||||
TRANS_ID_GET_DEVICE_SCREEN_CONFIG,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_REFRESH_RATE,
|
||||
TRANS_ID_DEVICE_IS_CAPTURE,
|
||||
TRANS_ID_GET_SNAPSHOT_BY_PICKER,
|
||||
TRANS_ID_SWITCH_USER,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST,
|
||||
TRANS_ID_DISABLE_POWEROFF_RENDER_CONTROL,
|
||||
TRANS_ID_PROXY_FOR_FREEZE,
|
||||
TRANS_ID_RESET_ALL_FREEZE_STATUS,
|
||||
TRANS_ID_NOTIFY_DISPLAY_HOOK_INFO,
|
||||
TRANS_ID_GET_ALL_PHYSICAL_DISPLAY_RESOLUTION,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_STATUS,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_SECURITY_EXEMPTION,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_MAX_REFRESHRATE,
|
||||
};
|
||||
|
||||
virtual sptr<DisplayInfo> GetDefaultDisplayInfo() = 0;
|
||||
virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) = 0;
|
||||
virtual sptr<DisplayInfo> GetDisplayInfoByScreen(ScreenId screenId) = 0;
|
||||
@ -241,6 +126,8 @@ public:
|
||||
virtual bool SetDisplayState(DisplayState state) = 0;
|
||||
virtual DisplayState GetDisplayState(DisplayId displayId) = 0;
|
||||
virtual bool TryToCancelScreenOff() = 0;
|
||||
virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level) { return false; }
|
||||
virtual uint32_t GetScreenBrightness(uint64_t screenId) { return 0; }
|
||||
virtual std::vector<DisplayId> GetAllDisplayIds() = 0;
|
||||
virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) = 0;
|
||||
virtual void NotifyDisplayEvent(DisplayEvent event) = 0;
|
||||
|
138
dmserver/include/display_manager_interface_code.h
Normal file
138
dmserver/include/display_manager_interface_code.h
Normal file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright (c) 2024 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 FOUNDATION_DMSERVER_DISPLAY_MANAGER_INTERFACE_CODE_H
|
||||
#define FOUNDATION_DMSERVER_DISPLAY_MANAGER_INTERFACE_CODE_H
|
||||
|
||||
namespace OHOS::Rosen {
|
||||
enum class DisplayManagerMessage : unsigned int {
|
||||
TRANS_ID_GET_DEFAULT_DISPLAY_INFO = 0,
|
||||
TRANS_ID_GET_DISPLAY_BY_ID,
|
||||
TRANS_ID_GET_DISPLAY_BY_SCREEN,
|
||||
TRANS_ID_GET_DISPLAY_SNAPSHOT,
|
||||
TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT,
|
||||
TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT,
|
||||
TRANS_ID_WAKE_UP_BEGIN,
|
||||
TRANS_ID_WAKE_UP_END,
|
||||
TRANS_ID_SUSPEND_BEGIN,
|
||||
TRANS_ID_SUSPEND_END,
|
||||
TRANS_ID_GET_INTERNAL_SCREEN_ID,
|
||||
TRANS_ID_SET_SCREEN_POWER_BY_ID,
|
||||
TRANS_ID_SET_SPECIFIED_SCREEN_POWER,
|
||||
TRANS_ID_SET_SCREEN_POWER_FOR_ALL,
|
||||
TRANS_ID_GET_SCREEN_POWER,
|
||||
TRANS_ID_SET_DISPLAY_STATE,
|
||||
TRANS_ID_GET_DISPLAY_STATE,
|
||||
TRANS_ID_GET_ALL_DISPLAYIDS,
|
||||
TRANS_ID_NOTIFY_DISPLAY_EVENT,
|
||||
TRANS_ID_TRY_TO_CANCEL_SCREEN_OFF,
|
||||
TRANS_ID_SET_SCREEN_BRIGHTNESS,
|
||||
TRANS_ID_GET_SCREEN_BRIGHTNESS,
|
||||
TRANS_ID_SET_FREEZE_EVENT,
|
||||
TRANS_ID_SCREEN_BASE = 1000,
|
||||
TRANS_ID_CREATE_VIRTUAL_SCREEN = TRANS_ID_SCREEN_BASE,
|
||||
TRANS_ID_DESTROY_VIRTUAL_SCREEN,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_CANVAS_ROTATION,
|
||||
TRANS_ID_GET_SCREEN_INFO_BY_ID,
|
||||
TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID,
|
||||
TRANS_ID_SET_SCREEN_ACTIVE_MODE,
|
||||
TRANS_ID_GET_ALL_SCREEN_INFOS,
|
||||
TRANS_ID_SET_ORIENTATION,
|
||||
TRANS_ID_SET_VIRTUAL_PIXEL_RATIO,
|
||||
TRANS_ID_SET_VIRTUAL_PIXEL_RATIO_SYSTEM,
|
||||
TRANS_ID_SET_RESOLUTION,
|
||||
TRANS_ID_GET_DENSITY_IN_CURRENT_RESOLUTION,
|
||||
TRANS_ID_SCREENGROUP_BASE = 1100,
|
||||
TRANS_ID_SCREEN_MAKE_MIRROR = TRANS_ID_SCREENGROUP_BASE,
|
||||
TRANS_ID_MULTI_SCREEN_MODE_SWITCH,
|
||||
TRANS_ID_SET_MULTI_SCREEN_POSITION,
|
||||
TRANS_ID_SCREEN_MAKE_EXPAND,
|
||||
TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP,
|
||||
TRANS_ID_SCREEN_GAMUT_BASE = 1200,
|
||||
TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS = TRANS_ID_SCREEN_GAMUT_BASE,
|
||||
TRANS_ID_SCREEN_GET_COLOR_GAMUT,
|
||||
TRANS_ID_SCREEN_SET_COLOR_GAMUT,
|
||||
TRANS_ID_SCREEN_GET_GAMUT_MAP,
|
||||
TRANS_ID_SCREEN_SET_GAMUT_MAP,
|
||||
TRANS_ID_SCREEN_SET_COLOR_TRANSFORM,
|
||||
TRANS_ID_SCREEN_GET_PIXEL_FORMAT,
|
||||
TRANS_ID_SCREEN_SET_PIXEL_FORMAT,
|
||||
TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT,
|
||||
TRANS_ID_SCREEN_GET_HDR_FORMAT,
|
||||
TRANS_ID_SCREEN_SET_HDR_FORMAT,
|
||||
TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE,
|
||||
TRANS_ID_SCREEN_GET_COLOR_SPACE,
|
||||
TRANS_ID_SCREEN_SET_COLOR_SPACE,
|
||||
TRANS_ID_IS_SCREEN_ROTATION_LOCKED,
|
||||
TRANS_ID_SET_SCREEN_ROTATION_LOCKED,
|
||||
TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS,
|
||||
TRANS_ID_HAS_PRIVATE_WINDOW,
|
||||
TRANS_ID_GET_CUTOUT_INFO,
|
||||
TRANS_ID_HAS_IMMERSIVE_WINDOW,
|
||||
TRANS_ID_ADD_SURFACE_NODE,
|
||||
TRANS_ID_REMOVE_SURFACE_NODE,
|
||||
TRANS_ID_SCREEN_STOP_MIRROR,
|
||||
TRANS_ID_SCREEN_STOP_EXPAND,
|
||||
TRANS_ID_SCREEN_DISABLE_MIRROR,
|
||||
TRANS_ID_SCENE_BOARD_SCREEN_BASE = 2000,
|
||||
TRANS_ID_SCENE_BOARD_DUMP_ALL_SCREEN,
|
||||
TRANS_ID_SCENE_BOARD_DUMP_SPECIAL_SCREEN,
|
||||
TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE,
|
||||
TRANS_ID_SET_FOLD_DISPLAY_MODE_FROM_JS,
|
||||
TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE,
|
||||
TRANS_ID_SCENE_BOARD_SET_DISPLAY_SCALE,
|
||||
TRANS_ID_SCENE_BOARD_IS_FOLDABLE,
|
||||
TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS,
|
||||
TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION,
|
||||
TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN,
|
||||
TRANS_ID_SCENE_BOARD_LOCK_FOLD_DISPLAY_STATUS,
|
||||
TRANS_ID_SET_LOCK_FOLD_DISPLAY_STATUS_FROM_JS,
|
||||
TRANS_ID_SET_CLIENT = 2500,
|
||||
TRANS_ID_GET_SCREEN_PROPERTY,
|
||||
TRANS_ID_GET_DISPLAY_NODE,
|
||||
TRANS_ID_UPDATE_SCREEN_ROTATION_PROPERTY,
|
||||
TRANS_ID_UPDATE_AVAILABLE_AREA,
|
||||
TRANS_ID_SET_SCREEN_OFF_DELAY_TIME,
|
||||
TRANS_ID_GET_CURVED_SCREEN_COMPRESSION_AREA,
|
||||
TRANS_ID_GET_PHY_SCREEN_PROPERTY,
|
||||
TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO,
|
||||
TRANS_ID_SET_SCREEN_PRIVACY_STATE,
|
||||
TRANS_ID_SET_SCREENID_PRIVACY_STATE,
|
||||
TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_LIST,
|
||||
TRANS_ID_RESIZE_VIRTUAL_SCREEN,
|
||||
TRANS_ID_GET_AVAILABLE_AREA,
|
||||
TRANS_ID_NOTIFY_FOLD_TO_EXPAND_COMPLETION,
|
||||
TRANS_ID_CONVERT_SCREENID_TO_RSSCREENID,
|
||||
TRANS_ID_GET_VIRTUAL_SCREEN_FLAG,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_FLAG,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_SCALE_MODE,
|
||||
TRANS_ID_GET_DEVICE_SCREEN_CONFIG,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_REFRESH_RATE,
|
||||
TRANS_ID_DEVICE_IS_CAPTURE,
|
||||
TRANS_ID_GET_SNAPSHOT_BY_PICKER,
|
||||
TRANS_ID_SWITCH_USER,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST,
|
||||
TRANS_ID_DISABLE_POWEROFF_RENDER_CONTROL,
|
||||
TRANS_ID_PROXY_FOR_FREEZE,
|
||||
TRANS_ID_RESET_ALL_FREEZE_STATUS,
|
||||
TRANS_ID_NOTIFY_DISPLAY_HOOK_INFO,
|
||||
TRANS_ID_GET_ALL_PHYSICAL_DISPLAY_RESOLUTION,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_STATUS,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_SECURITY_EXEMPTION,
|
||||
TRANS_ID_SET_VIRTUAL_SCREEN_MAX_REFRESHRATE,
|
||||
};
|
||||
}
|
||||
#endif // FOUNDATION_DMSERVER_DISPLAY_MANAGER_INTERFACE_CODE_H
|
@ -91,6 +91,8 @@ public:
|
||||
DMError RemoveSurfaceNodeFromDisplay(DisplayId displayId, std::shared_ptr<RSSurfaceNode>& surfaceNode) override;
|
||||
DisplayState GetDisplayState(DisplayId displayId) override;
|
||||
bool TryToCancelScreenOff() override;
|
||||
bool SetScreenBrightness(uint64_t screenId, uint32_t level) override;
|
||||
uint32_t GetScreenBrightness(uint64_t screenId) override;
|
||||
void NotifyDisplayEvent(DisplayEvent event) override;
|
||||
bool SetFreeze(std::vector<DisplayId> displayIds, bool isFreeze) override;
|
||||
|
||||
|
@ -492,6 +492,19 @@ bool DisplayManagerService::TryToCancelScreenOff()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DisplayManagerService::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
RSInterfaces::GetInstance().SetScreenBacklight(screenId, level);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t DisplayManagerService::GetScreenBrightness(uint64_t screenId)
|
||||
{
|
||||
uint32_t level = static_cast<uint32_t>(RSInterfaces::GetInstance().GetScreenBacklight(screenId));
|
||||
TLOGI(WmsLogTag::DMS, "GetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
return level;
|
||||
}
|
||||
|
||||
void DisplayManagerService::NotifyDisplayEvent(DisplayEvent event)
|
||||
{
|
||||
if (!Permission::IsSystemServiceCalling()) {
|
||||
|
@ -193,6 +193,17 @@ int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data,
|
||||
reply.WriteUint32(static_cast<uint32_t>(state));
|
||||
break;
|
||||
}
|
||||
case DisplayManagerMessage::TRANS_ID_SET_SCREEN_BRIGHTNESS: {
|
||||
uint64_t screenId = data.ReadUint64();
|
||||
uint32_t level = data.ReadUint64();
|
||||
reply.WriteBool(SetScreenBrightness(screenId, level));
|
||||
break;
|
||||
}
|
||||
case DisplayManagerMessage::TRANS_ID_GET_SCREEN_BRIGHTNESS: {
|
||||
uint64_t screenId = data.ReadUint64();
|
||||
reply.WriteUint32(GetScreenBrightness(screenId));
|
||||
break;
|
||||
}
|
||||
case DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT: {
|
||||
DisplayEvent event = static_cast<DisplayEvent>(data.ReadUint32());
|
||||
NotifyDisplayEvent(event);
|
||||
|
@ -76,7 +76,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest01, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -96,7 +96,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest02, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -116,7 +116,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest03, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -136,7 +136,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest04, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -156,7 +156,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest05, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -176,7 +176,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest06, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -196,7 +196,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest07, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_ORIENTATION);
|
||||
DisplayManagerMessage::TRANS_ID_SET_ORIENTATION);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -216,7 +216,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest08, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -236,7 +236,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest09, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT);
|
||||
DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -256,7 +256,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest10, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT);
|
||||
DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -276,7 +276,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest11, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN);
|
||||
DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -296,7 +296,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest12, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_END);
|
||||
DisplayManagerMessage::TRANS_ID_WAKE_UP_END);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -316,7 +316,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest13, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN);
|
||||
DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -336,7 +336,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest14, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SUSPEND_END);
|
||||
DisplayManagerMessage::TRANS_ID_SUSPEND_END);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -356,7 +356,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest15, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -376,7 +376,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest16, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -396,7 +396,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest17, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -416,7 +416,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest18, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -436,7 +436,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest19, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -456,7 +456,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest20, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT);
|
||||
DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -476,7 +476,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest21, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_FREEZE_EVENT);
|
||||
DisplayManagerMessage::TRANS_ID_SET_FREEZE_EVENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -496,7 +496,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest22, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -516,7 +516,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest23, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -536,7 +536,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest24, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -556,7 +556,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest25, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS);
|
||||
DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -576,7 +576,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest26, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS);
|
||||
DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -596,7 +596,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest27, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -616,7 +616,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest28, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP);
|
||||
DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -636,7 +636,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest29, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -656,7 +656,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest30, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -676,7 +676,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest31, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -696,7 +696,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest32, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -716,7 +716,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest33, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -736,7 +736,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest34, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -756,7 +756,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest35, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -776,7 +776,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest36, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -796,7 +796,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest37, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_IS_SCREEN_ROTATION_LOCKED);
|
||||
DisplayManagerMessage::TRANS_ID_IS_SCREEN_ROTATION_LOCKED);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -816,7 +816,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest38, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -836,7 +836,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest39, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -856,7 +856,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest40, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_HAS_PRIVATE_WINDOW);
|
||||
DisplayManagerMessage::TRANS_ID_HAS_PRIVATE_WINDOW);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -876,7 +876,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest41, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_CUTOUT_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_GET_CUTOUT_INFO);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -896,7 +896,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest42, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_ADD_SURFACE_NODE);
|
||||
DisplayManagerMessage::TRANS_ID_ADD_SURFACE_NODE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -916,7 +916,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest43, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_REMOVE_SURFACE_NODE);
|
||||
DisplayManagerMessage::TRANS_ID_REMOVE_SURFACE_NODE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -936,7 +936,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest44, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_STOP_MIRROR);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_STOP_MIRROR);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -956,7 +956,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest45, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_STOP_EXPAND);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_STOP_EXPAND);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -976,7 +976,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest46, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_RESIZE_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_RESIZE_VIRTUAL_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -996,7 +996,7 @@ HWTEST_F(DisplayManagerStubTest, OnRemoteRequest47, Function | SmallTest | Level
|
||||
data.WriteInterfaceToken(DisplayManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
|
@ -192,6 +192,23 @@ public:
|
||||
*/
|
||||
bool SuspendEnd();
|
||||
|
||||
/**
|
||||
* @brief Get id of internal screen.
|
||||
*
|
||||
* @return Internal screen id.
|
||||
*/
|
||||
ScreenId GetInternalScreenId();
|
||||
|
||||
/**
|
||||
* @brief Set the screen power state by screen id.
|
||||
*
|
||||
* @param screenId Screen id.
|
||||
* @param state Screen power state.
|
||||
* @param reason Reason for power state change.
|
||||
* @return True means set success, false means set failed.
|
||||
*/
|
||||
bool SetScreenPowerById(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason);
|
||||
|
||||
/**
|
||||
* @brief Set the Display State object
|
||||
*
|
||||
@ -209,6 +226,14 @@ public:
|
||||
*/
|
||||
DisplayState GetDisplayState(DisplayId displayId);
|
||||
|
||||
/**
|
||||
* @brief Try to cancel screenoff action before display power off.
|
||||
*
|
||||
* @return True means cancel screenoff action success.
|
||||
* @return False means cancel screenoff action failed.
|
||||
*/
|
||||
bool TryToCancelScreenOff();
|
||||
|
||||
/**
|
||||
* @brief Set the brightness level of the target screen.
|
||||
*
|
||||
|
@ -23,11 +23,45 @@
|
||||
namespace OHOS::Rosen {
|
||||
class ScreenManagerLite : public RefBase {
|
||||
WM_DECLARE_SINGLE_INSTANCE_BASE(ScreenManagerLite);
|
||||
friend class DMSDeathRecipient;
|
||||
friend class DMSDeathRecipientLite;
|
||||
public:
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
class IScreenListener : public virtual RefBase {
|
||||
public:
|
||||
/**
|
||||
* @brief Notify when a new screen is connected.
|
||||
*/
|
||||
virtual void OnConnect(ScreenId) = 0;
|
||||
|
||||
/**
|
||||
* @brief Notify when a screen is disconnected.
|
||||
*/
|
||||
virtual void OnDisconnect(ScreenId) = 0;
|
||||
|
||||
/**
|
||||
* @brief Notify when state of the screen is changed.
|
||||
*/
|
||||
virtual void OnChange(ScreenId) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Register screen listener.
|
||||
*
|
||||
* @param listener IScreenListener.
|
||||
* @return DM_OK means register success, others means register failed.
|
||||
*/
|
||||
DMError RegisterScreenListener(sptr<IScreenListener> listener);
|
||||
|
||||
/**
|
||||
* @brief Unregister screen listener.
|
||||
*
|
||||
* @param listener IScreenListener.
|
||||
* @return DM_OK means unregister success, others means unregister failed.
|
||||
*/
|
||||
DMError UnregisterScreenListener(sptr<IScreenListener> listener);
|
||||
|
||||
/**
|
||||
* @brief Set the screen power state on the specified screen.
|
||||
*
|
||||
@ -58,6 +92,9 @@ private:
|
||||
ScreenManagerLite();
|
||||
~ScreenManagerLite();
|
||||
void OnRemoteDied();
|
||||
|
||||
class Impl;
|
||||
sptr<Impl> pImpl_;
|
||||
};
|
||||
} // namespace OHOS::Rosen
|
||||
|
||||
|
@ -86,53 +86,53 @@ bool IPCFuzzTest(const uint8_t* data, size_t size)
|
||||
void IPCSpecificInterfaceFuzzTest1(sptr<IRemoteObject> proxy, MessageParcel& sendData, MessageParcel& reply,
|
||||
MessageOption& option)
|
||||
{
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_END),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_WAKE_UP_END),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SUSPEND_END),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SUSPEND_END),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_FREEZE_EVENT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_FREEZE_EVENT),
|
||||
sendData, reply, option);
|
||||
}
|
||||
|
||||
@ -141,48 +141,48 @@ void IPCSpecificInterfaceFuzzTest2(sptr<IRemoteObject> proxy, MessageParcel& sen
|
||||
{
|
||||
int flags = option.GetFlags();
|
||||
option.SetFlags(MessageOption::TF_SYNC);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN),
|
||||
sendData, reply, option);
|
||||
manager->DestroyVirtualScreen(static_cast<ScreenId>(reply.ReadUint64()));
|
||||
option.SetFlags(flags);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_ORIENTATION),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_ORIENTATION),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP),
|
||||
proxy->SendRequest(static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM),
|
||||
sendData, reply, option);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace {
|
||||
constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "ScreenSessionManagerFuzzTest"};
|
||||
}
|
||||
|
||||
using DMMessage = IScreenSessionManager::DisplayManagerMessage;
|
||||
using DMMessage = DisplayManagerMessage;
|
||||
|
||||
std::pair<sptr<IScreenSessionManager>, sptr<IRemoteObject>> GetProxy()
|
||||
{
|
||||
|
@ -49,12 +49,12 @@ bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size)
|
||||
parcel.RewindRead(0);
|
||||
std::shared_ptr<ScreenSessionManagerStub> screenStub = std::make_shared<ScreenSessionManagerStub>();
|
||||
screenStub->OnRemoteRequest(
|
||||
static_cast<uint32_t>(Rosen::IDisplayManager::DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT),
|
||||
parcel, reply, option);
|
||||
parcel.RewindRead(0);
|
||||
screenStub->OnRemoteRequest(
|
||||
static_cast<uint32_t>(
|
||||
Rosen::IDisplayManager::DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT),
|
||||
DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT),
|
||||
parcel, reply, option);
|
||||
return true;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size)
|
||||
|
||||
std::shared_ptr<ScreenSessionManagerStub> screenStub = std::make_shared<ScreenSessionManagerStub>();
|
||||
screenStub->OnRemoteRequest(
|
||||
static_cast<uint32_t>(Rosen::IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
parcel, reply, option);
|
||||
return true;
|
||||
}
|
||||
|
@ -49,11 +49,11 @@ bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size)
|
||||
parcel.RewindRead(0);
|
||||
std::shared_ptr<ScreenSessionManagerStub> screenStub = std::make_shared<ScreenSessionManagerStub>();
|
||||
screenStub->OnRemoteRequest(
|
||||
static_cast<uint32_t>(Rosen::IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN),
|
||||
parcel, reply, option);
|
||||
parcel.RewindRead(0);
|
||||
screenStub->OnRemoteRequest(
|
||||
static_cast<uint32_t>(Rosen::IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_END),
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_WAKE_UP_END),
|
||||
parcel, reply, option);
|
||||
return true;
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ public:
|
||||
bool SetScreenPowerById(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason) override;
|
||||
bool SetDisplayState(DisplayState state) override;
|
||||
DisplayState GetDisplayState(DisplayId displayId) override;
|
||||
bool SetScreenBrightness(uint64_t screenId, uint32_t level) override;
|
||||
uint32_t GetScreenBrightness(uint64_t screenId) override;
|
||||
bool SetSpecifiedScreenPower(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason) override;
|
||||
bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) override;
|
||||
ScreenPowerState GetScreenPower(ScreenId screenId) override;
|
||||
|
@ -47,21 +47,6 @@ public:
|
||||
sptr<DisplayInfo> GetDefaultDisplayInfo() override;
|
||||
virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) override;
|
||||
sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) override;
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
bool WakeUpBegin(PowerStateChangeReason reason) override;
|
||||
bool WakeUpEnd() override;
|
||||
bool SuspendBegin(PowerStateChangeReason reason) override;
|
||||
bool SuspendEnd() override;
|
||||
bool SetSpecifiedScreenPower(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason) override;
|
||||
bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) override;
|
||||
ScreenPowerState GetScreenPower(ScreenId dmsScreenId) override;
|
||||
bool SetDisplayState(DisplayState state) override;
|
||||
DisplayState GetDisplayState(DisplayId displayId) override;
|
||||
bool SetScreenBrightness(uint64_t screenId, uint32_t level) override;
|
||||
uint32_t GetScreenBrightness(uint64_t screenId) override;
|
||||
std::vector<DisplayId> GetAllDisplayIds() override;
|
||||
protected:
|
||||
ScreenSessionManagerLite() = default;
|
||||
virtual ~ScreenSessionManagerLite();
|
||||
|
@ -98,6 +98,8 @@ public:
|
||||
virtual bool SetDisplayState(DisplayState state) override { return false; }
|
||||
virtual DisplayState GetDisplayState(DisplayId displayId) override {return DisplayState::UNKNOWN; }
|
||||
virtual bool TryToCancelScreenOff() override { return false; }
|
||||
virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level) override { return false; }
|
||||
virtual uint32_t GetScreenBrightness(uint64_t screenId) override { return 0; }
|
||||
virtual std::vector<DisplayId> GetAllDisplayIds() override { return std::vector<DisplayId>{}; }
|
||||
virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) override { return nullptr; }
|
||||
virtual void NotifyDisplayEvent(DisplayEvent event) override {}
|
||||
|
@ -63,8 +63,6 @@ public:
|
||||
TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS,
|
||||
TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION,
|
||||
TRANS_ID_GET_CUTOUT_INFO,
|
||||
TRANS_ID_SET_SCREEN_BRIGHTNESS,
|
||||
TRANS_ID_GET_SCREEN_BRIGHTNESS,
|
||||
};
|
||||
|
||||
virtual DMError RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
|
||||
@ -79,21 +77,6 @@ public:
|
||||
virtual sptr<DisplayInfo> GetDefaultDisplayInfo() { return nullptr; }
|
||||
virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) { return nullptr; }
|
||||
virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) { return nullptr; }
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
virtual bool WakeUpBegin(PowerStateChangeReason reason) { return false; }
|
||||
virtual bool WakeUpEnd() { return false; }
|
||||
virtual bool SuspendBegin(PowerStateChangeReason reason) { return false; }
|
||||
virtual bool SuspendEnd() { return false; }
|
||||
virtual bool SetSpecifiedScreenPower(ScreenId, ScreenPowerState, PowerStateChangeReason) { return false; }
|
||||
virtual bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) { return false; }
|
||||
virtual ScreenPowerState GetScreenPower(ScreenId dmsScreenId) { return ScreenPowerState::INVALID_STATE; }
|
||||
virtual bool SetDisplayState(DisplayState state) { return false; }
|
||||
virtual DisplayState GetDisplayState(DisplayId displayId) { return DisplayState::UNKNOWN; }
|
||||
virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level) { return false; }
|
||||
virtual uint32_t GetScreenBrightness(uint64_t screenId) { return 0; }
|
||||
virtual std::vector<DisplayId> GetAllDisplayIds() { return std::vector<DisplayId>{}; }
|
||||
};
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
@ -42,21 +42,6 @@ public:
|
||||
virtual sptr<DisplayInfo> GetDefaultDisplayInfo() override;
|
||||
virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) override;
|
||||
virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) override;
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
virtual bool WakeUpBegin(PowerStateChangeReason reason) override;
|
||||
virtual bool WakeUpEnd() override;
|
||||
virtual bool SuspendBegin(PowerStateChangeReason reason) override;
|
||||
virtual bool SuspendEnd() override;
|
||||
virtual bool SetSpecifiedScreenPower(ScreenId, ScreenPowerState, PowerStateChangeReason) override;
|
||||
virtual bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) override;
|
||||
virtual ScreenPowerState GetScreenPower(ScreenId dmsScreenId) override;
|
||||
virtual bool SetDisplayState(DisplayState state) override;
|
||||
virtual DisplayState GetDisplayState(DisplayId displayId) override;
|
||||
virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level) override;
|
||||
virtual uint32_t GetScreenBrightness(uint64_t screenId) override;
|
||||
virtual std::vector<DisplayId> GetAllDisplayIds() override;
|
||||
private:
|
||||
static inline BrokerDelegator<ScreenSessionManagerLiteProxy> delegator_;
|
||||
};
|
||||
|
@ -31,7 +31,6 @@ public:
|
||||
virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
|
||||
MessageOption &option) override;
|
||||
private:
|
||||
int RemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option);
|
||||
int HandleRegisterDisplayManagerAgent(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleUnRegisterDisplayManagerAgent(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetFoldDisplayMode(MessageParcel& data, MessageParcel& reply);
|
||||
@ -41,21 +40,6 @@ private:
|
||||
int HandleGetDefaultDisplayInfo(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetDisplayById(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetCutoutInfo(MessageParcel& data, MessageParcel& reply);
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
int HandleWakeUpBegin(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleWakeUpEnd(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSuspendBegin(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSuspendEnd(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetSpecifiedScreenPower(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetScreenPowerForAll(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetScreenPower(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetDisplayState(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetDisplayState(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetScreenBrightness(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetScreenBrightness(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetAllDisplayIds(MessageParcel& data, MessageParcel& reply);
|
||||
};
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
@ -1617,6 +1617,20 @@ bool ScreenSessionManager::TryToCancelScreenOff()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSessionManager::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
TLOGI(WmsLogTag::DMS, "SetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
RSInterfaces::GetInstance().SetScreenBacklight(screenId, level);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t ScreenSessionManager::GetScreenBrightness(uint64_t screenId)
|
||||
{
|
||||
uint32_t level = static_cast<uint32_t>(RSInterfaces::GetInstance().GetScreenBacklight(screenId));
|
||||
TLOGI(WmsLogTag::DMS, "GetScreenBrightness screenId:%{public}" PRIu64", level:%{public}u,", screenId, level);
|
||||
return level;
|
||||
}
|
||||
|
||||
int32_t ScreenSessionManager::SetScreenOffDelayTime(int32_t delay)
|
||||
{
|
||||
DmsXcollie dmsXcollie("DMS:SetScreenOffDelayTime", XCOLLIE_TIMEOUT_10S);
|
||||
|
@ -158,113 +158,6 @@ sptr<CutoutInfo> ScreenSessionManagerLite::GetCutoutInfo(DisplayId displayId)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
bool ScreenSessionManagerLite::WakeUpBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->WakeUpBegin(reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::WakeUpEnd()
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->WakeUpEnd();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::SuspendBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->SuspendBegin(reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::SuspendEnd()
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->SuspendEnd();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::SetSpecifiedScreenPower(ScreenId screenId, ScreenPowerState state,
|
||||
PowerStateChangeReason reason)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->SetSpecifiedScreenPower(screenId, state, reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->SetScreenPowerForAll(state, reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ScreenPowerState ScreenSessionManagerLite::GetScreenPower(ScreenId dmsScreenId)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->GetScreenPower(dmsScreenId);
|
||||
}
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::SetDisplayState(DisplayState state)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->SetDisplayState(state);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
DisplayState ScreenSessionManagerLite::GetDisplayState(DisplayId displayId)
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->GetDisplayState(displayId);
|
||||
}
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLite::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
ConnectToServer();
|
||||
RSInterfaces::GetInstance().SetScreenBacklight(screenId, level);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t ScreenSessionManagerLite::GetScreenBrightness(uint64_t screenId)
|
||||
{
|
||||
ConnectToServer();
|
||||
return static_cast<uint32_t>(RSInterfaces::GetInstance().GetScreenBacklight(screenId));
|
||||
}
|
||||
|
||||
std::vector<DisplayId> ScreenSessionManagerLite::GetAllDisplayIds()
|
||||
{
|
||||
ConnectToServer();
|
||||
if (screenSessionManager_) {
|
||||
return screenSessionManager_->GetAllDisplayIds();
|
||||
}
|
||||
return std::vector<DisplayId>{};
|
||||
}
|
||||
|
||||
void ScreenSessionManagerLite::Clear()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
|
@ -289,342 +289,4 @@ sptr<CutoutInfo> ScreenSessionManagerLiteProxy::GetCutoutInfo(DisplayId displayI
|
||||
sptr<CutoutInfo> info = reply.ReadParcelable<CutoutInfo>();
|
||||
return info;
|
||||
}
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
bool ScreenSessionManagerLiteProxy::WakeUpBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]WakeUpBegin remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WakeUpBegin: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]WakeUpBegin: Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_WAKE_UP_BEGIN),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]WakeUpBegin: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::WakeUpEnd()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]WakeUpEnd remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WakeUpEnd: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_WAKE_UP_END),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]WakeUpEnd: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::SuspendBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SuspendBegin remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]SuspendBegin: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]SuspendBegin: Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_SUSPEND_BEGIN),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SuspendBegin: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::SuspendEnd()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SuspendEnd remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]SuspendEnd: WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_SUSPEND_END),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SuspendEnd: SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::SetSpecifiedScreenPower(ScreenId screenId, ScreenPowerState state,
|
||||
PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetSpecifiedScreenPower remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(screenId))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenId failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenPowerState failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetScreenPowerForAll remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write ScreenPowerState failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(reason))) {
|
||||
WLOGFE("[UL_POWER]Write PowerStateChangeReason failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
ScreenPowerState ScreenSessionManagerLiteProxy::GetScreenPower(ScreenId dmsScreenId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("GetScreenPower remote is nullptr");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
if (!data.WriteUint64(static_cast<uint64_t>(dmsScreenId))) {
|
||||
WLOGFE("Write dmsScreenId failed");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_GET_SCREEN_POWER),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
return static_cast<ScreenPowerState>(reply.ReadUint32());
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::SetDisplayState(DisplayState state)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]SetDisplayState remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("[UL_POWER]WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint32(static_cast<uint32_t>(state))) {
|
||||
WLOGFE("[UL_POWER]Write DisplayState failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_SET_DISPLAY_STATE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("[UL_POWER]SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
DisplayState ScreenSessionManagerLiteProxy::GetDisplayState(DisplayId displayId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("GetDisplayState remote is nullptr");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
if (!data.WriteUint64(displayId)) {
|
||||
WLOGFE("Write displayId failed");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_GET_DISPLAY_STATE),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return DisplayState::UNKNOWN;
|
||||
}
|
||||
return static_cast<DisplayState>(reply.ReadUint32());
|
||||
}
|
||||
|
||||
bool ScreenSessionManagerLiteProxy::SetScreenBrightness(uint64_t screenId, uint32_t level)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("SetScreenBrightness remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint64(screenId)) {
|
||||
WLOGFE("Write screenId failed");
|
||||
return false;
|
||||
}
|
||||
if (!data.WriteUint64(level)) {
|
||||
WLOGFE("Write level failed");
|
||||
return false;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_SET_SCREEN_BRIGHTNESS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
}
|
||||
|
||||
uint32_t ScreenSessionManagerLiteProxy::GetScreenBrightness(uint64_t screenId)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("GetScreenBrightness remote is nullptr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return 0;
|
||||
}
|
||||
if (!data.WriteUint64(static_cast<uint64_t>(screenId))) {
|
||||
WLOGFE("Write screenId failed");
|
||||
return 0;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_GET_SCREEN_BRIGHTNESS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return 0;
|
||||
}
|
||||
return reply.ReadUint32();
|
||||
}
|
||||
|
||||
std::vector<DisplayId> ScreenSessionManagerLiteProxy::GetAllDisplayIds()
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
WLOGFE("[UL_POWER]GetAllDisplayIds remote is nullptr");
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<DisplayId> allDisplayIds;
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return allDisplayIds;
|
||||
}
|
||||
if (remote->SendRequest(static_cast<uint32_t>(ScreenManagerLiteMessage::TRANS_ID_GET_ALL_DISPLAYIDS),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFW("SendRequest failed");
|
||||
return allDisplayIds;
|
||||
}
|
||||
reply.ReadUInt64Vector(&allDisplayIds);
|
||||
return allDisplayIds;
|
||||
}
|
||||
|
||||
} // namespace OHOS::Rosen
|
||||
|
@ -35,80 +35,42 @@ int32_t ScreenSessionManagerLiteStub::OnRemoteRequest(uint32_t code, MessageParc
|
||||
}
|
||||
ScreenManagerLiteMessage msgId = static_cast<ScreenManagerLiteMessage>(code);
|
||||
switch (msgId) {
|
||||
case ScreenManagerLiteMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT:
|
||||
case ScreenManagerLiteMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT: {
|
||||
HandleRegisterDisplayManagerAgent(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT: {
|
||||
HandleUnRegisterDisplayManagerAgent(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE: {
|
||||
HandleGetFoldDisplayMode(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE: {
|
||||
HandleSetFoldDisplayMode(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_IS_FOLDABLE:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_IS_FOLDABLE: {
|
||||
HandleIsFoldable(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS: {
|
||||
HandleGetFoldStatus(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO: {
|
||||
HandleGetDefaultDisplayInfo(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_DISPLAY_BY_ID:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_DISPLAY_BY_ID: {
|
||||
HandleGetDisplayById(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_CUTOUT_INFO:
|
||||
}
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_CUTOUT_INFO: {
|
||||
HandleGetCutoutInfo(data, reply);
|
||||
break;
|
||||
default:
|
||||
return RemoteRequest(code, data, reply, option);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::RemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply,
|
||||
MessageOption& option)
|
||||
{
|
||||
ScreenManagerLiteMessage msgId = static_cast<ScreenManagerLiteMessage>(code);
|
||||
switch (msgId) {
|
||||
case ScreenManagerLiteMessage::TRANS_ID_WAKE_UP_BEGIN:
|
||||
HandleWakeUpBegin(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_WAKE_UP_END:
|
||||
HandleWakeUpEnd(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SUSPEND_BEGIN:
|
||||
HandleSuspendBegin(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SUSPEND_END:
|
||||
HandleSuspendEnd(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER:
|
||||
HandleSetSpecifiedScreenPower(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL:
|
||||
HandleSetScreenPowerForAll(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_SCREEN_POWER:
|
||||
HandleGetScreenPower(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SET_DISPLAY_STATE:
|
||||
HandleSetDisplayState(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_DISPLAY_STATE:
|
||||
HandleGetDisplayState(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_ALL_DISPLAYIDS:
|
||||
HandleGetAllDisplayIds(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_SET_SCREEN_BRIGHTNESS:
|
||||
HandleSetScreenBrightness(data, reply);
|
||||
break;
|
||||
case ScreenManagerLiteMessage::TRANS_ID_GET_SCREEN_BRIGHTNESS:
|
||||
HandleGetScreenBrightness(data, reply);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
WLOGFW("unknown transaction code");
|
||||
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
|
||||
@ -197,109 +159,4 @@ int ScreenSessionManagerLiteStub::HandleGetCutoutInfo(MessageParcel &data, Messa
|
||||
reply.WriteParcelable(cutoutInfo);
|
||||
return ERR_NONE;
|
||||
}
|
||||
/*
|
||||
* used by powermgr
|
||||
*/
|
||||
int ScreenSessionManagerLiteStub::HandleWakeUpBegin(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleWakeUpBegin!");
|
||||
PowerStateChangeReason reason = static_cast<PowerStateChangeReason>(data.ReadUint32());
|
||||
reply.WriteBool(WakeUpBegin(reason));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleWakeUpEnd(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleWakeUpEnd!");
|
||||
reply.WriteBool(WakeUpEnd());
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleSuspendBegin(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleSuspendBegin!");
|
||||
PowerStateChangeReason reason = static_cast<PowerStateChangeReason>(data.ReadUint32());
|
||||
reply.WriteBool(SuspendBegin(reason));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleSuspendEnd(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleSuspendEnd!");
|
||||
reply.WriteBool(SuspendEnd());
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleSetSpecifiedScreenPower(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleSetSpecifiedScreenPower!");
|
||||
ScreenId screenId = static_cast<ScreenId>(data.ReadUint32());
|
||||
ScreenPowerState state = static_cast<ScreenPowerState>(data.ReadUint32());
|
||||
PowerStateChangeReason reason = static_cast<PowerStateChangeReason>(data.ReadUint32());
|
||||
reply.WriteBool(SetSpecifiedScreenPower(screenId, state, reason));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleSetScreenPowerForAll(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleSetScreenPowerForAll!");
|
||||
ScreenPowerState state = static_cast<ScreenPowerState>(data.ReadUint32());
|
||||
PowerStateChangeReason reason = static_cast<PowerStateChangeReason>(data.ReadUint32());
|
||||
reply.WriteBool(SetScreenPowerForAll(state, reason));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleGetScreenPower(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleGetScreenPower!");
|
||||
ScreenId dmsScreenId;
|
||||
if (!data.ReadUint64(dmsScreenId)) {
|
||||
WLOGFE("fail to read dmsScreenId.");
|
||||
return ERR_INVALID_DATA;
|
||||
}
|
||||
reply.WriteUint32(static_cast<uint32_t>(GetScreenPower(dmsScreenId)));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleSetDisplayState(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleSetDisplayState!");
|
||||
DisplayState state = static_cast<DisplayState>(data.ReadUint32());
|
||||
reply.WriteBool(SetDisplayState(state));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleGetDisplayState(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleGetDisplayState!");
|
||||
DisplayState state = GetDisplayState(data.ReadUint64());
|
||||
reply.WriteUint32(static_cast<uint32_t>(state));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleSetScreenBrightness(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleSetScreenBrightness!");
|
||||
uint64_t screenId = data.ReadUint64();
|
||||
uint32_t level = data.ReadUint64();
|
||||
reply.WriteBool(SetScreenBrightness(screenId, level));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleGetScreenBrightness(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleGetScreenBrightness!");
|
||||
uint64_t screenId = data.ReadUint64();
|
||||
reply.WriteUint32(GetScreenBrightness(screenId));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int ScreenSessionManagerLiteStub::HandleGetAllDisplayIds(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("run HandleGetAllDisplayIds!");
|
||||
std::vector<DisplayId> allDisplayIds = GetAllDisplayIds();
|
||||
reply.WriteUInt64Vector(allDisplayIds);
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
} // namespace OHOS::Rosen
|
||||
|
@ -135,6 +135,17 @@ int32_t ScreenSessionManagerStub::OnRemoteRequest(uint32_t code, MessageParcel&
|
||||
reply.WriteBool(TryToCancelScreenOff());
|
||||
break;
|
||||
}
|
||||
case DisplayManagerMessage::TRANS_ID_SET_SCREEN_BRIGHTNESS: {
|
||||
uint64_t screenId = data.ReadUint64();
|
||||
uint32_t level = data.ReadUint64();
|
||||
reply.WriteBool(SetScreenBrightness(screenId, level));
|
||||
break;
|
||||
}
|
||||
case DisplayManagerMessage::TRANS_ID_GET_SCREEN_BRIGHTNESS: {
|
||||
uint64_t screenId = data.ReadUint64();
|
||||
reply.WriteUint32(GetScreenBrightness(screenId));
|
||||
break;
|
||||
}
|
||||
case DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID: {
|
||||
DisplayId displayId = data.ReadUint64();
|
||||
auto info = GetDisplayInfoById(displayId);
|
||||
|
@ -213,7 +213,10 @@ ohos_unittest("ws_screen_setting_helper_test") {
|
||||
ohos_unittest("ws_screen_session_manager_lite_test") {
|
||||
module_out_path = module_out_path
|
||||
|
||||
sources = [ "screen_session_manager_lite_test.cpp" ]
|
||||
sources = [
|
||||
"${window_base_path}/wmserver/src/zidl/mock_session_manager_service_proxy.cpp",
|
||||
"screen_session_manager_lite_test.cpp",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":ws_unittest_common",
|
||||
@ -374,7 +377,10 @@ ohos_unittest("ws_screen_session_manager_client_test") {
|
||||
ohos_unittest("ws_screen_session_manager_lite_proxy_test") {
|
||||
module_out_path = module_out_path
|
||||
|
||||
sources = [ "screen_session_manager_lite_proxy_test.cpp" ]
|
||||
sources = [
|
||||
"${window_base_path}/window_scene/screen_session_manager/src/zidl/screen_session_manager_lite_proxy.cpp",
|
||||
"screen_session_manager_lite_proxy_test.cpp",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":ws_unittest_common",
|
||||
|
@ -160,102 +160,6 @@ HWTEST_F(ScreenSessionManagerLiteProxyTest, GetCutoutInfo, Function | SmallTest
|
||||
auto res = screenSessionManagerLiteProxy_->GetCutoutInfo(displayId);
|
||||
ASSERT_EQ(nullptr, res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: WakeUpBegin
|
||||
* @tc.desc: WakeUpBegin
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, WakeUpBegin, Function | SmallTest | Level1)
|
||||
{
|
||||
PowerStateChangeReason reason {0};
|
||||
bool expectation = true;
|
||||
EXPECT_EQ(expectation, screenSessionManagerLiteProxy_->WakeUpBegin(reason));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: WakeUpEnd
|
||||
* @tc.desc: WakeUpEnd
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, WakeUpEnd, Function | SmallTest | Level1)
|
||||
{
|
||||
bool expectation = true;
|
||||
EXPECT_EQ(expectation, screenSessionManagerLiteProxy_->WakeUpEnd());
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SuspendEnd
|
||||
* @tc.desc: SuspendEnd
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, SuspendEnd, Function | SmallTest | Level1)
|
||||
{
|
||||
bool expectation = true;
|
||||
EXPECT_EQ(expectation, screenSessionManagerLiteProxy_->SuspendEnd());
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetDisplayState
|
||||
* @tc.desc: SetDisplayState
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, SetDisplayState, Function | SmallTest | Level1)
|
||||
{
|
||||
DisplayState state {1};
|
||||
screenSessionManagerLiteProxy_->SetDisplayState(state);
|
||||
int resultValue = 0;
|
||||
ASSERT_EQ(resultValue, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetSpecifiedScreenPower
|
||||
* @tc.desc: SetSpecifiedScreenPower
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, SetSpecifiedScreenPower, Function | SmallTest | Level1)
|
||||
{
|
||||
ScreenPowerState state {0};
|
||||
ScreenId id = 1001;
|
||||
PowerStateChangeReason reason {1};
|
||||
bool expectation = true;
|
||||
EXPECT_EQ(expectation, screenSessionManagerLiteProxy_->SetSpecifiedScreenPower(id, state, reason));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetScreenPowerForAll
|
||||
* @tc.desc: SetScreenPowerForAll
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, SetScreenPowerForAll, Function | SmallTest | Level1)
|
||||
{
|
||||
ScreenPowerState state {0};
|
||||
PowerStateChangeReason reason {1};
|
||||
bool expectation = true;
|
||||
EXPECT_EQ(expectation, screenSessionManagerLiteProxy_->SetScreenPowerForAll(state, reason));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GetDisplayState
|
||||
* @tc.desc: GetDisplayState
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, GetDisplayState, Function | SmallTest | Level1)
|
||||
{
|
||||
DisplayId displayId {0};
|
||||
EXPECT_NE(DisplayState::UNKNOWN, screenSessionManagerLiteProxy_->GetDisplayState(displayId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GetScreenPower
|
||||
* @tc.desc: GetScreenPower
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionManagerLiteProxyTest, GetScreenPower, Function | SmallTest | Level1)
|
||||
{
|
||||
ScreenId dmsScreenId = 1001;
|
||||
EXPECT_NE(ScreenPowerState::INVALID_STATE, screenSessionManagerLiteProxy_->GetScreenPower(dmsScreenId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -78,7 +78,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest01, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DEFAULT_DISPLAY_INFO);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -102,7 +102,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest02, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT);
|
||||
DisplayManagerMessage::TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, -1);
|
||||
@ -126,7 +126,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest03, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT);
|
||||
DisplayManagerMessage::TRANS_ID_UNREGISTER_DISPLAY_MANAGER_AGENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, -1);
|
||||
@ -150,7 +150,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest04, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN);
|
||||
DisplayManagerMessage::TRANS_ID_WAKE_UP_BEGIN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -174,7 +174,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest05, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_WAKE_UP_END);
|
||||
DisplayManagerMessage::TRANS_ID_WAKE_UP_END);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -198,7 +198,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest06, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN);
|
||||
DisplayManagerMessage::TRANS_ID_SUSPEND_BEGIN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -222,7 +222,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest07, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SUSPEND_END);
|
||||
DisplayManagerMessage::TRANS_ID_SUSPEND_END);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -246,7 +246,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest08, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_DISPLAY_STATE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -270,7 +270,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest09, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_POWER_FOR_ALL);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -294,7 +294,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest10, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_STATE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -318,7 +318,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest11, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT);
|
||||
DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_EVENT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -342,7 +342,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest12, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, -1);
|
||||
@ -366,7 +366,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest13, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_ID);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -390,7 +390,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest14, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_BY_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -414,7 +414,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest15, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS);
|
||||
DisplayManagerMessage::TRANS_ID_GET_ALL_DISPLAYIDS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -438,7 +438,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest16, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_INFO_BY_ID);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -462,7 +462,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest17, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS);
|
||||
DisplayManagerMessage::TRANS_ID_GET_ALL_SCREEN_INFOS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -486,7 +486,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest18, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_GAMUTS);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -510,7 +510,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest19, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_CREATE_VIRTUAL_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -534,7 +534,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest20, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -558,7 +558,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest21, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -582,7 +582,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest22, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_DESTROY_VIRTUAL_SCREEN);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -606,7 +606,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest23, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_MIRROR);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -630,7 +630,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest24, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_STOP_MIRROR);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_STOP_MIRROR);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -654,7 +654,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest25, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_MAKE_EXPAND);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -678,7 +678,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest26, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_STOP_EXPAND);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_STOP_EXPAND);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -702,7 +702,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest27, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -726,7 +726,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest28, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP);
|
||||
DisplayManagerMessage::TRANS_ID_REMOVE_VIRTUAL_SCREEN_FROM_SCREEN_GROUP);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -750,7 +750,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest29, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_SNAPSHOT);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -774,7 +774,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest30, Function | SmallTest |
|
||||
data.WriteRemoteObject(windowManagerAgent->AsObject());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_ACTIVE_MODE);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -794,7 +794,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest32, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_DISABLE_MIRROR);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_DISABLE_MIRROR);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -813,7 +813,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest33, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteRemoteObject(nullptr);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_CLIENT);
|
||||
DisplayManagerMessage::TRANS_ID_SET_CLIENT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -832,7 +832,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest34, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_PROPERTY);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_PROPERTY);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -851,7 +851,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest35, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_NODE);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_NODE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -873,7 +873,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest36, Function | SmallTest |
|
||||
RSMarshallingHelper::Marshalling(data, bounds);
|
||||
data.WriteFloat(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_UPDATE_SCREEN_ROTATION_PROPERTY);
|
||||
DisplayManagerMessage::TRANS_ID_UPDATE_SCREEN_ROTATION_PROPERTY);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -891,7 +891,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest37, Function | SmallTest |
|
||||
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_CURVED_SCREEN_COMPRESSION_AREA);
|
||||
DisplayManagerMessage::TRANS_ID_GET_CURVED_SCREEN_COMPRESSION_AREA);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -910,7 +910,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest38, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_PHY_SCREEN_PROPERTY);
|
||||
DisplayManagerMessage::TRANS_ID_GET_PHY_SCREEN_PROPERTY);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -929,7 +929,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest39, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_PRIVACY_STATE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_PRIVACY_STATE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -948,7 +948,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest40, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_SPACE);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_SPACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -967,7 +967,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest41, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -986,7 +986,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest42, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_HDR_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_HDR_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1005,7 +1005,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest43, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_HDR_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_HDR_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1024,7 +1024,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest44, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1043,7 +1043,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest45, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_PIXEL_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_PIXEL_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1062,7 +1062,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest46, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_PIXEL_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_PIXEL_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1081,7 +1081,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest47, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1100,7 +1100,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest48, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1119,7 +1119,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest49, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1138,7 +1138,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest050, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1157,7 +1157,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest051, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(0);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1176,7 +1176,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest052, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DENSITY_IN_CURRENT_RESOLUTION);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DENSITY_IN_CURRENT_RESOLUTION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1195,7 +1195,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest053, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_RESOLUTION);
|
||||
DisplayManagerMessage::TRANS_ID_SET_RESOLUTION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1214,7 +1214,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest054, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_SPACE);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_SPACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1233,7 +1233,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest055, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_CANVAS_ROTATION);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_CANVAS_ROTATION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1252,7 +1252,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest056, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, -1);
|
||||
}
|
||||
@ -1270,7 +1270,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest057, Function | SmallTest
|
||||
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DEVICE_SCREEN_CONFIG);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DEVICE_SCREEN_CONFIG);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1291,7 +1291,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest58, Function | SmallTest |
|
||||
data.WriteUint64(displayId);
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREENID_PRIVACY_STATE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREENID_PRIVACY_STATE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1313,7 +1313,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest59, Function | SmallTest |
|
||||
std::vector<std::string> privacyWindowList{"win0", "win1"};
|
||||
data.WriteStringVector(privacyWindowList);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_LIST);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_LIST);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1332,7 +1332,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest60, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteInt32(2000);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_OFF_DELAY_TIME);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_OFF_DELAY_TIME);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1354,7 +1354,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest61, Function | SmallTest |
|
||||
data.WriteUint64(static_cast<uint64_t>(id));
|
||||
data.WriteUInt64Vector(windowIdList);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1378,7 +1378,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest62, Function | SmallTest |
|
||||
data.WriteUint32(1062);
|
||||
data.WriteFloat(1.5);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_HOOK_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_HOOK_INFO);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1397,7 +1397,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest63, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_RESET_ALL_FREEZE_STATUS);
|
||||
DisplayManagerMessage::TRANS_ID_RESET_ALL_FREEZE_STATUS);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1422,7 +1422,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest64, Function | SmallTest |
|
||||
}
|
||||
data.WriteBool(true);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_PROXY_FOR_FREEZE);
|
||||
DisplayManagerMessage::TRANS_ID_PROXY_FOR_FREEZE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1442,7 +1442,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest65, Function | SmallTest |
|
||||
|
||||
data.WriteUint64(1065);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_DISABLE_POWEROFF_RENDER_CONTROL);
|
||||
DisplayManagerMessage::TRANS_ID_DISABLE_POWEROFF_RENDER_CONTROL);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1462,7 +1462,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest66, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SWITCH_USER);
|
||||
DisplayManagerMessage::TRANS_ID_SWITCH_USER);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1483,7 +1483,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest67, Function | SmallTest |
|
||||
data.WriteUint64(1067);
|
||||
data.WriteUint32(120);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_REFRESH_RATE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_REFRESH_RATE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1504,7 +1504,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest68, Function | SmallTest |
|
||||
data.WriteUint64(1068);
|
||||
data.WriteUint32(100);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_FLAG);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_FLAG);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1524,7 +1524,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest69, Function | SmallTest |
|
||||
|
||||
data.WriteUint64(1069);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_VIRTUAL_SCREEN_FLAG);
|
||||
DisplayManagerMessage::TRANS_ID_GET_VIRTUAL_SCREEN_FLAG);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1544,7 +1544,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest70, Function | SmallTest |
|
||||
|
||||
data.WriteBool(true);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_FOLD_TO_EXPAND_COMPLETION);
|
||||
DisplayManagerMessage::TRANS_ID_NOTIFY_FOLD_TO_EXPAND_COMPLETION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1564,7 +1564,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest71, Function | SmallTest |
|
||||
|
||||
data.WriteUint64(1071);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_AVAILABLE_AREA);
|
||||
DisplayManagerMessage::TRANS_ID_GET_AVAILABLE_AREA);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1588,7 +1588,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest72, Function | SmallTest |
|
||||
data.WriteUint32(150);
|
||||
data.WriteInt32(250);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_UPDATE_AVAILABLE_AREA);
|
||||
DisplayManagerMessage::TRANS_ID_UPDATE_AVAILABLE_AREA);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1610,7 +1610,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest73, Function | SmallTest |
|
||||
data.WriteUint32(1080);
|
||||
data.WriteUint32(1440);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_RESIZE_VIRTUAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_RESIZE_VIRTUAL_SCREEN);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1640,7 +1640,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest74, Function | SmallTest |
|
||||
info->bundleName_ = bundleName;
|
||||
info->Marshalling(data);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1662,7 +1662,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest75, Function | SmallTest |
|
||||
data.WriteUint32(uniqueScreenIds.size());
|
||||
data.WriteUInt64Vector(uniqueScreenIds);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1681,7 +1681,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest76, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_CURRENT_FOLD_CREASE_REGION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1700,7 +1700,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest77, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_STATUS);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1719,7 +1719,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest78, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_IS_FOLDABLE);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_IS_FOLDABLE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1738,7 +1738,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest79, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_GET_FOLD_DISPLAY_MODE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1757,7 +1757,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest80, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_LOCK_FOLD_DISPLAY_STATUS);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_LOCK_FOLD_DISPLAY_STATUS);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1776,7 +1776,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest81, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_SET_FOLD_DISPLAY_MODE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1795,7 +1795,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest82, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_DEVICE_IS_CAPTURE);
|
||||
DisplayManagerMessage::TRANS_ID_DEVICE_IS_CAPTURE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1814,7 +1814,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest83, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_DUMP_SPECIAL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_DUMP_SPECIAL_SCREEN);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1833,7 +1833,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest84, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_DUMP_ALL_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_DUMP_ALL_SCREEN);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1852,7 +1852,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest85, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_HAS_IMMERSIVE_WINDOW);
|
||||
DisplayManagerMessage::TRANS_ID_HAS_IMMERSIVE_WINDOW);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1872,7 +1872,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest86, Function | SmallTest |
|
||||
|
||||
data.WriteUint64(1086);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_CONVERT_SCREENID_TO_RSSCREENID);
|
||||
DisplayManagerMessage::TRANS_ID_CONVERT_SCREENID_TO_RSSCREENID);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1892,7 +1892,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest87, Function | SmallTest |
|
||||
|
||||
data.WriteUint64(1087);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_HAS_PRIVATE_WINDOW);
|
||||
DisplayManagerMessage::TRANS_ID_HAS_PRIVATE_WINDOW);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1912,7 +1912,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest88, Function | SmallTest |
|
||||
|
||||
data.WriteUint64(1088);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_CUTOUT_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_GET_CUTOUT_INFO);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1931,7 +1931,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest89, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_IS_SCREEN_ROTATION_LOCKED);
|
||||
DisplayManagerMessage::TRANS_ID_IS_SCREEN_ROTATION_LOCKED);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1951,7 +1951,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest90, Function | SmallTest |
|
||||
|
||||
data.WriteBool(true);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED_FROM_JS);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1971,7 +1971,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest91, Function | SmallTest |
|
||||
|
||||
data.WriteBool(true);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SCREEN_ROTATION_LOCKED);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -1992,7 +1992,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest92, Function | SmallTest |
|
||||
data.WriteUint64(1092);
|
||||
data.WriteUint32(270);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_ORIENTATION);
|
||||
DisplayManagerMessage::TRANS_ID_SET_ORIENTATION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2013,7 +2013,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest93, Function | SmallTest |
|
||||
data.WriteUint64(1093);
|
||||
data.WriteFloat(2.5);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO_SYSTEM);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_PIXEL_RATIO_SYSTEM);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2032,7 +2032,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest94, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SNAPSHOT_BY_PICKER);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SNAPSHOT_BY_PICKER);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2053,7 +2053,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest95, Function | SmallTest |
|
||||
data.WriteUint64(1095);
|
||||
data.WriteUint32(25);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SCALE_MODE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SCALE_MODE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2072,7 +2072,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest96, Function | SmallTest |
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_SURFACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2094,7 +2094,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest97, Function | SmallTest |
|
||||
data.WriteUint32(1);
|
||||
data.WriteUint32(12);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER);
|
||||
DisplayManagerMessage::TRANS_ID_SET_SPECIFIED_SCREEN_POWER);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2118,7 +2118,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest98, Function | SmallTest |
|
||||
}
|
||||
data.WriteBool(true);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_PROXY_FOR_FREEZE);
|
||||
DisplayManagerMessage::TRANS_ID_PROXY_FOR_FREEZE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2158,7 +2158,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest100, Function | SmallTest
|
||||
data.WriteUint64(static_cast<uint64_t>(id));
|
||||
data.WriteUInt64Vector(windowIdList);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_BLACK_LIST);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2179,7 +2179,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest101, Function | SmallTest
|
||||
sptr<DisplayChangeInfo> info = new DisplayChangeInfo();
|
||||
info->Marshalling(data);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO);
|
||||
DisplayManagerMessage::TRANS_ID_NOTIFY_DISPLAY_CHANGE_INFO);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2198,7 +2198,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest102, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1102);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_PHY_SCREEN_PROPERTY);
|
||||
DisplayManagerMessage::TRANS_ID_GET_PHY_SCREEN_PROPERTY);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2217,7 +2217,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest103, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1103);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DISPLAY_NODE);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DISPLAY_NODE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2236,7 +2236,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest104, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1104);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_PROPERTY);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_PROPERTY);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2262,7 +2262,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest105, Function | SmallTest
|
||||
data.WriteUint32(size);
|
||||
data.WriteUInt64Vector(uniqueScreenIds);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2285,7 +2285,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest106, Function | SmallTest
|
||||
data.WriteUint32(size);
|
||||
data.WriteUInt64Vector(uniqueScreenIds);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
DisplayManagerMessage::TRANS_ID_SCENE_BOARD_MAKE_UNIQUE_SCREEN);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2304,7 +2304,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest107, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1107);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_SPACE);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_SPACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2323,7 +2323,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest108, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1108);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_COLOR_SPACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2342,7 +2342,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest109, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1109);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_HDR_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_HDR_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2361,7 +2361,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest110, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1100);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_SUPPORTED_HDR_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2380,7 +2380,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest111, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1111);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_PIXEL_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_PIXEL_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2399,7 +2399,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest112, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1112);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_GAMUT_MAP);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2418,7 +2418,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest113, Function | SmallTest
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
data.WriteUint64(1113);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_GET_COLOR_GAMUT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2436,7 +2436,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest114, Function | SmallTest
|
||||
|
||||
data.WriteInterfaceToken(ScreenSessionManagerStub::GetDescriptor());
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_ALL_PHYSICAL_DISPLAY_RESOLUTION);
|
||||
DisplayManagerMessage::TRANS_ID_GET_ALL_PHYSICAL_DISPLAY_RESOLUTION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2457,7 +2457,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest115, Function | SmallTest
|
||||
data.WriteUint64(static_cast<uint64_t>(testScreenId));
|
||||
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
DisplayManagerMessage::TRANS_ID_GET_SCREEN_POWER);
|
||||
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
@ -2479,7 +2479,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest116, Function | SmallTest
|
||||
data.WriteUint64(static_cast<uint64_t>(testScreenId));
|
||||
data.WriteBool(false);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_CANVAS_ROTATION);
|
||||
DisplayManagerMessage::TRANS_ID_SET_VIRTUAL_SCREEN_CANVAS_ROTATION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2505,7 +2505,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest117, Function | SmallTest
|
||||
float virtualPixelRatio = 64;
|
||||
data.WriteFloat(virtualPixelRatio);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SET_RESOLUTION);
|
||||
DisplayManagerMessage::TRANS_ID_SET_RESOLUTION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2525,7 +2525,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest118, Function | SmallTest
|
||||
ScreenId testScreenId = 1118;
|
||||
data.WriteUint64(static_cast<uint64_t>(testScreenId));
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_GET_DENSITY_IN_CURRENT_RESOLUTION);
|
||||
DisplayManagerMessage::TRANS_ID_GET_DENSITY_IN_CURRENT_RESOLUTION);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2547,7 +2547,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest119, Function | SmallTest
|
||||
int32_t colorGamutIdx = 64;
|
||||
data.WriteInt32(colorGamutIdx);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_GAMUT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2569,7 +2569,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest120, Function | SmallTest
|
||||
uint32_t colorGamutIdx = 64;
|
||||
data.WriteUint32(colorGamutIdx);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_GAMUT_MAP);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2589,7 +2589,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest121, Function | SmallTest
|
||||
ScreenId testScreenId = 1121;
|
||||
data.WriteUint64(static_cast<uint64_t>(testScreenId));
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_TRANSFORM);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2611,7 +2611,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest122, Function | SmallTest
|
||||
int32_t pixelFormat = 64;
|
||||
data.WriteInt32(pixelFormat);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_PIXEL_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_PIXEL_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2633,7 +2633,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest123, Function | SmallTest
|
||||
int32_t modeIdx = 120;
|
||||
data.WriteInt32(modeIdx);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_HDR_FORMAT);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_HDR_FORMAT);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2655,7 +2655,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest124, Function | SmallTest
|
||||
int32_t colorSpace = 32;
|
||||
data.WriteInt32(colorSpace);
|
||||
uint32_t code = static_cast<uint32_t>(
|
||||
IDisplayManager::DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_SPACE);
|
||||
DisplayManagerMessage::TRANS_ID_SCREEN_SET_COLOR_SPACE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
@ -2680,7 +2680,7 @@ HWTEST_F(ScreenSessionManagerStubTest, OnRemoteRequest125, Function | SmallTest
|
||||
data.WriteUint64(static_cast<uint64_t>(screenId)) && data.WriteFloat(scaleX) &&
|
||||
data.WriteFloat(scaleY) && data.WriteFloat(pivotX) && data.WriteFloat(pivotY));
|
||||
uint32_t code =
|
||||
static_cast<uint32_t>(IDisplayManager::DisplayManagerMessage::TRANS_ID_SCENE_BOARD_SET_DISPLAY_SCALE);
|
||||
static_cast<uint32_t>(DisplayManagerMessage::TRANS_ID_SCENE_BOARD_SET_DISPLAY_SCALE);
|
||||
int res = stub_->OnRemoteRequest(code, data, reply, option);
|
||||
EXPECT_EQ(res, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user