/* * Copyright (c) 2023 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_WINDOW_SCENE_SCREEN_SESSION_MANAGER_H #define OHOS_ROSEN_WINDOW_SCENE_SCREEN_SESSION_MANAGER_H #include #include #include #include #include "common/include/task_scheduler.h" #include "dm_common.h" #include "event_tracker.h" #include "session/screen/include/screen_session.h" #include "zidl/screen_session_manager_stub.h" #include "client_agent_container.h" #include "session_display_power_controller.h" #include "wm_single_instance.h" #include "agent_death_recipient.h" #include "screen.h" #include "screen_cutout_controller.h" #include "fold_screen_controller/fold_screen_controller.h" #include "fold_screen_controller/fold_screen_sensor_manager.h" namespace OHOS::Rosen { class RSInterfaces; class ScreenSessionManager : public SystemAbility, public ScreenSessionManagerStub, public IScreenChangeListener { DECLARE_SYSTEM_ABILITY(ScreenSessionManager) WM_DECLARE_SINGLE_INSTANCE_BASE(ScreenSessionManager) public: sptr GetScreenSession(ScreenId screenId) const; sptr GetDefaultScreenSession(); std::vector GetAllScreenIds(); sptr GetDefaultDisplayInfo() override; DMError SetScreenActiveMode(ScreenId screenId, uint32_t modeId) override; DMError SetVirtualPixelRatio(ScreenId screenId, float virtualPixelRatio) override; DMError SetVirtualPixelRatioSystem(ScreenId screenId, float virtualPixelRatio) override; DMError SetResolution(ScreenId screenId, uint32_t width, uint32_t height, float virtualPixelRatio) override; DMError GetDensityInCurResolution(ScreenId screenId, float& virtualPixelRatio) override; void NotifyScreenChanged(sptr screenInfo, ScreenChangeEvent event); void NotifyScreenModeChange(); DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) override; DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) override; DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) override; DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) override; DMError SetScreenColorTransform(ScreenId screenId) override; DMError GetPixelFormat(ScreenId screenId, GraphicPixelFormat& pixelFormat) override; DMError SetPixelFormat(ScreenId screenId, GraphicPixelFormat pixelFormat) override; DMError GetSupportedHDRFormats(ScreenId screenId, std::vector& hdrFormats) override; DMError GetScreenHDRFormat(ScreenId screenId, ScreenHDRFormat& hdrFormat) override; DMError SetScreenHDRFormat(ScreenId screenId, int32_t modeIdx) override; DMError GetSupportedColorSpaces(ScreenId screenId, std::vector& colorSpaces) override; DMError GetScreenColorSpace(ScreenId screenId, GraphicCM_ColorSpaceType& colorSpace) override; DMError SetScreenColorSpace(ScreenId screenId, GraphicCM_ColorSpaceType colorSpace) override; void DumpAllScreensInfo(std::string& dumpInfo) override; void DumpSpecialScreenInfo(ScreenId id, std::string& dumpInfo) override; virtual DMError RegisterDisplayManagerAgent(const sptr& displayManagerAgent, DisplayManagerAgentType type) override; virtual DMError UnregisterDisplayManagerAgent(const sptr& displayManagerAgent, DisplayManagerAgentType type) override; bool WakeUpBegin(PowerStateChangeReason reason) override; bool WakeUpEnd() override; bool SuspendBegin(PowerStateChangeReason reason) override; bool SuspendEnd() 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; void NotifyDisplayEvent(DisplayEvent event) override; void HandlerSensor(ScreenPowerStatus status, PowerStateChangeReason reason); bool TryToCancelScreenOff() override; void ForceSkipScreenOffAnimation(); void RegisterDisplayChangeListener(sptr listener); bool NotifyDisplayPowerEvent(DisplayPowerEvent event, EventStatus status, PowerStateChangeReason reason); bool NotifyDisplayStateChanged(DisplayId id, DisplayState state); void NotifyScreenshot(DisplayId displayId); virtual ScreenId CreateVirtualScreen(VirtualScreenOption option, const sptr& displayManagerAgent) override; virtual DMError SetVirtualScreenSurface(ScreenId screenId, sptr surface) override; virtual DMError SetVirtualMirrorScreenCanvasRotation(ScreenId screenId, bool autoRotate) override; virtual DMError SetVirtualMirrorScreenScaleMode(ScreenId screenId, ScreenScaleMode scaleMode) override; virtual DMError DestroyVirtualScreen(ScreenId screenId) override; DMError ResizeVirtualScreen(ScreenId screenId, uint32_t width, uint32_t height) override; virtual DMError MakeMirror(ScreenId mainScreenId, std::vector mirrorScreenIds, ScreenId& screenGroupId) override; virtual DMError StopMirror(const std::vector& mirrorScreenIds) override; DMError DisableMirror(bool disableOrNot) override; virtual DMError MakeExpand(std::vector screenId, std::vector startPoint, ScreenId& screenGroupId) override; virtual DMError StopExpand(const std::vector& expandScreenIds) override; DMError MakeUniqueScreen(const std::vector& screenIds) override; virtual sptr GetScreenGroupInfoById(ScreenId screenId) override; virtual void RemoveVirtualScreenFromGroup(std::vector screens) override; virtual std::shared_ptr GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode, bool isUseDma) override; virtual std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode) override; virtual sptr GetDisplayInfoById(DisplayId displayId) override; sptr GetDisplayInfoByScreen(ScreenId screenId) override; std::vector GetAllDisplayIds() override; virtual sptr GetScreenInfoById(ScreenId screenId) override; virtual DMError GetAllScreenInfos(std::vector>& screenInfos) override; virtual DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts) override; DMError IsScreenRotationLocked(bool& isLocked) override; DMError SetScreenRotationLocked(bool isLocked) override; DMError SetScreenRotationLockedFromJs(bool isLocked) override; DMError SetOrientation(ScreenId screenId, Orientation orientation) override; bool SetRotation(ScreenId screenId, Rotation rotationAfter, bool isFromWindow); void SetSensorSubscriptionEnabled(); bool SetRotationFromWindow(Rotation targetRotation); sptr GetScreenModesByDisplayId(DisplayId displayId); sptr GetScreenInfoByDisplayId(DisplayId displayId); void NotifyDisplayCreate(sptr displayInfo); void NotifyDisplayDestroy(DisplayId displayId); void NotifyAndPublishEvent(sptr displayInfo, ScreenId screenId, sptr screenSession); void NotifyDisplayChanged(sptr displayInfo, DisplayChangeEvent event); std::vector GetAllScreenIds() const; const std::shared_ptr GetRSDisplayNodeByScreenId(ScreenId smsScreenId) const; std::shared_ptr GetScreenSnapshot(DisplayId displayId, bool isUseDma = false); sptr InitVirtualScreen(ScreenId smsScreenId, ScreenId rsId, VirtualScreenOption option); sptr InitAndGetScreen(ScreenId rsScreenId); bool InitAbstractScreenModesInfo(sptr& absScreen); std::vector GetAllValidScreenIds(const std::vector& screenIds) const; sptr AddToGroupLocked(sptr newScreen, bool isUnique = false); sptr AddAsFirstScreenLocked(sptr newScreen, bool isUnique = false); sptr AddAsSuccedentScreenLocked(sptr newScreen); sptr RemoveFromGroupLocked(sptr screen); sptr GetAbstractScreenGroup(ScreenId smsScreenId); bool HandleFoldScreenSessionCreate(ScreenId screenId); void ChangeScreenGroup(sptr group, const std::vector& screens, const std::vector& startPoints, bool filterScreen, ScreenCombination combination); bool RemoveChildFromGroup(sptr screen, sptr screenGroup); void AddScreenToGroup(sptr group, const std::vector& addScreens, const std::vector& addChildPos, std::map& removeChildResMap); bool CheckScreenInScreenGroup(sptr screen) const; DMError SetMirror(ScreenId screenId, std::vector screens); DMError StopScreens(const std::vector& screenIds, ScreenCombination stopCombination); void NotifyScreenConnected(sptr screenInfo); void NotifyScreenDisconnected(ScreenId screenId); void NotifyScreenGroupChanged(const sptr& screenInfo, ScreenGroupChangeEvent event); void NotifyScreenGroupChanged(const std::vector>& screenInfo, ScreenGroupChangeEvent event); void NotifyPrivateSessionStateChanged(bool hasPrivate); void NotifyPrivateWindowListChanged(DisplayId id, std::vector privacyWindowList); DMError HasPrivateWindow(DisplayId id, bool& hasPrivateWindow) override; bool ConvertScreenIdToRsScreenId(ScreenId screenId, ScreenId& rsScreenId) override; void UpdateDisplayHookInfo(int32_t uid, bool enable, const DMHookInfo& hookInfo) override; void OnScreenConnect(const sptr screenInfo); void OnScreenDisconnect(ScreenId screenId); void OnScreenGroupChange(const std::string& trigger, const sptr& screenInfo, ScreenGroupChangeEvent groupEvent); void OnScreenGroupChange(const std::string& trigger, const std::vector>& screenInfos, ScreenGroupChangeEvent groupEvent); void OnScreenshot(sptr info); bool IsMultiScreenCollaboration(); sptr GetCutoutInfo(DisplayId displayId) override; DMError HasImmersiveWindow(bool& immersive) override; void SetDisplayBoundary(const sptr screenSession); void BlockScreenOnByCV(void); void BlockScreenOffByCV(void); bool BlockSetDisplayState(void); bool IsScreenLockSuspend(void); bool IsPreBrightAuthFail(void); void ScreenOffCVNotify(void); void DisablePowerOffRenderControl(ScreenId screenId) override; // Fold Screen void SetFoldDisplayMode(const FoldDisplayMode displayMode) override; DMError SetFoldDisplayModeFromJs(const FoldDisplayMode displayMode) override; void SetDisplayNodeScreenId(ScreenId screenId, ScreenId displayNodeScreenId); void SetDisplayScale(ScreenId screenId, float scaleX, float scaleY, float pivotX, float pivotY) override; void SetFoldStatusLocked(bool locked) override; DMError SetFoldStatusLockedFromJs(bool locked) override; FoldDisplayMode GetFoldDisplayMode() override; bool IsFoldable() override; bool IsCaptured() override; FoldStatus GetFoldStatus() override; bool GetTentMode(); bool SetScreenPower(ScreenPowerStatus status, PowerStateChangeReason reason); void SetScreenPowerForFold(ScreenPowerStatus status); void SetScreenPowerForFold(ScreenId screenId, ScreenPowerStatus status); void TriggerDisplayModeUpdate(FoldDisplayMode targetDisplayMode); void CallRsSetScreenPowerStatusSync(ScreenId screenId, ScreenPowerStatus status); void CallRsSetScreenPowerStatusSyncForFold(ScreenPowerStatus status); void TryToRecoverFoldDisplayMode(ScreenPowerStatus status); void SetKeyguardDrawnDoneFlag(bool flag); sptr GetCurrentFoldCreaseRegion() override; void NotifyFoldStatusChanged(FoldStatus foldStatus); void NotifyFoldAngleChanged(std::vector foldAngles); int NotifyFoldStatusChanged(const std::string& statusParam); void NotifyDisplayModeChanged(FoldDisplayMode displayMode); void NotifyDisplayChangeInfoChanged(const sptr& info) override; void OnTentModeChanged(bool isTentMode); void RegisterSettingDpiObserver(); void RegisterSettingRotationObserver(); void OnConnect(ScreenId screenId) override {} void OnDisconnect(ScreenId screenId) override {} void OnPropertyChange(const ScreenProperty& newProperty, ScreenPropertyChangeReason reason, ScreenId screenId) override; void OnPowerStatusChange(DisplayPowerEvent event, EventStatus status, PowerStateChangeReason reason) override; void OnSensorRotationChange(float sensorRotation, ScreenId screenId) override; void OnHoverStatusChange(int32_t hoverStatus, ScreenId screenId) override; void OnScreenOrientationChange(float screenOrientation, ScreenId screenId) override; void OnScreenRotationLockedChange(bool isLocked, ScreenId screenId) override; void SetHdrFormats(ScreenId screenId, sptr& session); void SetColorSpaces(ScreenId screenId, sptr& session); void SetClient(const sptr& client) override; ScreenProperty GetScreenProperty(ScreenId screenId) override; std::shared_ptr GetDisplayNode(ScreenId screenId) override; void UpdateScreenRotationProperty(ScreenId screenId, const RRect& bounds, float rotation, ScreenPropertyChangeType screenPropertyChangeType) override; void UpdateScreenDirectionInfo(ScreenId screenId, float screenComponentRotation, float rotation, float phyRotation, ScreenPropertyChangeType screenPropertyChangeType) override; uint32_t GetCurvedCompressionArea() override; ScreenProperty GetPhyScreenProperty(ScreenId screenId) override; void SetScreenPrivacyState(bool hasPrivate) override; void SetPrivacyStateByDisplayId(DisplayId id, bool hasPrivate) override; void SetScreenPrivacyWindowList(DisplayId id, std::vector privacyWindowList) override; void UpdateAvailableArea(ScreenId screenId, DMRect area) override; int32_t SetScreenOffDelayTime(int32_t delay) override; DMError GetAvailableArea(DisplayId displayId, DMRect& area) override; void NotifyAvailableAreaChanged(DMRect area); void NotifyFoldToExpandCompletion(bool foldToExpand) override; void SetCameraStatus(int32_t cameraStatus, int32_t cameraPosition) override; bool GetSnapshotArea(Media::Rect &rect, DmErrorCode* errorCode, ScreenId &screenId); int32_t GetCameraStatus(); int32_t GetCameraPosition(); VirtualScreenFlag GetVirtualScreenFlag(ScreenId screenId) override; DMError SetVirtualScreenFlag(ScreenId screenId, VirtualScreenFlag screenFlag) override; DMError SetVirtualScreenRefreshRate(ScreenId screenId, uint32_t refreshInterval) override; DeviceScreenConfig GetDeviceScreenConfig() override; // notify scb virtual screen change void OnVirtualScreenChange(ScreenId screenId, ScreenEvent screenEvent); DMError VirtualScreenUniqueSwitch(const std::vector& screenIds); void FixPowerStatus(); void FoldScreenPowerInit(); DMError ProxyForFreeze(const std::set& pidList, bool isProxy) override; DMError ResetAllFreezeStatus() override; void SetVirtualScreenBlackList(ScreenId screenId, std::vector& windowIdList) override; void ReportFoldStatusToScb(std::vector& screenFoldInfo); std::vector GetAllDisplayPhysicalResolution() override; void NotifyCastWhenScreenConnectChange(bool isConnected); void OnScreenChange(ScreenId screenId, ScreenEvent screenEvent); void SetCoordinationFlag(bool isCoordinationFlag); /* * multi user */ void SwitchUser() override; void SwitchScbNodeHandle(int32_t userId, int32_t newScbPid, bool coldBoot); void AddScbClientDeathRecipient(const sptr& scbClient, int32_t scbPid); void ScbClientDeathCallback(int32_t deathScbPid); void ScbStatusRecoveryWhenSwitchUser(std::vector oldScbPids, int32_t newScbPid); DMError SetVirtualScreenMaxRefreshRate(ScreenId id, uint32_t refreshRate, uint32_t& actualRefreshRate) override; std::shared_ptr GetScreenCapture(const CaptureOption& captureOption, DmErrorCode* errorCode = nullptr) override; void OnScreenCaptureNotify(ScreenId mainScreenId, int32_t uid, const std::string& clientName) override; sptr GetPrimaryDisplayInfo() override; std::shared_ptr GetDisplaySnapshotWithOption(const CaptureOption& captureOption, DmErrorCode* errorCode) override; protected: ScreenSessionManager(); virtual ~ScreenSessionManager() = default; private: void OnStart() override; void OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override; void Init(); void LoadScreenSceneXml(); void ConfigureScreenScene(); void ConfigureDpi(); void ConfigureCastParams(); void ConfigureWaterfallDisplayCompressionParams(); void ConfigureScreenSnapshotParams(); void RegisterScreenChangeListener(); void RegisterRefreshRateChangeListener(); void OnHgmRefreshRateChange(uint32_t refreshRate); sptr GetOrCreateScreenSession(ScreenId screenId); void CreateScreenProperty(ScreenId screenId, ScreenProperty& property); sptr GetScreenSessionInner(ScreenId screenId, ScreenProperty property); sptr CreatePhysicalMirrorSessionInner(ScreenId screenId, ScreenId defaultScreenId, ScreenProperty property); void FreeDisplayMirrorNodeInner(const sptr mirrorSession); void MirrorSwitchNotify(ScreenId screenId); ScreenId GetDefaultScreenId(); void AddVirtualScreenDeathRecipient(const sptr& displayManagerAgent, ScreenId smsScreenId); void SendCastEvent(const bool &isPlugIn); void PhyMirrorConnectWakeupScreen(); void HandleScreenEvent(sptr screenSession, ScreenId screenId, ScreenEvent screenEvent); void HandleScreenDisconnectEvent(sptr screenSession, ScreenId screenId, ScreenEvent screenEvent); ScreenRotation ConvertOffsetToCorrectRotation(int32_t phyOffset); void SetClientInner(); void GetCurrentScreenPhyBounds(float& phyWidth, float& phyHeight, bool& isReset, const ScreenId& screenid); void NotifyDisplayStateChange(DisplayId defaultDisplayId, sptr displayInfo, const std::map>& displayInfoMap, DisplayStateChangeType type); void NotifyCaptureStatusChanged(); bool OnMakeExpand(std::vector screenId, std::vector startPoint); bool OnRemoteDied(const sptr& agent); std::string TransferTypeToString(ScreenType type) const; std::string TransferPropertyChangeTypeToString(ScreenPropertyChangeType type) const; void CheckAndSendHiSysEvent(const std::string& eventName, const std::string& bundleName) const; bool GetPowerStatus(ScreenPowerState state, PowerStateChangeReason reason, ScreenPowerStatus& status); int Dump(int fd, const std::vector& args) override; sptr HookDisplayInfoByUid(sptr displayInfo, const sptr& screenSession); DMError SetVirtualScreenSecurityExemption(ScreenId screenId, uint32_t pid, std::vector& windowIdList) override; void AddPermissionUsedRecord(const std::string& permission, int32_t successCount, int32_t failCount); #ifdef DEVICE_STATUS_ENABLE void SetDragWindowScreenId(ScreenId screenId, ScreenId displayNodeScreenId); #endif // DEVICE_STATUS_ENABLE bool IsFreezed(const int32_t& agentPid, const DisplayManagerAgentType& agentType); void NotifyUnfreezed(const std::set& unfreezedPidList, const sptr& screenSession); void NotifyUnfreezedAgents(const int32_t& pid, const std::set& unfreezedPidList, const std::set& pidAgentTypes, const sptr& screenSession); int NotifyPowerEventForDualDisplay(DisplayPowerEvent event, EventStatus status, PowerStateChangeReason reason); void SetScreenCorrection(); class ScreenIdManager { friend class ScreenSessionGroup; public: ScreenIdManager() = default; ~ScreenIdManager() = default; WM_DISALLOW_COPY_AND_MOVE(ScreenIdManager); ScreenId CreateAndGetNewScreenId(ScreenId rsScreenId); void UpdateScreenId(ScreenId rsScreenId, ScreenId smsScreenId); bool DeleteScreenId(ScreenId smsScreenId); bool HasRsScreenId(ScreenId smsScreenId) const; bool ConvertToRsScreenId(ScreenId, ScreenId&) const; ScreenId ConvertToRsScreenId(ScreenId) const; bool ConvertToSmsScreenId(ScreenId, ScreenId&) const; ScreenId ConvertToSmsScreenId(ScreenId) const; private: std::atomic smsScreenCount_ { 1000 }; std::map rs2SmsScreenIdMap_; std::map sms2RsScreenIdMap_; mutable std::shared_mutex screenIdMapMutex_; }; EventTracker screenEventTracker_; RSInterfaces& rsInterface_; std::shared_ptr taskScheduler_; std::shared_ptr screenPowerTaskScheduler_; /* * multi user */ std::mutex oldScbPidsMutex_; std::condition_variable scbSwitchCV_; int32_t currentUserId_ { 0 }; int32_t currentScbPId_ { -1 }; std::vector oldScbPids_ {}; std::map> clientProxyMap_; FoldDisplayMode oldScbDisplayMode_ = FoldDisplayMode::UNKNOWN; sptr clientProxy_; ClientAgentContainer dmAgentContainer_; DeviceScreenConfig deviceScreenConfig_; std::vector allDisplayPhysicalResolution_ {}; std::map> pidAgentTypeMap_; std::vector lastFoldAngles_ {}; sptr lastDisplayChangeInfo_; ScreenChangeEvent lastScreenChangeEvent_ = ScreenChangeEvent::UNKNOWN; std::mutex lastStatusUpdateMutex_; mutable std::recursive_mutex screenSessionMapMutex_; std::map> screenSessionMap_; std::recursive_mutex mutex_; std::recursive_mutex displayInfoMutex_; std::shared_mutex hookInfoMutex_; ScreenId defaultScreenId_ = SCREEN_ID_INVALID; ScreenIdManager screenIdManager_; std::atomic defaultRsScreenId_ { SCREEN_ID_INVALID }; std::map, std::vector> screenAgentMap_; std::map> smsScreenGroupMap_; std::map displayHookMap_; bool isAutoRotationOpen_ = false; bool isExpandCombination_ = false; bool isScreenShot_ = false; bool isFoldScreenOuterScreenReady_ = false; bool isCoordinationFlag_ = false; uint32_t hdmiScreenCount_ = 0; uint32_t virtualScreenCount_ = 0; sptr deathRecipient_ { nullptr }; sptr sessionDisplayPowerController_; sptr screenCutoutController_; sptr foldScreenController_; bool isDensityDpiLoad_ = false; float densityDpi_ { 1.0f }; float subDensityDpi_ { 1.0f }; std::atomic cachedSettingDpi_ {0}; uint32_t defaultDpi {0}; uint32_t defaultDeviceRotationOffset_ { 0 }; bool isMultiScreenCollaboration_ = false; bool screenPrivacyStates = false; bool keyguardDrawnDone_ = true; bool needScreenOnWhenKeyguardNotify_ = false; bool gotScreenOffNotify_ = false; bool needScreenOffNotify_ = false; std::mutex scbBufferAvailableMutex_; std::condition_variable scbBufferAvailableCV_; void BlockScbByAvailabelBuffer(void); std::mutex screenOnMutex_; std::condition_variable screenOnCV_; std::mutex screenOffMutex_; std::condition_variable screenOffCV_; int32_t screenOffDelay_ {0}; std::vector mirrorScreenIds_; std::mutex snapBypickerMutex_; std::mutex freezedPidListMutex_; std::set freezedPidList_; std::atomic prePowerStateChangeReason_ = PowerStateChangeReason::STATE_CHANGE_REASON_UNKNOWN; std::atomic lastWakeUpReason_ = PowerStateChangeReason::STATE_CHANGE_REASON_INIT; std::atomic currentWakeUpReason_ = PowerStateChangeReason::STATE_CHANGE_REASON_INIT; std::atomic isScreenLockSuspend_ = false; std::atomic gotScreenlockFingerprint_ = false; std::atomic isPhyScreenConnected_ = false; int32_t cameraStatus_ = {0}; int32_t cameraPosition_ = {0}; // Fold Screen std::map phyScreenPropMap_; mutable std::recursive_mutex phyScreenPropMapMutex_; static void BootFinishedCallback(const char *key, const char *value, void *context); std::function foldScreenPowerInit_ = nullptr; void HandleFoldScreenPowerInit(); void SetFoldScreenPowerInit(std::function foldScreenPowerInit); void SetDpiFromSettingData(); void SetRotateLockedFromSettingData(); void NotifyClientProxyUpdateFoldDisplayMode(FoldDisplayMode displayMode); void UpdateDisplayScaleState(ScreenId screenId); void SetDisplayScaleInner(ScreenId screenId, const float& scaleX, const float& scaleY, const float& pivotX, const float& pivotY); void CalcDisplayNodeTranslateOnFoldableRotation(sptr& session, const float& scaleX, const float& scaleY, const float& pivotX, const float& pivotY, float& translateX, float& translateY); void CalcDisplayNodeTranslateOnRotation(sptr& session, const float& scaleX, const float& scaleY, const float& pivotX, const float& pivotY, float& translateX, float& translateY); void RegisterApplicationStateObserver(); void SetPostureAndHallSensorEnabled(); bool IsDefaultMirrorMode(ScreenId screenId); void SetCastFromSettingData(); void RegisterCastObserver(std::vector& mirrorScreenIds); void UnRegisterCastObserver(std::vector& mirrorScreenIds); void ExitCoordination(const std::string& reason); void UpdateDisplayState(std::vector screenIds, DisplayState state); DisplayState lastDisplayState_ { DisplayState::UNKNOWN }; private: class ScbClientListenerDeathRecipient : public IRemoteObject::DeathRecipient { public: explicit ScbClientListenerDeathRecipient(int32_t scbPid) : scbPid_(scbPid) {} void OnRemoteDied(const wptr& wptrDeath) override { ScreenSessionManager::GetInstance().ScbClientDeathCallback(scbPid_); } private: int32_t scbPid_; }; }; } // namespace OHOS::Rosen #endif // OHOS_ROSEN_WINDOW_SCENE_SCREEN_SESSION_MANAGER_H