1 /* 2 * Copyright (C) 2022 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 ACCESSIBLE_ABILITY_MANAGER_SERVICE_H 17 #define ACCESSIBLE_ABILITY_MANAGER_SERVICE_H 18 19 #include <map> 20 #include <memory> 21 #include <string> 22 23 #include "accessibility_dumper.h" 24 #include "accessibility_def.h" 25 #include "accessible_ability_manager_service_stub.h" 26 #include "accessible_ability_manager_service_event_handler.h" 27 #include "accessibility_account_data.h" 28 #include "accessibility_common_event.h" 29 #ifdef OHOS_BUILD_ENABLE_DISPLAY_MANAGER 30 #include "accessibility_display_manager.h" 31 #endif 32 #include "accessibility_element_operator_callback_stub.h" 33 #include "accessibility_input_interceptor.h" 34 #include "accessibility_keyevent_filter.h" 35 #include "accessibility_settings.h" 36 #include "accessibility_touchEvent_injector.h" 37 #include "accessibility_window_info.h" 38 #include "bundlemgr/bundle_mgr_interface.h" 39 #include "input_manager.h" 40 #include "singleton.h" 41 #include "system_ability.h" 42 #include "window_manager.h" 43 #include "accessibility_short_key.h" 44 #include "accessibility_resource_bundle_manager.h" 45 46 namespace OHOS { 47 namespace Accessibility { 48 class AccessibilityAccountData; 49 class TouchEventInjector; 50 class AccessibilitySettings; 51 class AccessibilityResourceBundleManager; 52 53 enum CallBackID { 54 STATE_CALLBACK, 55 CAPTION_PROPERTY_CALLBACK, 56 ENABLE_ABILITY_LISTS_CALLBACK, 57 CONFIG_CALLBACK 58 }; 59 60 constexpr int REQUEST_ID_INIT = 65535; 61 constexpr int32_t TREE_ID_MAX = 0x00001FFF; 62 constexpr uint32_t TIME_OUT_OPERATOR = 5000; 63 64 const std::map<std::string, int32_t> AccessibilityConfigTable = { 65 {"HIGH_CONTRAST_TEXT", HIGH_CONTRAST_TEXT}, 66 {"INVERT_COLOR", INVERT_COLOR}, 67 {"DALTONIZATION_COLOR_FILTER", DALTONIZATION_COLOR_FILTER}, 68 {"CONTENT_TIMEOUT", CONTENT_TIMEOUT}, 69 {"ANIMATION_OFF", ANIMATION_OFF}, 70 {"BRIGHTNESS_DISCOUNT", BRIGHTNESS_DISCOUNT}, 71 {"AUDIO_MONO", AUDIO_MONO}, 72 {"AUDIO_BALANCE", AUDIO_BALANCE}, 73 {"MOUSE_KEY", MOUSE_KEY}, 74 {"CAPTION_STATE", CAPTION_STATE}, 75 {"CAPTION_STYLE", CAPTION_STYLE}, 76 {"SCREEN_MAGNIFICATION", SCREEN_MAGNIFICATION}, 77 {"MOUSE_AUTOCLICK", MOUSE_AUTOCLICK} 78 }; 79 80 class AccessibleAbilityManagerService : public SystemAbility, public AccessibleAbilityManagerServiceStub { 81 DECLARE_SINGLETON(AccessibleAbilityManagerService) 82 DECLEAR_SYSTEM_ABILITY(AccessibleAbilityManagerService) 83 public: 84 /* For system ability */ 85 void InitHandler(); 86 void InitActionHandler(); 87 void InitSendEventHandler(); 88 void InitChannelHandler(); 89 void InitInputManagerHandler(); 90 void InitGestureHandler(); 91 void InitHoverEnterHandler(); 92 void InitRegisterHandler(); 93 void OnStart() override; 94 void OnStop() override; 95 void OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) override; 96 void OnRemoveSystemAbility(int32_t systemAbilityId, const std::string &deviceId) override; 97 int Dump(int fd, const std::vector<std::u16string>& args) override; 98 void PostDelayUnloadTask() override; 99 100 public: 101 /* For AccessibleAbilityManagerServiceStub */ 102 RetError SendEvent(const AccessibilityEventInfo &uiEvent, const int32_t flag = 0) override; 103 104 RetError VerifyingToKenId(const int32_t windowId, const int64_t elementId); 105 106 uint32_t RegisterStateObserver(const sptr<IAccessibleAbilityManagerStateObserver> &callback) override; 107 108 uint32_t RegisterCaptionObserver(const sptr<IAccessibleAbilityManagerCaptionObserver> &callback) override; 109 110 void RegisterEnableAbilityListsObserver( 111 const sptr<IAccessibilityEnableAbilityListsObserver> &observer) override; 112 113 RetError GetAbilityList(const uint32_t abilityTypes, const int32_t stateType, 114 std::vector<AccessibilityAbilityInfo> &infos) override; 115 116 RetError RegisterElementOperator(const int32_t windowId, 117 const sptr<IAccessibilityElementOperator> &operation, bool isApp) override; 118 119 RetError RegisterElementOperator(Registration parameter, 120 const sptr<IAccessibilityElementOperator> &operation, bool isApp) override; 121 122 RetError DeregisterElementOperator(const int32_t windowId) override; 123 124 RetError DeregisterElementOperator(const int32_t windowId, const int32_t treeId) override; 125 126 RetError GetCaptionProperty(AccessibilityConfig::CaptionProperty &caption) override; 127 RetError SetCaptionProperty(const AccessibilityConfig::CaptionProperty &caption) override; 128 RetError SetCaptionState(const bool state) override; 129 130 bool GetEnabledState() override; 131 RetError GetCaptionState(bool &state) override; 132 bool GetTouchGuideState() override; 133 bool GetGestureState() override; 134 bool GetKeyEventObserverState() override; 135 136 RetError EnableAbility(const std::string &name, const uint32_t capabilities) override; 137 RetError GetEnabledAbilities(std::vector<std::string> &enabledAbilities) override; 138 RetError SetCurtainScreenUsingStatus(bool isEnable); 139 RetError DisableAbility(const std::string &name) override; 140 RetError EnableUITestAbility(const sptr<IRemoteObject>& obj) override; 141 RetError DisableUITestAbility() override; 142 int32_t GetActiveWindow() override; 143 void GetRealWindowAndElementId(int32_t& windowId, int64_t& elementId) override; 144 void GetSceneBoardInnerWinId(int32_t windowId, int64_t elementId, int32_t& innerWid) override; 145 bool FindFocusedElement(AccessibilityElementInfo &elementInfo, uint32_t timeout = TIME_OUT_OPERATOR); 146 bool ExecuteActionOnAccessibilityFocused(const ActionType &action); 147 RetError GetFocusedWindowId(int32_t &focusedWindowId) override; 148 void SetFocusWindowId(const int32_t focusWindowId); 149 void SetFocusElementId(const int64_t focusElementId); 150 int32_t GetFocusWindowId(); 151 int64_t GetFocusElementId(); 152 static int32_t GetTreeIdBySplitElementId(const int64_t elementId); 153 int64_t GetRootParentId(int32_t windowId, int32_t treeId) override; 154 RetError GetAllTreeId(int32_t windowId, std::vector<int32_t> &treeIds) override; 155 void SetTokenIdMapAndRootParentId(const sptr<AccessibilityWindowConnection> connection, 156 const int32_t treeId, const int64_t nodeId, const uint32_t tokenId); 157 void RemoveTreeDeathRecipient(const int32_t windowId, const int32_t treeId, 158 const sptr<AccessibilityWindowConnection> connection); 159 int32_t GenerateRequestId(); 160 void GetElementOperatorConnection(sptr<AccessibilityWindowConnection> &connection, 161 const int64_t elementId, sptr<IAccessibilityElementOperator> &elementOperator); 162 bool GetScreenReaderState() override; 163 private: 164 int32_t focusWindowId_ = -1; 165 int64_t focusElementId_ = -1; 166 std::atomic<int> requestId_ = REQUEST_ID_INIT; 167 public: 168 /* For inner modules */ 169 bool EnableShortKeyTargetAbility(const std::string &name = ""); 170 bool DisableShortKeyTargetAbility(); 171 void OnShortKeyProcess(); 172 void UpdateShortKeyRegister(); 173 174 void SetTouchEventInjector(const sptr<TouchEventInjector> &touchEventInjector); 175 GetTouchEventInjector()176 inline sptr<TouchEventInjector> GetTouchEventInjector() 177 { 178 return touchEventInjector_; 179 } 180 GetKeyEventFilter()181 inline sptr<KeyEventFilter> GetKeyEventFilter() 182 { 183 return keyEventFilter_; 184 } 185 186 void SetKeyEventFilter(const sptr<KeyEventFilter> &keyEventFilter); 187 188 /* For DisplayResize */ 189 void NotifyDisplayResizeStateChanged(int32_t displayId, Rect& rect, float scale, float centerX, float centerY); 190 IsServiceReady()191 inline bool IsServiceReady() 192 { 193 return isReady_; 194 } 195 GetCurrentAccountId()196 inline int32_t GetCurrentAccountId() 197 { 198 return currentAccountId_; 199 } 200 GetMainHandler()201 inline std::shared_ptr<AAMSEventHandler> &GetMainHandler() 202 { 203 return handler_; 204 } 205 GetMainRunner()206 inline std::shared_ptr<AppExecFwk::EventRunner> &GetMainRunner() 207 { 208 return runner_; 209 } 210 GetChannelRunner()211 inline std::shared_ptr<AppExecFwk::EventRunner> &GetChannelRunner() 212 { 213 return channelRunner_; 214 } 215 GetInputManagerRunner()216 inline std::shared_ptr<AppExecFwk::EventRunner> &GetInputManagerRunner() 217 { 218 return inputManagerRunner_; 219 } 220 GetGestureRunner()221 inline std::shared_ptr<AppExecFwk::EventRunner> &GetGestureRunner() 222 { 223 return gestureRunner_; 224 } 225 226 sptr<AccessibilityAccountData> GetAccountData(int32_t accountId); 227 sptr<AccessibilityAccountData> GetCurrentAccountData(); 228 std::vector<int32_t> GetAllAccountIds(); 229 sptr<AppExecFwk::IBundleMgr> GetBundleMgrProxy(); 230 231 /* For common event */ 232 void AddedUser(int32_t accountId); 233 void RemovedUser(int32_t accountId); 234 void SwitchedUser(int32_t accountId); 235 void PackageChanged(const std::string &bundleName); 236 void PackageRemoved(const std::string &bundleName); 237 void PackageAdd(const std::string &bundleName); 238 239 void UpdateAccessibilityManagerService(); 240 void InsertWindowIdEventPair(int32_t windowId, const AccessibilityEventInfo &event); 241 bool CheckWindowIdEventExist(int32_t windowId); 242 bool CheckWindowRegister(int32_t windowId); 243 RetError GetResourceBundleInfo(AccessibilityEventInfo &eventInfo); 244 RetError GetResourceValue(AccessibilityEventInfo &eventInfo, AppExecFwk::BundleInfo bundleInfo, 245 int32_t userId, std::string &result); 246 247 // used for arkui windowId 1 map to WMS windowId 248 void FindInnerWindowId(const AccessibilityEventInfo &event, int32_t& windowId); 249 bool GetParentElementRecursively(int32_t windowId, int64_t elementId, 250 std::vector<AccessibilityElementInfo>& infos); 251 252 // used for arkui windowId 1 map to WMS windowId 253 class ElementOperatorCallbackImpl : public AccessibilityElementOperatorCallbackStub { 254 public: 255 ElementOperatorCallbackImpl() = default; 256 ~ElementOperatorCallbackImpl() = default; 257 258 virtual void SetSearchElementInfoByAccessibilityIdResult(const std::vector<AccessibilityElementInfo> &infos, 259 const int32_t requestId) override; 260 virtual void SetSearchDefaultFocusByWindowIdResult(const std::vector<AccessibilityElementInfo> &infos, 261 const int32_t requestId) override; 262 virtual void SetSearchElementInfoByTextResult(const std::vector<AccessibilityElementInfo> &infos, 263 const int32_t requestId) override; 264 virtual void SetFindFocusedElementInfoResult(const AccessibilityElementInfo &info, 265 const int32_t requestId) override; 266 virtual void SetFocusMoveSearchResult(const AccessibilityElementInfo &info, const int32_t requestId) override; 267 virtual void SetExecuteActionResult(const bool succeeded, const int32_t requestId) override; 268 virtual void SetCursorPositionResult(const int32_t cursorPosition, const int32_t requestId) override; 269 270 private: 271 ffrt::promise<void> promise_; 272 bool executeActionResult_ = false; 273 AccessibilityElementInfo accessibilityInfoResult_ = {}; 274 std::vector<AccessibilityElementInfo> elementInfosResult_; 275 int32_t callCursorPosition_ = 0; 276 277 friend class AccessibleAbilityManagerService; 278 }; 279 280 RetError SetScreenMagnificationState(const bool state) override; 281 RetError SetShortKeyState(const bool state) override; 282 RetError SetMouseKeyState(const bool state) override; 283 RetError SetMouseAutoClick(const int32_t time) override; 284 RetError SetShortkeyTarget(const std::string &name) override; 285 RetError SetShortkeyMultiTarget(const std::vector<std::string> &name) override; 286 RetError SetHighContrastTextState(const bool state) override; 287 RetError SetInvertColorState(const bool state) override; 288 RetError SetAnimationOffState(const bool state) override; 289 RetError SetAudioMonoState(const bool state) override; 290 RetError SetDaltonizationState(const bool state) override; 291 RetError SetDaltonizationColorFilter(const uint32_t filter) override; 292 RetError SetContentTimeout(const uint32_t time) override; 293 RetError SetBrightnessDiscount(const float discount) override; 294 RetError SetAudioBalance(const float balance) override; 295 RetError SetClickResponseTime(const uint32_t time) override; 296 RetError SetIgnoreRepeatClickState(const bool state) override; 297 RetError SetIgnoreRepeatClickTime(const uint32_t time) override; 298 299 RetError GetScreenMagnificationState(bool &state) override; 300 RetError GetShortKeyState(bool &state) override; 301 RetError GetMouseKeyState(bool &state) override; 302 RetError GetMouseAutoClick(int32_t &time) override; 303 RetError GetShortkeyTarget(std::string &name) override; 304 RetError GetShortkeyMultiTarget(std::vector<std::string> &name) override; 305 RetError GetHighContrastTextState(bool &state) override; 306 RetError GetInvertColorState(bool &state) override; 307 RetError GetAnimationOffState(bool &state) override; 308 RetError GetAudioMonoState(bool &state) override; 309 RetError GetDaltonizationState(bool &state) override; 310 RetError GetDaltonizationColorFilter(uint32_t &type) override; 311 RetError GetContentTimeout(uint32_t &timer) override; 312 RetError GetBrightnessDiscount(float &brightness) override; 313 RetError GetAudioBalance(float &balance) override; 314 RetError GetClickResponseTime(uint32_t &time) override; 315 RetError GetIgnoreRepeatClickState(bool &state) override; 316 RetError GetIgnoreRepeatClickTime(uint32_t &time) override; 317 void GetAllConfigs(AccessibilityConfigData &configData) override; 318 319 uint32_t RegisterConfigObserver(const sptr<IAccessibleAbilityManagerConfigObserver> &callback) override; 320 void UpdateConfigState(); 321 void UpdateAudioBalance(); 322 void UpdateBrightnessDiscount(); 323 void UpdateContentTimeout(); 324 void UpdateDaltonizationColorFilter(); 325 void UpdateMouseAutoClick(); 326 void UpdateShortkeyTarget(); 327 void UpdateShortkeyMultiTarget(); 328 void UpdateClickResponseTime(); 329 void UpdateIgnoreRepeatClickTime(); 330 331 void UpdateInputFilter(); 332 void AddRequestId(int32_t windowId, int32_t treeId, int32_t requestId, 333 sptr<IAccessibilityElementOperatorCallback> callback); 334 void RemoveRequestId(int32_t requestId) override; 335 void OnDataClone(); 336 337 private: 338 void StopCallbackWait(int32_t windowId); 339 void StopCallbackWait(int32_t windowId, int32_t treeId); 340 RetError CheckCallingUid(); 341 sptr<AccessibilityWindowConnection> GetRealIdConnection(); 342 bool FindFocusedElementByConnection(sptr<AccessibilityWindowConnection> connection, 343 AccessibilityElementInfo &elementInfo); 344 bool SetTargetAbility(const int32_t targetAbilityValue); 345 RetError RegisterElementOperatorChildWork(const Registration ¶meter, const int32_t treeId, 346 const int64_t nodeId, const sptr<IAccessibilityElementOperator> &operation, 347 const uint32_t tokenId, bool isApp); 348 void IsCheckWindowIdEventExist(const int32_t windowId); 349 class StateCallbackDeathRecipient final : public IRemoteObject::DeathRecipient { 350 public: 351 StateCallbackDeathRecipient() = default; 352 ~StateCallbackDeathRecipient() final = default; 353 DISALLOW_COPY_AND_MOVE(StateCallbackDeathRecipient); 354 355 void OnRemoteDied(const wptr<IRemoteObject> &remote) final; 356 }; 357 358 class InteractionOperationDeathRecipient final : public IRemoteObject::DeathRecipient { 359 public: InteractionOperationDeathRecipient(int32_t windowId,int32_t accountId)360 InteractionOperationDeathRecipient(int32_t windowId, int32_t accountId) : windowId_(windowId), 361 accountId_(accountId) {}; InteractionOperationDeathRecipient(int32_t windowId,int32_t treeId,int32_t accountId)362 InteractionOperationDeathRecipient(int32_t windowId, int32_t treeId, int32_t accountId) : windowId_(windowId), 363 treeId_(treeId), accountId_(accountId) {}; 364 ~InteractionOperationDeathRecipient() final = default; 365 DISALLOW_COPY_AND_MOVE(InteractionOperationDeathRecipient); 366 367 void OnRemoteDied(const wptr<IRemoteObject> &remote) final; 368 int32_t windowId_ = INVALID_WINDOW_ID; 369 int32_t treeId_ = INVALID_TREE_ID; 370 int32_t accountId_ = 0; 371 }; 372 373 class CaptionPropertyCallbackDeathRecipient final : public IRemoteObject::DeathRecipient { 374 public: 375 CaptionPropertyCallbackDeathRecipient() = default; 376 ~CaptionPropertyCallbackDeathRecipient() final = default; 377 DISALLOW_COPY_AND_MOVE(CaptionPropertyCallbackDeathRecipient); 378 379 void OnRemoteDied(const wptr<IRemoteObject> &remote) final; 380 }; 381 382 class EnableAbilityListsObserverDeathRecipient final : public IRemoteObject::DeathRecipient { 383 public: 384 EnableAbilityListsObserverDeathRecipient() = default; 385 ~EnableAbilityListsObserverDeathRecipient() final = default; 386 DISALLOW_COPY_AND_MOVE(EnableAbilityListsObserverDeathRecipient); 387 388 void OnRemoteDied(const wptr<IRemoteObject> &remote) final; 389 }; 390 391 bool Init(); 392 void InitInnerResource(); 393 394 class ConfigCallbackDeathRecipient final : public IRemoteObject::DeathRecipient { 395 public: 396 ConfigCallbackDeathRecipient() = default; 397 ~ConfigCallbackDeathRecipient() final = default; 398 DISALLOW_COPY_AND_MOVE(ConfigCallbackDeathRecipient); 399 400 void OnRemoteDied(const wptr<IRemoteObject> &remote) final; 401 }; 402 403 class BundleManagerDeathRecipient final : public IRemoteObject::DeathRecipient { 404 public: 405 BundleManagerDeathRecipient() = default; 406 ~BundleManagerDeathRecipient() final = default; 407 DISALLOW_COPY_AND_MOVE(BundleManagerDeathRecipient); 408 409 void OnRemoteDied(const wptr<IRemoteObject> &remote) final; 410 }; 411 412 class StateObservers { 413 public: 414 StateObservers() = default; 415 ~StateObservers() = default; 416 void AddStateObserver(const sptr<IAccessibleAbilityManagerStateObserver>& stateObserver); 417 void OnStateObservers(uint32_t state); 418 void RemoveStateObserver(const wptr<IRemoteObject>& remote); 419 void Clear(); 420 private: 421 std::vector<sptr<IAccessibleAbilityManagerStateObserver>> observersList_; 422 ffrt::mutex stateObserversMutex_; 423 }; 424 425 RetError InnerEnableAbility(const std::string &name, const uint32_t capabilities); 426 RetError InnerDisableAbility(const std::string &name); 427 428 sptr<AccessibilityWindowConnection> GetAccessibilityWindowConnection(int32_t windowId); 429 void ClearFocus(int32_t windowId); 430 void OutsideTouch(int32_t windowId); 431 void UpdateAccessibilityWindowStateByEvent(const AccessibilityEventInfo &event); 432 433 void UpdateAccessibilityState(); 434 void UpdateCaptionProperty(); 435 void UpdateSettingsInAtoHosTask(); 436 void UpdateSettingsInAtoHos(); 437 void UpdateAutoStartAbilities(); 438 void UpdateAllSetting(); 439 440 void RemoveCallback(CallBackID callback, const sptr<DeathRecipient> &recipient, const wptr<IRemoteObject> &remote); 441 void RemoveSavedConfigCallback(const wptr<IRemoteObject>& callback); 442 void OnBundleManagerDied(const wptr<IRemoteObject> &remote); 443 void DeleteConnectionAndDeathRecipient( 444 const int32_t windowId, const sptr<AccessibilityWindowConnection> &connection); 445 446 void OnDeviceProvisioned(); 447 void InitializeShortKeyState(); 448 void RegisterProvisionCallback(); 449 void RegisterShortKeyEvent(); 450 bool IsNeedUnload(); 451 void OffZoomGesture(); 452 void OnScreenMagnificationStateChanged(); 453 void RegisterScreenMagnificationState(); 454 void OnScreenMagnificationTypeChanged(); 455 void RegisterScreenMagnificationType(); 456 457 int32_t ApplyTreeId(); 458 void RecycleTreeId(int32_t treeId); 459 460 bool isReady_ = false; 461 bool isPublished_ = false; 462 std::map<int32_t, bool> dependentServicesStatus_; 463 int32_t currentAccountId_ = -1; 464 AccessibilityAccountDataMap a11yAccountsData_; 465 sptr<AppExecFwk::IBundleMgr> bundleManager_ = nullptr; 466 467 sptr<AccessibilityInputInterceptor> inputInterceptor_ = nullptr; 468 sptr<TouchEventInjector> touchEventInjector_ = nullptr; 469 sptr<KeyEventFilter> keyEventFilter_ = nullptr; 470 sptr<AccessibilityDumper> accessibilityDumper_ = nullptr; 471 472 std::shared_ptr<AppExecFwk::EventRunner> runner_; 473 std::shared_ptr<AAMSEventHandler> handler_; 474 475 std::shared_ptr<AppExecFwk::EventRunner> actionRunner_; 476 std::shared_ptr<AAMSEventHandler> actionHandler_; 477 478 std::shared_ptr<AppExecFwk::EventRunner> sendEventRunner_; 479 std::shared_ptr<AAMSEventHandler> sendEventHandler_; 480 481 std::shared_ptr<AppExecFwk::EventRunner> inputManagerRunner_; 482 std::shared_ptr<AppExecFwk::EventRunner> gestureRunner_; 483 484 std::shared_ptr<AppExecFwk::EventRunner> channelRunner_; 485 std::shared_ptr<AAMSEventHandler> channelHandler_; 486 487 std::shared_ptr<AppExecFwk::EventRunner> hoverEnterRunner_; 488 std::shared_ptr<AAMSEventHandler> hoverEnterHandler_; 489 490 std::shared_ptr<AppExecFwk::EventRunner> registerRunner_; 491 std::shared_ptr<AAMSEventHandler> registerHandler_; 492 493 int64_t ipcTimeoutNum_ = 0; // count ipc timeout number 494 495 sptr<IRemoteObject::DeathRecipient> stateObserversDeathRecipient_ = nullptr; 496 std::map<int32_t, sptr<IRemoteObject::DeathRecipient>> interactionOperationDeathRecipients_ {}; 497 std::map<int32_t, std::map<int32_t, sptr<IRemoteObject::DeathRecipient>>> interactionOperationDeathMap_ {}; 498 sptr<IRemoteObject::DeathRecipient> captionPropertyCallbackDeathRecipient_ = nullptr; 499 sptr<IRemoteObject::DeathRecipient> enableAbilityListsObserverDeathRecipient_ = nullptr; 500 sptr<IRemoteObject::DeathRecipient> configCallbackDeathRecipient_ = nullptr; 501 sptr<IRemoteObject::DeathRecipient> bundleManagerDeathRecipient_ = nullptr; 502 StateObservers stateObservers_; 503 ffrt::mutex mutex_; // current used for register state observer 504 std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> defaultConfigCallbacks_; 505 std::shared_ptr<AccessibilitySettings> accessibilitySettings_ = nullptr; 506 std::shared_ptr<AccessibilityShortKey> accessibilityShortKey_ = nullptr; 507 std::vector<std::string> removedAutoStartAbilities_ {}; 508 SafeMap<int32_t, AccessibilityEventInfo> windowFocusEventMap_ {}; 509 510 std::map<int32_t, std::map<int32_t, std::set<int32_t>>> windowRequestIdMap_ {}; // windowId->treeId->requestId 511 std::map<int32_t, sptr<IAccessibilityElementOperatorCallback>> requestIdMap_ {}; // requestId->callback 512 513 std::bitset<TREE_ID_MAX> treeIdPool_; 514 int32_t preTreeId_ = -1; 515 ffrt::mutex treeIdPoolMutex_; 516 }; 517 } // namespace Accessibility 518 } // namespace OHOS 519 #endif // ACCESSIBLE_ABILITY_MANAGER_SERVICE_H