1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_ROSEN_WINDOW_SCENE_SESSION_MANAGER_INTERFACE_H 17 #define OHOS_ROSEN_WINDOW_SCENE_SESSION_MANAGER_INTERFACE_H 18 19 #include "common/include/window_session_property.h" 20 #include <iremote_broker.h> 21 #include "interfaces/include/ws_common.h" 22 #include "interfaces/include/ws_common_inner.h" 23 #include "session/container/include/zidl/session_stage_interface.h" 24 #include "session/container/include/zidl/window_event_channel_interface.h" 25 #include "session/host/include/session.h" 26 #include "focus_change_info.h" 27 #include "window_manager.h" 28 #include "zidl/window_manager_interface.h" 29 #include "session_info.h" 30 #include "mission_listener_interface.h" 31 #include "mission_info.h" 32 #include "mission_snapshot.h" 33 #include "iability_manager_collaborator.h" 34 35 namespace OHOS::Media { 36 class PixelMap; 37 } // namespace OHOS::Media 38 39 namespace OHOS::Rosen { 40 class RSSurfaceNode; 41 using ISessionListener = AAFwk::IMissionListener; 42 using SessionInfoBean = AAFwk::MissionInfo; 43 using SessionSnapshot = AAFwk::MissionSnapshot; 44 class ISceneSessionManager : public IWindowManager { 45 public: 46 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.ISceneSessionManager"); 47 48 enum class SceneSessionManagerMessage : uint32_t { 49 TRANS_ID_CREATE_AND_CONNECT_SPECIFIC_SESSION, 50 TRANS_ID_DESTROY_AND_DISCONNECT_SPECIFIC_SESSION, 51 TRANS_ID_UPDATE_PROPERTY, 52 TRANS_ID_REQUEST_FOCUS, 53 TRANS_ID_REGISTER_WINDOW_MANAGER_AGENT, 54 TRANS_ID_UNREGISTER_WINDOW_MANAGER_AGENT, 55 TRANS_ID_BIND_DIALOG_TARGET, 56 TRANS_ID_GET_FOCUS_SESSION_INFO, 57 TRANS_ID_SET_SESSION_LABEL, 58 TRANS_ID_SET_SESSION_ICON, 59 TRANS_ID_IS_VALID_SESSION_IDS, 60 TRANS_ID_SET_GESTURE_NAVIGATION_ENABLED, 61 TRANS_ID_GET_WINDOW_INFO, 62 TRANS_ID_PENDING_SESSION_TO_FOREGROUND, 63 TRANS_ID_PENDING_SESSION_TO_BACKGROUND_FOR_DELEGATOR, 64 TRANS_ID_GET_FOCUS_SESSION_TOKEN, 65 TRANS_ID_GET_FOCUS_SESSION_ELEMENT, 66 TRANS_ID_CHECK_WINDOW_ID, 67 TRANS_ID_REGISTER_SESSION_LISTENER, 68 TRANS_ID_UNREGISTER_SESSION_LISTENER, 69 TRANS_ID_GET_MISSION_INFOS, 70 TRANS_ID_GET_MISSION_INFO_BY_ID, 71 TRANS_ID_GET_SESSION_INFO_BY_CONTINUE_SESSION_ID, 72 TRANS_ID_DUMP_SESSION_ALL, 73 TRANS_ID_DUMP_SESSION_WITH_ID, 74 TRANS_ID_TERMINATE_SESSION_NEW, 75 TRANS_ID_GET_SESSION_DUMP_INFO, 76 TRANS_ID_UPDATE_AVOIDAREA_LISTENER, 77 TRANS_ID_GET_SESSION_SNAPSHOT, 78 TRANS_ID_GET_SESSION_SNAPSHOT_BY_ID, 79 TRANS_ID_SET_SESSION_CONTINUE_STATE, 80 TRANS_ID_NOTIFY_DUMP_INFO_RESULT, 81 TRANS_ID_CLEAR_SESSION, 82 TRANS_ID_CLEAR_ALL_SESSIONS, 83 TRANS_ID_LOCK_SESSION, 84 TRANS_ID_UNLOCK_SESSION, 85 TRANS_ID_MOVE_MISSIONS_TO_FOREGROUND, 86 TRANS_ID_MOVE_MISSIONS_TO_BACKGROUND, 87 TRANS_ID_REGISTER_COLLABORATOR, 88 TRANS_ID_UNREGISTER_COLLABORATOR, 89 TRANS_ID_UPDATE_TOUCHOUTSIDE_LISTENER, 90 TRANS_ID_RAISE_WINDOW_TO_TOP, 91 TRANS_ID_NOTIFY_WINDOW_EXTENSION_VISIBILITY_CHANGE, 92 TRANS_ID_RECOVER_AND_RECONNECT_SCENE_SESSION, 93 TRANS_ID_RECOVER_AND_CONNECT_SPECIFIC_SESSION, 94 TRANS_ID_GET_TOP_WINDOW_ID, 95 TRANS_ID_GET_PARENT_MAIN_WINDOW_ID, 96 TRANS_ID_GET_UI_CONTENT_REMOTE_OBJ, 97 TRANS_ID_UPDATE_WINDOW_VISIBILITY_LISTENER, 98 TRANS_ID_SHIFT_APP_WINDOW_FOCUS, 99 TRANS_ID_LIST_WINDOW_INFO, 100 TRANS_ID_GET_WINDOW_LAYOUT_INFO, 101 TRANS_ID_GET_GLOBAL_WINDOW_MODE, 102 TRANS_ID_GET_TOP_NAV_DEST_NAME, 103 TRANS_ID_GET_VISIBILITY_WINDOW_INFO_ID, 104 TRANS_ID_ADD_EXTENSION_WINDOW_STAGE_TO_SCB, 105 TRANS_ID_REMOVE_EXTENSION_WINDOW_STAGE_FROM_SCB, 106 TRANS_ID_UPDATE_MODALEXTENSION_RECT_TO_SCB, 107 TRANS_ID_PROCESS_MODALEXTENSION_POINTDOWN_TO_SCB, 108 TRANS_ID_ADD_OR_REMOVE_SECURE_SESSION, 109 TRANS_ID_UPDATE_EXTENSION_WINDOW_FLAGS, 110 TRANS_ID_GET_HOST_WINDOW_RECT, 111 TRANS_ID_DESTROY_AND_DISCONNECT_SPECIFIC_SESSION_WITH_DETACH_CALLBACK, 112 TRANS_ID_GET_WINDOW_STATUS, 113 TRANS_ID_GET_WINDOW_RECT, 114 TRANS_ID_GET_WINDOW_MODE_TYPE, 115 TRANS_ID_GET_UNRELIABLE_WINDOW_INFO, 116 TRANS_ID_GET_FREE_MULTI_WINDOW_ENABLE_STATE, 117 TRANS_ID_GET_WINDOW_STYLE_TYPE, 118 TRANS_ID_GET_PROCESS_SURFACENODEID_BY_PERSISTENTID, 119 TRANS_ID_SET_PROCESS_SNAPSHOT_SKIP, 120 TRANS_ID_SET_SNAPSHOT_SKIP_BY_USERID_AND_BUNDLENAMES, 121 TRANS_ID_SET_PROCESS_WATERMARK, 122 TRANS_ID_GET_WINDOW_IDS_BY_COORDINATE, 123 TRANS_ID_UPDATE_SESSION_SCREEN_LOCK, 124 TRANS_ID_ADD_SKIP_SELF_ON_VIRTUAL_SCREEN, 125 TRANS_ID_REMOVE_SKIP_SELF_ON_VIRTUAL_SCREEN, 126 TRANS_ID_SET_SCREEN_PRIVACY_WINDOW_TAG_SWITCH, 127 TRANS_ID_IS_PC_WINDOW, 128 TRANS_ID_IS_FREE_MULTI_WINDOW, 129 TRANS_ID_IS_PC_OR_PAD_FREE_MULTI_WINDOW_MODE, 130 TRANS_ID_GET_DISPLAYID_BY_WINDOWID, 131 TRANS_ID_IS_WINDOW_RECT_AUTO_SAVE, 132 TRANS_ID_SET_GLOBAL_DRAG_RESIZE_TYPE, 133 TRANS_ID_GET_GLOBAL_DRAG_RESIZE_TYPE, 134 TRANS_ID_SET_APP_DRAG_RESIZE_TYPE, 135 TRANS_ID_GET_APP_DRAG_RESIZE_TYPE, 136 TRANS_ID_SET_APP_KEY_FRAME_POLICY, 137 TRANS_ID_WATCH_GESTURE_CONSUME_RESULT, 138 TRANS_ID_WATCH_FOCUS_ACTIVE_CHANGE, 139 TRANS_ID_SHIFT_APP_WINDOW_POINTER_EVENT, 140 TRANS_ID_NOTIFY_SCREEN_SHOT_EVENT, 141 TRANS_ID_SET_START_WINDOW_BACKGROUND_COLOR, 142 TRANS_ID_REQUEST_FOCUS_STATUS_BY_SA, 143 TRANS_ID_SET_PARENT_WINDOW, 144 TRANS_ID_MINIMIZE_BY_WINDOW_ID, 145 TRANS_ID_SET_FOREGROUND_WINDOW_NUM, 146 TRANS_ID_USE_IMPLICIT_ANIMATION, 147 TRANS_ID_SET_IMAGE_FOR_RECENT, 148 TRANS_ID_REGISTER_WINDOW_PROPERTY_CHANGE_AGENT, 149 TRANS_ID_UNREGISTER_WINDOW_PROPERTY_CHANGE_AGENT, 150 TRANS_ID_GET_HOST_GLOBAL_SCALE_RECT, 151 TRANS_ID_ANIMATE_TO_WINDOW, 152 TRANS_ID_CREATE_UI_EFFECT_CONTROLLER, 153 TRANS_ID_ADD_SESSION_BLACK_LIST, 154 TRANS_ID_REMOVE_SESSION_BLACK_LIST, 155 TRANS_ID_GET_PIP_SWITCH_STATUS, 156 TRANS_ID_RECOVER_WINDOW_PROPERTY_CHANGE_FLAG, 157 }; 158 159 virtual WSError SetSessionLabel(const sptr<IRemoteObject>& token, const std::string& label) = 0; 160 virtual WSError SetSessionIcon(const sptr<IRemoteObject>& token, const std::shared_ptr<Media::PixelMap>& icon) = 0; 161 virtual WSError IsValidSessionIds(const std::vector<int32_t>& sessionIds, std::vector<bool>& results) = 0; 162 virtual WSError PendingSessionToForeground(const sptr<IRemoteObject>& token) = 0; 163 virtual WSError PendingSessionToBackgroundForDelegator(const sptr<IRemoteObject>& token, 164 bool shouldBackToCaller = true) = 0; 165 virtual WSError GetFocusSessionToken(sptr<IRemoteObject>& token, DisplayId displayId = DEFAULT_DISPLAY_ID) = 0; 166 virtual WSError GetFocusSessionElement(AppExecFwk::ElementName& element, 167 DisplayId displayId = DEFAULT_DISPLAY_ID) = 0; 168 169 virtual WSError RegisterSessionListener(const sptr<ISessionListener>& listener) = 0; 170 virtual WSError UnRegisterSessionListener(const sptr<ISessionListener>& listener) = 0; 171 virtual WSError GetSessionInfos(const std::string& deviceId, 172 int32_t numMax, std::vector<SessionInfoBean>& sessionInfos) = 0; 173 virtual WSError GetSessionInfo(const std::string& deviceId, int32_t persistentId, SessionInfoBean& sessionInfo) = 0; 174 virtual WSError GetSessionInfoByContinueSessionId(const std::string& continueSessionId, 175 SessionInfoBean& sessionInfo) = 0; DumpSessionAll(std::vector<std::string> & infos)176 virtual WSError DumpSessionAll(std::vector<std::string>& infos) override { return WSError::WS_OK; } DumpSessionWithId(int32_t persistentId,std::vector<std::string> & infos)177 virtual WSError DumpSessionWithId(int32_t persistentId, std::vector<std::string>& infos) override 178 { 179 return WSError::WS_OK; 180 } 181 virtual WSError SetSessionContinueState(const sptr<IRemoteObject>& token, const ContinueState& continueState) = 0; 182 183 virtual WSError TerminateSessionNew( 184 const sptr<AAFwk::SessionInfo> info, bool needStartCaller, bool isFromBroker = false) = 0; 185 virtual WSError GetSessionDumpInfo(const std::vector<std::string>& params, std::string& info) = 0; 186 virtual WSError GetSessionSnapshot(const std::string& deviceId, int32_t persistentId, 187 SessionSnapshot& snapshot, bool isLowResolution) = 0; 188 virtual WSError ClearSession(int32_t persistentId) = 0; 189 virtual WSError ClearAllSessions() = 0; 190 virtual WSError LockSession(int32_t sessionId) = 0; 191 virtual WSError UnlockSession(int32_t sessionId) = 0; 192 virtual WSError MoveSessionsToForeground(const std::vector<std::int32_t>& sessionIds, int32_t topSessionId) = 0; 193 virtual WSError MoveSessionsToBackground(const std::vector<std::int32_t>& sessionIds, 194 std::vector<std::int32_t>& result) = 0; GetSessionSnapshotById(int32_t persistentId,SessionSnapshot & snapshot)195 virtual WMError GetSessionSnapshotById(int32_t persistentId, SessionSnapshot& snapshot) 196 { 197 return WMError::WM_OK; 198 } NotifyWindowExtensionVisibilityChange(int32_t pid,int32_t uid,bool visible)199 virtual WSError NotifyWindowExtensionVisibilityChange(int32_t pid, int32_t uid, bool visible) override 200 { 201 return WSError::WS_OK; 202 } 203 204 /** 205 * @brief notify watch gesture event consumption results 206 * 207 * This function provides the ability for notifying watch gesture event consumption results 208 * 209 * @param keycode keyEvent codes 210 * @param isConsumed consume result 211 * @return Returns WSError::WS_OK if called success, otherwise failed. 212 * @permission Make sure the caller has system permission. 213 */ NotifyWatchGestureConsumeResult(int32_t keyCode,bool isConsumed)214 WMError NotifyWatchGestureConsumeResult(int32_t keyCode, bool isConsumed) override { return WMError::WM_OK; } 215 216 /** 217 * @brief notify watch focus active change 218 * 219 * This function provides the ability for notifying watch focus active change 220 * 221 * @param isActive focus status 222 * @return Returns WSError::WS_OK if called success, otherwise failed. 223 * @permission Make sure the caller has system permission. 224 */ NotifyWatchFocusActiveChange(bool isActive)225 WMError NotifyWatchFocusActiveChange(bool isActive) override { return WMError::WM_OK; } 226 227 virtual WSError RegisterIAbilityManagerCollaborator(int32_t type, 228 const sptr<AAFwk::IAbilityManagerCollaborator>& impl) = 0; 229 virtual WSError UnregisterIAbilityManagerCollaborator(int32_t type) = 0; 230 // interfaces of IWindowManager CreateWindow(sptr<IWindow> & window,sptr<WindowProperty> & property,const std::shared_ptr<RSSurfaceNode> & surfaceNode,uint32_t & windowId,sptr<IRemoteObject> token)231 WMError CreateWindow(sptr<IWindow>& window, sptr<WindowProperty>& property, 232 const std::shared_ptr<RSSurfaceNode>& surfaceNode, 233 uint32_t& windowId, sptr<IRemoteObject> token) override { return WMError::WM_OK; } AddWindow(sptr<WindowProperty> & property)234 WMError AddWindow(sptr<WindowProperty>& property) override { return WMError::WM_OK; } RemoveWindow(uint32_t windowId,bool isFromInnerkits)235 WMError RemoveWindow(uint32_t windowId, bool isFromInnerkits) override { return WMError::WM_OK; } 236 WMError DestroyWindow(uint32_t windowId, bool onlySelf = false) override { return WMError::WM_OK; } RequestFocus(uint32_t windowId)237 WMError RequestFocus(uint32_t windowId) override { return WMError::WM_OK; } 238 WMError RequestFocusStatusBySA(int32_t persistentId, bool isFocused = true, 239 bool byForeground = true, FocusChangeReason reason = FocusChangeReason::SA_REQUEST) override 240 { 241 return WMError::WM_OK; 242 } 243 AvoidArea GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type, 244 const Rect& rect = Rect::EMPTY_RECT) override { return {}; } 245 246 /** 247 * @brief get top window information by id of main window. 248 * 249 * This function provides the ability for system applications to get window information. 250 * 251 * @param mainWinId the id of target main window. 252 * @return Returns WSError::WS_OK if called success, otherwise failed. 253 * @permission Make sure the caller has system permission. 254 */ GetTopWindowId(uint32_t mainWinId,uint32_t & topWinId)255 WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId) override { return WMError::WM_OK; } 256 // only main window,sub window and dialog window can use GetParentMainWindowId(int32_t windowId,int32_t & mainWindowId)257 WMError GetParentMainWindowId(int32_t windowId, int32_t& mainWindowId) override { return WMError::WM_OK; } NotifyServerReadyToMoveOrDrag(uint32_t windowId,sptr<WindowProperty> & windowProperty,sptr<MoveDragProperty> & moveDragProperty)258 void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty, 259 sptr<MoveDragProperty>& moveDragProperty) override {} ProcessPointDown(uint32_t windowId,bool isPointDown)260 void ProcessPointDown(uint32_t windowId, bool isPointDown) override {} ProcessPointUp(uint32_t windowId)261 void ProcessPointUp(uint32_t windowId) override {} MinimizeAllAppWindows(DisplayId displayId)262 WMError MinimizeAllAppWindows(DisplayId displayId) override { return WMError::WM_OK; } ToggleShownStateForAllAppWindows()263 WMError ToggleShownStateForAllAppWindows() override { return WMError::WM_OK; } SetWindowLayoutMode(WindowLayoutMode mode)264 WMError SetWindowLayoutMode(WindowLayoutMode mode) override { return WMError::WM_OK; } 265 WMError UpdateProperty(sptr<WindowProperty>& windowProperty, PropertyChangeAction action, 266 bool isAsyncTask = false) override { return WMError::WM_OK; } SetWindowGravity(uint32_t windowId,WindowGravity gravity,uint32_t percent)267 WMError SetWindowGravity(uint32_t windowId, WindowGravity gravity, uint32_t percent) override 268 { 269 return WMError::WM_OK; 270 } RegisterWindowManagerAgent(WindowManagerAgentType type,const sptr<IWindowManagerAgent> & windowManagerAgent)271 WMError RegisterWindowManagerAgent(WindowManagerAgentType type, 272 const sptr<IWindowManagerAgent>& windowManagerAgent) override { return WMError::WM_OK; } UnregisterWindowManagerAgent(WindowManagerAgentType type,const sptr<IWindowManagerAgent> & windowManagerAgent)273 WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, 274 const sptr<IWindowManagerAgent>& windowManagerAgent) override { return WMError::WM_OK; } RegisterWindowPropertyChangeAgent(WindowInfoKey windowInfoKey,uint32_t interestInfo,const sptr<IWindowManagerAgent> & windowManagerAgent)275 WMError RegisterWindowPropertyChangeAgent(WindowInfoKey windowInfoKey, 276 uint32_t interestInfo, const sptr<IWindowManagerAgent>& windowManagerAgent) override { return WMError::WM_OK; } UnregisterWindowPropertyChangeAgent(WindowInfoKey windowInfoKey,uint32_t interestInfo,const sptr<IWindowManagerAgent> & windowManagerAgent)277 WMError UnregisterWindowPropertyChangeAgent(WindowInfoKey windowInfoKey, 278 uint32_t interestInfo, const sptr<IWindowManagerAgent>& windowManagerAgent) override { return WMError::WM_OK;} RecoverWindowPropertyChangeFlag(uint32_t observedFlags,uint32_t interestedFlags)279 WMError RecoverWindowPropertyChangeFlag(uint32_t observedFlags, uint32_t interestedFlags) override 280 { 281 return WMError::WM_OK; 282 } GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>> & infos)283 WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos) override 284 { 285 return WMError::WM_OK; 286 } GetUnreliableWindowInfo(int32_t windowId,std::vector<sptr<UnreliableWindowInfo>> & infos)287 WMError GetUnreliableWindowInfo(int32_t windowId, std::vector<sptr<UnreliableWindowInfo>>& infos) override 288 { 289 return WMError::WM_OK; 290 } ListWindowInfo(const WindowInfoOption & windowInfoOption,std::vector<sptr<WindowInfo>> & infos)291 WMError ListWindowInfo(const WindowInfoOption& windowInfoOption, 292 std::vector<sptr<WindowInfo>>& infos) override { return WMError::WM_OK; } GetAllWindowLayoutInfo(DisplayId displayId,std::vector<sptr<WindowLayoutInfo>> & infos)293 WMError GetAllWindowLayoutInfo(DisplayId displayId, 294 std::vector<sptr<WindowLayoutInfo>>& infos) override { return WMError::WM_OK; } GetGlobalWindowMode(DisplayId displayId,GlobalWindowMode & globalWinMode)295 WMError GetGlobalWindowMode(DisplayId displayId, 296 GlobalWindowMode& globalWinMode) override { return WMError::WM_OK; } GetTopNavDestinationName(int32_t windowId,std::string & topNavDestName)297 WMError GetTopNavDestinationName(int32_t windowId, std::string& topNavDestName) override { return WMError::WM_OK; } GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>> & infos)298 WMError GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos) override { return WMError::WM_OK; } SetWindowAnimationController(const sptr<RSIWindowAnimationController> & controller)299 WMError SetWindowAnimationController(const sptr<RSIWindowAnimationController>& controller) override 300 { 301 return WMError::WM_OK; 302 } GetSystemConfig(SystemConfig & systemConfig)303 WMError GetSystemConfig(SystemConfig& systemConfig) override { return WMError::WM_OK; } 304 WMError NotifyWindowTransition(sptr<WindowTransitionInfo>& from, sptr<WindowTransitionInfo>& to, 305 bool isFromClient = false) override { return WMError::WM_OK; } GetModeChangeHotZones(DisplayId displayId,ModeChangeHotZones & hotZones)306 WMError GetModeChangeHotZones(DisplayId displayId, ModeChangeHotZones& hotZones) override { return WMError::WM_OK; } MinimizeWindowsByLauncher(std::vector<uint32_t> windowIds,bool isAnimated,sptr<RSIWindowAnimationFinishedCallback> & finishCallback)307 void MinimizeWindowsByLauncher(std::vector<uint32_t> windowIds, bool isAnimated, 308 sptr<RSIWindowAnimationFinishedCallback>& finishCallback) override {} UpdateAvoidAreaListener(uint32_t windowId,bool haveListener)309 WMError UpdateAvoidAreaListener(uint32_t windowId, bool haveListener) override { return WMError::WM_OK; } UpdateRsTree(uint32_t windowId,bool isAdd)310 WMError UpdateRsTree(uint32_t windowId, bool isAdd) override { return WMError::WM_OK; } BindDialogTarget(uint32_t & windowId,sptr<IRemoteObject> targetToken)311 WMError BindDialogTarget(uint32_t& windowId, sptr<IRemoteObject> targetToken) override { return WMError::WM_OK; } SetAnchorAndScale(int32_t x,int32_t y,float scale)312 void SetAnchorAndScale(int32_t x, int32_t y, float scale) override {} SetAnchorOffset(int32_t deltaX,int32_t deltaY)313 void SetAnchorOffset(int32_t deltaX, int32_t deltaY) override {} OffWindowZoom()314 void OffWindowZoom() override {} RaiseToAppTop(uint32_t windowId)315 WMError RaiseToAppTop(uint32_t windowId) override { return WMError::WM_OK; } GetSnapshot(int32_t windowId)316 std::shared_ptr<Media::PixelMap> GetSnapshot(int32_t windowId) override { return nullptr; } SetGestureNavigationEnabled(bool enable)317 WMError SetGestureNavigationEnabled(bool enable) override { return WMError::WM_OK; } DispatchKeyEvent(uint32_t windowId,std::shared_ptr<MMI::KeyEvent> event)318 void DispatchKeyEvent(uint32_t windowId, std::shared_ptr<MMI::KeyEvent> event) override {} NotifyDumpInfoResult(const std::vector<std::string> & info)319 void NotifyDumpInfoResult(const std::vector<std::string>& info) override {}; GetWindowAnimationTargets(std::vector<uint32_t> missionIds,std::vector<sptr<RSWindowAnimationTarget>> & targets)320 WMError GetWindowAnimationTargets(std::vector<uint32_t> missionIds, 321 std::vector<sptr<RSWindowAnimationTarget>>& targets) override { return WMError::WM_OK; } SetMaximizeMode(MaximizeMode maximizeMode)322 void SetMaximizeMode(MaximizeMode maximizeMode) override {} GetMaximizeMode()323 MaximizeMode GetMaximizeMode() override { return MaximizeMode::MODE_AVOID_SYSTEM_BAR; } 324 void GetFocusWindowInfo(FocusChangeInfo& focusInfo, DisplayId displayId = DEFAULT_DISPLAY_ID) override {} MinimizeByWindowId(const std::vector<int32_t> & windowIds)325 WMError MinimizeByWindowId(const std::vector<int32_t>& windowIds) override { return WMError::WM_OK; } SetForegroundWindowNum(uint32_t windowNum)326 WMError SetForegroundWindowNum(uint32_t windowNum) override { return WMError::WM_OK; } 327 328 /** 329 * @brief Raise a window to screen top by id of window. 330 * 331 * This function provides the ability for system applications to raise window. 332 * 333 * @param persistentId the id of target window. 334 * @return Returns WSError::WS_OK if called success, otherwise failed. 335 * @permission Make sure the caller has system permission. 336 */ RaiseWindowToTop(int32_t persistentId)337 WSError RaiseWindowToTop(int32_t persistentId) override { return WSError::WS_OK; } ShiftAppWindowFocus(int32_t sourcePersistentId,int32_t targetPersistentId)338 WSError ShiftAppWindowFocus(int32_t sourcePersistentId, int32_t targetPersistentId) override 339 { 340 return WSError::WS_OK; 341 } AddExtensionWindowStageToSCB(const sptr<ISessionStage> & sessionStage,const sptr<IRemoteObject> & token,uint64_t surfaceNodeId,bool isConstrainedModal)342 void AddExtensionWindowStageToSCB(const sptr<ISessionStage>& sessionStage, 343 const sptr<IRemoteObject>& token, uint64_t surfaceNodeId, bool isConstrainedModal) override {} RemoveExtensionWindowStageFromSCB(const sptr<ISessionStage> & sessionStage,const sptr<IRemoteObject> & token,bool isConstrainedModal)344 void RemoveExtensionWindowStageFromSCB(const sptr<ISessionStage>& sessionStage, 345 const sptr<IRemoteObject>& token, bool isConstrainedModal) override {} UpdateModalExtensionRect(const sptr<IRemoteObject> & token,Rect rect)346 void UpdateModalExtensionRect(const sptr<IRemoteObject>& token, Rect rect) override {} ProcessModalExtensionPointDown(const sptr<IRemoteObject> & token,int32_t posX,int32_t posY)347 void ProcessModalExtensionPointDown(const sptr<IRemoteObject>& token, int32_t posX, int32_t posY) override {} AddOrRemoveSecureSession(int32_t persistentId,bool shouldHide)348 WSError AddOrRemoveSecureSession(int32_t persistentId, bool shouldHide) override 349 { 350 return WSError::WS_OK; 351 } UpdateExtWindowFlags(const sptr<IRemoteObject> & token,uint32_t extWindowFlags,uint32_t extWindowActions)352 WSError UpdateExtWindowFlags(const sptr<IRemoteObject>& token, uint32_t extWindowFlags, 353 uint32_t extWindowActions) override 354 { 355 return WSError::WS_OK; 356 } GetHostWindowRect(int32_t hostWindowId,Rect & rect)357 WSError GetHostWindowRect(int32_t hostWindowId, Rect& rect) override 358 { 359 return WSError::WS_OK; 360 } GetHostGlobalScaledRect(int32_t hostWindowId,Rect & globalScaledRect)361 WSError GetHostGlobalScaledRect(int32_t hostWindowId, Rect& globalScaledRect) override 362 { 363 return WSError::WS_OK; 364 } GetFreeMultiWindowEnableState(bool & enable)365 WSError GetFreeMultiWindowEnableState(bool& enable) override 366 { 367 return WSError::WS_OK; 368 } GetCallingWindowWindowStatus(int32_t persistentId,WindowStatus & windowStatus)369 WMError GetCallingWindowWindowStatus(int32_t persistentId, WindowStatus& windowStatus) override 370 { 371 return WMError::WM_OK; 372 } GetCallingWindowRect(int32_t persistentId,Rect & rect)373 WMError GetCallingWindowRect(int32_t persistentId, Rect& rect) override 374 { 375 return WMError::WM_OK; 376 } GetWindowModeType(WindowModeType & windowModeType)377 WMError GetWindowModeType(WindowModeType& windowModeType) override { return WMError::WM_OK; } 378 GetWindowStyleType(WindowStyleType & windowStyleType)379 WMError GetWindowStyleType(WindowStyleType& windowStyleType) override { return WMError::WM_OK; } 380 381 virtual WMError GetProcessSurfaceNodeIdByPersistentId(const int32_t pid, 382 const std::vector<int32_t>& persistentIds, std::vector<uint64_t>& surfaceNodeIds) = 0; 383 SkipSnapshotForAppProcess(int32_t pid,bool skip)384 WMError SkipSnapshotForAppProcess(int32_t pid, bool skip) override { return WMError::WM_OK; } 385 386 virtual WMError SkipSnapshotByUserIdAndBundleNames(int32_t userId, 387 const std::vector<std::string>& bundleNameList) = 0; 388 SetProcessWatermark(int32_t pid,const std::string & watermarkName,bool isEnabled)389 WMError SetProcessWatermark(int32_t pid, const std::string& watermarkName, 390 bool isEnabled) override { return WMError::WM_OK; } GetWindowIdsByCoordinate(DisplayId displayId,int32_t windowNumber,int32_t x,int32_t y,std::vector<int32_t> & windowIds)391 WMError GetWindowIdsByCoordinate(DisplayId displayId, int32_t windowNumber, int32_t x, int32_t y, 392 std::vector<int32_t>& windowIds) override { return WMError::WM_OK; } 393 UpdateScreenLockStatusForApp(const std::string & bundleName,bool isRelease)394 WMError UpdateScreenLockStatusForApp(const std::string& bundleName, 395 bool isRelease) override { return WMError::WM_OK; } 396 AddSkipSelfWhenShowOnVirtualScreenList(const std::vector<int32_t> & persistentIds)397 virtual WMError AddSkipSelfWhenShowOnVirtualScreenList( 398 const std::vector<int32_t>& persistentIds) { return WMError::WM_OK; } 399 RemoveSkipSelfWhenShowOnVirtualScreenList(const std::vector<int32_t> & persistentIds)400 virtual WMError RemoveSkipSelfWhenShowOnVirtualScreenList( 401 const std::vector<int32_t>& persistentIds) { return WMError::WM_OK; } 402 SetScreenPrivacyWindowTagSwitch(uint64_t screenId,const std::vector<std::string> & privacyWindowTags,bool enable)403 virtual WMError SetScreenPrivacyWindowTagSwitch( 404 uint64_t screenId, const std::vector<std::string>& privacyWindowTags, bool enable) { return WMError::WM_OK; } 405 IsPcOrPadFreeMultiWindowMode(bool & isPcOrPadFreeMultiWindowMode)406 WMError IsPcOrPadFreeMultiWindowMode(bool& isPcOrPadFreeMultiWindowMode) override { return WMError::WM_OK; } 407 IsWindowRectAutoSave(const std::string & key,bool & enabled,int persistentId)408 WMError IsWindowRectAutoSave(const std::string& key, bool& enabled, 409 int persistentId) override { return WMError::WM_OK; } 410 SetImageForRecent(uint32_t imgResourceId,ImageFit imageFit,int32_t persistentId)411 WMError SetImageForRecent(uint32_t imgResourceId, ImageFit imageFit, 412 int32_t persistentId) override { return WMError::WM_OK; } 413 GetDisplayIdByWindowId(const std::vector<uint64_t> & windowIds,std::unordered_map<uint64_t,DisplayId> & windowDisplayIdMap)414 WMError GetDisplayIdByWindowId(const std::vector<uint64_t>& windowIds, 415 std::unordered_map<uint64_t, DisplayId>& windowDisplayIdMap) override { return WMError::WM_OK; } 416 SetGlobalDragResizeType(DragResizeType dragResizeType)417 WMError SetGlobalDragResizeType(DragResizeType dragResizeType) override { return WMError::WM_OK; } GetGlobalDragResizeType(DragResizeType & dragResizeType)418 WMError GetGlobalDragResizeType(DragResizeType& dragResizeType) override { return WMError::WM_OK; } SetAppDragResizeType(const std::string & bundleName,DragResizeType dragResizeType)419 WMError SetAppDragResizeType(const std::string& bundleName, 420 DragResizeType dragResizeType) override { return WMError::WM_OK; } GetAppDragResizeType(const std::string & bundleName,DragResizeType & dragResizeType)421 WMError GetAppDragResizeType(const std::string& bundleName, 422 DragResizeType& dragResizeType) override { return WMError::WM_OK; } SetAppKeyFramePolicy(const std::string & bundleName,const KeyFramePolicy & keyFramePolicy)423 WMError SetAppKeyFramePolicy(const std::string& bundleName, 424 const KeyFramePolicy& keyFramePolicy) override { return WMError::WM_OK; } ShiftAppWindowPointerEvent(int32_t sourcePersistentId,int32_t targetPersistentId,int32_t fingerId)425 WMError ShiftAppWindowPointerEvent(int32_t sourcePersistentId, int32_t targetPersistentId, 426 int32_t fingerId) override { return WMError::WM_OK; } NotifyScreenshotEvent(ScreenshotEventType type)427 WMError NotifyScreenshotEvent(ScreenshotEventType type) override { return WMError::WM_OK; } SetStartWindowBackgroundColor(const std::string & moduleName,const std::string & abilityName,uint32_t color,int32_t uid)428 WMError SetStartWindowBackgroundColor(const std::string& moduleName, const std::string& abilityName, 429 uint32_t color, int32_t uid) override { return WMError::WM_OK; } HasFloatingWindowForeground(const sptr<IRemoteObject> & abilityToken,bool & hasOrNot)430 WMError HasFloatingWindowForeground(const sptr<IRemoteObject>& abilityToken, 431 bool& hasOrNot) override { return WMError::WM_OK; } UseImplicitAnimation(int32_t hostWindowId,bool useImplicit)432 WSError UseImplicitAnimation(int32_t hostWindowId, bool useImplicit) override { return WSError::WS_OK; }; AnimateTo(int32_t windowId,const WindowAnimationProperty & animationProperty,const WindowAnimationOption & animationOption)433 WMError AnimateTo(int32_t windowId, const WindowAnimationProperty& animationProperty, 434 const WindowAnimationOption& animationOption) override { return WMError::WM_OK; } CreateUIEffectController(const sptr<IUIEffectControllerClient> & controllerClient,sptr<IUIEffectController> & controller,int32_t & controllerId)435 WMError CreateUIEffectController(const sptr<IUIEffectControllerClient>& controllerClient, 436 sptr<IUIEffectController>& controller, int32_t& controllerId) override { return WMError::WM_OK; }; AddSessionBlackList(const std::unordered_set<std::string> & bundleNames,const std::unordered_set<std::string> & privacyWindowTags)437 WMError AddSessionBlackList(const std::unordered_set<std::string>& bundleNames, 438 const std::unordered_set<std::string>& privacyWindowTags) override { return WMError::WM_OK; } RemoveSessionBlackList(const std::unordered_set<std::string> & bundleNames,const std::unordered_set<std::string> & privacyWindowTags)439 WMError RemoveSessionBlackList(const std::unordered_set<std::string>& bundleNames, 440 const std::unordered_set<std::string>& privacyWindowTags) override { return WMError::WM_OK; } GetPiPSettingSwitchStatus(bool & switchStatus)441 WMError GetPiPSettingSwitchStatus(bool& switchStatus) override { return WMError::WM_OK; } 442 }; 443 } // namespace OHOS::Rosen 444 #endif // OHOS_ROSEN_WINDOW_SCENE_SESSION_MANAGER_INTERFACE_H 445