1885b47fbSopenharmony_ci/*
2885b47fbSopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
3885b47fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4885b47fbSopenharmony_ci * you may not use this file except in compliance with the License.
5885b47fbSopenharmony_ci * You may obtain a copy of the License at
6885b47fbSopenharmony_ci *
7885b47fbSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8885b47fbSopenharmony_ci *
9885b47fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10885b47fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11885b47fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12885b47fbSopenharmony_ci * See the License for the specific language governing permissions and
13885b47fbSopenharmony_ci * limitations under the License.
14885b47fbSopenharmony_ci */
15885b47fbSopenharmony_ci#ifndef ACCESSIBILITY_ACCOUNT_DATA_H
16885b47fbSopenharmony_ci#define ACCESSIBILITY_ACCOUNT_DATA_H
17885b47fbSopenharmony_ci
18885b47fbSopenharmony_ci#include <map>
19885b47fbSopenharmony_ci#include <set>
20885b47fbSopenharmony_ci#include <string>
21885b47fbSopenharmony_ci#include <vector>
22885b47fbSopenharmony_ci
23885b47fbSopenharmony_ci#include "accessibility_caption.h"
24885b47fbSopenharmony_ci#include "i_accessibility_enable_ability_lists_observer.h"
25885b47fbSopenharmony_ci#include "accessibility_settings_config.h"
26885b47fbSopenharmony_ci#include "accessibility_window_connection.h"
27885b47fbSopenharmony_ci#include "accessible_ability_connection.h"
28885b47fbSopenharmony_ci#include "i_accessible_ability_manager_caption_observer.h"
29885b47fbSopenharmony_ci#include "i_accessible_ability_manager_config_observer.h"
30885b47fbSopenharmony_ci#include "i_accessible_ability_manager_state_observer.h"
31885b47fbSopenharmony_ci#include "element_name.h"
32885b47fbSopenharmony_ci#include "accessibility_setting_provider.h"
33885b47fbSopenharmony_ci#include "os_account_info.h"
34885b47fbSopenharmony_ci
35885b47fbSopenharmony_cinamespace OHOS {
36885b47fbSopenharmony_cinamespace Accessibility {
37885b47fbSopenharmony_ciusing CaptionPropertyCallbacks = std::vector<sptr<IAccessibleAbilityManagerCaptionObserver>>;
38885b47fbSopenharmony_ciclass AccessibleAbilityConnection;
39885b47fbSopenharmony_ciclass AccessibilityWindowConnection;
40885b47fbSopenharmony_ci
41885b47fbSopenharmony_cistruct ConfigValueAtoHosUpdate {
42885b47fbSopenharmony_ci    bool highContrastText = false;
43885b47fbSopenharmony_ci    bool invertColor = false;
44885b47fbSopenharmony_ci    bool audioMono = false;
45885b47fbSopenharmony_ci    bool daltonizationState = false;
46885b47fbSopenharmony_ci    float audioBalance = 0.0;
47885b47fbSopenharmony_ci    bool isScreenReaderEnabled = false;
48885b47fbSopenharmony_ci    int clickResponseTime = 0;
49885b47fbSopenharmony_ci    bool ignoreRepeatClickState = false;
50885b47fbSopenharmony_ci    int ignoreRepeatClickTime = 0;
51885b47fbSopenharmony_ci    int displayDaltonizer = 0;
52885b47fbSopenharmony_ci    bool shortcutEnabled = false;
53885b47fbSopenharmony_ci    int shortcutEnabledOnLockScreen = 0;
54885b47fbSopenharmony_ci    int shortcutOnLockScreen = 0;
55885b47fbSopenharmony_ci    int shortcutTimeout = 0;
56885b47fbSopenharmony_ci    bool screenMagnificationState = false;
57885b47fbSopenharmony_ci};
58885b47fbSopenharmony_ci
59885b47fbSopenharmony_ciclass AccessibilityAccountData final : public RefBase {
60885b47fbSopenharmony_cipublic:
61885b47fbSopenharmony_ci    AccessibilityAccountData(int32_t accountId);
62885b47fbSopenharmony_ci    ~AccessibilityAccountData();
63885b47fbSopenharmony_ci
64885b47fbSopenharmony_ci    /**
65885b47fbSopenharmony_ci     * @brief Get the ID of the account.
66885b47fbSopenharmony_ci     * @return Returns accountId.
67885b47fbSopenharmony_ci     */
68885b47fbSopenharmony_ci    int32_t GetAccountId();
69885b47fbSopenharmony_ci
70885b47fbSopenharmony_ci    /**
71885b47fbSopenharmony_ci     * @brief Get Accessibility state.
72885b47fbSopenharmony_ci     * @return returns whether accessibility is connected and whether can touch browse.
73885b47fbSopenharmony_ci     */
74885b47fbSopenharmony_ci    uint32_t GetAccessibilityState();
75885b47fbSopenharmony_ci
76885b47fbSopenharmony_ci    /**
77885b47fbSopenharmony_ci     * @brief Switch users and clear old user data.
78885b47fbSopenharmony_ci     */
79885b47fbSopenharmony_ci    void OnAccountSwitched();
80885b47fbSopenharmony_ci
81885b47fbSopenharmony_ci    /**
82885b47fbSopenharmony_ci     * @brief Add connected accessibility services.
83885b47fbSopenharmony_ci     * @param connection Accessible ability connection.
84885b47fbSopenharmony_ci     */
85885b47fbSopenharmony_ci    void AddConnectedAbility(sptr<AccessibleAbilityConnection>& connection);
86885b47fbSopenharmony_ci
87885b47fbSopenharmony_ci    /**
88885b47fbSopenharmony_ci     * @brief Remove connected accessibility services.
89885b47fbSopenharmony_ci     * @param element The element name of ability.
90885b47fbSopenharmony_ci     */
91885b47fbSopenharmony_ci    void RemoveConnectedAbility(const AppExecFwk::ElementName &element);
92885b47fbSopenharmony_ci
93885b47fbSopenharmony_ci    /**
94885b47fbSopenharmony_ci     * @brief Remove connecting accessibility services.
95885b47fbSopenharmony_ci     * @param uri bundle name + / + ability name.
96885b47fbSopenharmony_ci     */
97885b47fbSopenharmony_ci    void RemoveConnectingA11yAbility(const std::string &uri);
98885b47fbSopenharmony_ci
99885b47fbSopenharmony_ci    void AddCaptionPropertyCallback(const sptr<IAccessibleAbilityManagerCaptionObserver>& callback);
100885b47fbSopenharmony_ci    void RemoveCaptionPropertyCallback(const wptr<IRemoteObject>& callback);
101885b47fbSopenharmony_ci
102885b47fbSopenharmony_ci    void AddEnableAbilityListsObserver(const sptr<IAccessibilityEnableAbilityListsObserver>& observer);
103885b47fbSopenharmony_ci    void RemoveEnableAbilityListsObserver(const wptr<IRemoteObject>& observer);
104885b47fbSopenharmony_ci
105885b47fbSopenharmony_ci    /**
106885b47fbSopenharmony_ci     * @brief Add interface operation interactive connection.
107885b47fbSopenharmony_ci     * @param windowId Interface operation interactive connection the
108885b47fbSopenharmony_ci     * corresponding window id.
109885b47fbSopenharmony_ci     * @param interactionConnection Interface interface operation
110885b47fbSopenharmony_ci     * interactive connection.
111885b47fbSopenharmony_ci     */
112885b47fbSopenharmony_ci    void AddAccessibilityWindowConnection(
113885b47fbSopenharmony_ci        const int32_t windowId, const sptr<AccessibilityWindowConnection>& interactionConnection);
114885b47fbSopenharmony_ci
115885b47fbSopenharmony_ci    /**
116885b47fbSopenharmony_ci     * @brief Remove interface operation interactive connection.
117885b47fbSopenharmony_ci     * @param windowId Interface operation interactive connection the corresponding window id.
118885b47fbSopenharmony_ci     */
119885b47fbSopenharmony_ci    void RemoveAccessibilityWindowConnection(const int32_t windowId);
120885b47fbSopenharmony_ci
121885b47fbSopenharmony_ci    /**
122885b47fbSopenharmony_ci     * @brief Add connecting accessibility.
123885b47fbSopenharmony_ci     * @param uri The uri of ability
124885b47fbSopenharmony_ci     * @param connection The connection of ability
125885b47fbSopenharmony_ci     */
126885b47fbSopenharmony_ci    void AddConnectingA11yAbility(const std::string &uri, const sptr<AccessibleAbilityConnection> &connection);
127885b47fbSopenharmony_ci
128885b47fbSopenharmony_ci    void AddEnabledAbility(const std::string &name); // For UT
129885b47fbSopenharmony_ci
130885b47fbSopenharmony_ci    /**
131885b47fbSopenharmony_ci     * @brief Remove accessibility that have been opened.
132885b47fbSopenharmony_ci     * @param name bundle name + / + ability name.
133885b47fbSopenharmony_ci     * @return return true if removes enabled ability successfully, otherwise refer to the RetError for the failure.
134885b47fbSopenharmony_ci     */
135885b47fbSopenharmony_ci    RetError RemoveEnabledAbility(const std::string &name);
136885b47fbSopenharmony_ci
137885b47fbSopenharmony_ci    void AddInstalledAbility(AccessibilityAbilityInfo& abilityInfo); // For UT
138885b47fbSopenharmony_ci
139885b47fbSopenharmony_ci    /**
140885b47fbSopenharmony_ci     * @brief Empty installed accessibility list.
141885b47fbSopenharmony_ci     * @param abilityInfo Accessibility ability info.
142885b47fbSopenharmony_ci     */
143885b47fbSopenharmony_ci    void RemoveInstalledAbility(const std::string &bundleName);
144885b47fbSopenharmony_ci
145885b47fbSopenharmony_ci    /**
146885b47fbSopenharmony_ci     * @brief The real procedure for add connecting ability.
147885b47fbSopenharmony_ci     */
148885b47fbSopenharmony_ci    void ClearInstalledAbility();
149885b47fbSopenharmony_ci
150885b47fbSopenharmony_ci    /**
151885b47fbSopenharmony_ci     * @brief Get connected accessibility list.
152885b47fbSopenharmony_ci     * @return Store map of connected accessibility abilities.
153885b47fbSopenharmony_ci     */
154885b47fbSopenharmony_ci    const std::map<std::string, sptr<AccessibleAbilityConnection>> GetConnectedA11yAbilities();
155885b47fbSopenharmony_ci
156885b47fbSopenharmony_ci    const CaptionPropertyCallbacks GetCaptionPropertyCallbacks();
157885b47fbSopenharmony_ci
158885b47fbSopenharmony_ci    /**
159885b47fbSopenharmony_ci     * @brief Get interface operation interactive connection list.
160885b47fbSopenharmony_ci     * @return Store map of interface operation interactive connection.
161885b47fbSopenharmony_ci     */
162885b47fbSopenharmony_ci    const std::map<int32_t, sptr<AccessibilityWindowConnection>> GetAsacConnections();
163885b47fbSopenharmony_ci
164885b47fbSopenharmony_ci    /**
165885b47fbSopenharmony_ci     * @brief Query accessible ability connection through elementName URI.
166885b47fbSopenharmony_ci     * @param elementName Accessibility elementName URI
167885b47fbSopenharmony_ci     * @return Accessible ability connection corresponding to elementName URI.
168885b47fbSopenharmony_ci     */
169885b47fbSopenharmony_ci    const sptr<AccessibleAbilityConnection> GetAccessibleAbilityConnection(const std::string &elementName);
170885b47fbSopenharmony_ci
171885b47fbSopenharmony_ci    /**
172885b47fbSopenharmony_ci     * @brief Query interface operation interactive connection through window id.
173885b47fbSopenharmony_ci     * @param windowId Interface operation interactive connection the corresponding window id.
174885b47fbSopenharmony_ci     * @return Interface operation interactive connection corresponding to window id.
175885b47fbSopenharmony_ci     */
176885b47fbSopenharmony_ci    const sptr<AccessibilityWindowConnection> GetAccessibilityWindowConnection(const int32_t windowId);
177885b47fbSopenharmony_ci
178885b47fbSopenharmony_ci    /**
179885b47fbSopenharmony_ci     * @brief Get connecting ability of specified uri.
180885b47fbSopenharmony_ci     * @param uri The name of ability.
181885b47fbSopenharmony_ci     * @return Strong point of connecting ability.
182885b47fbSopenharmony_ci     */
183885b47fbSopenharmony_ci    sptr<AccessibleAbilityConnection> GetConnectingA11yAbility(const std::string &uri);
184885b47fbSopenharmony_ci
185885b47fbSopenharmony_ci    /**
186885b47fbSopenharmony_ci     * @brief Get the accessibility ability info of the corresponding state according to the
187885b47fbSopenharmony_ci     *        ability state type.
188885b47fbSopenharmony_ci     * @param state Ability state type.
189885b47fbSopenharmony_ci     */
190885b47fbSopenharmony_ci    void GetAbilitiesByState(AbilityStateType state, std::vector<AccessibilityAbilityInfo> &abilities);
191885b47fbSopenharmony_ci
192885b47fbSopenharmony_ci    /**
193885b47fbSopenharmony_ci     * @brief Get the accessibility ability info of the disabled ability.
194885b47fbSopenharmony_ci     */
195885b47fbSopenharmony_ci    void GetDisableAbilities(std::vector<AccessibilityAbilityInfo> &disabledAbilities);
196885b47fbSopenharmony_ci
197885b47fbSopenharmony_ci    /**
198885b47fbSopenharmony_ci     * @brief Get enable accessibility list.
199885b47fbSopenharmony_ci     * @return Store map of enable accessibility abilities.
200885b47fbSopenharmony_ci     */
201885b47fbSopenharmony_ci    const std::vector<std::string> &GetEnabledAbilities();
202885b47fbSopenharmony_ci
203885b47fbSopenharmony_ci    /**
204885b47fbSopenharmony_ci     * @brief Get install accessibility list.
205885b47fbSopenharmony_ci     * @return Store vector of install accessibility abilities.
206885b47fbSopenharmony_ci     */
207885b47fbSopenharmony_ci    const std::vector<AccessibilityAbilityInfo> &GetInstalledAbilities() const;
208885b47fbSopenharmony_ci
209885b47fbSopenharmony_ci    /**
210885b47fbSopenharmony_ci     * @brief Update user enabled accessibility capabilities.
211885b47fbSopenharmony_ci     */
212885b47fbSopenharmony_ci    void UpdateAccountCapabilities();
213885b47fbSopenharmony_ci
214885b47fbSopenharmony_ci    /**
215885b47fbSopenharmony_ci     * @brief Get flag with whether have zoom capability.
216885b47fbSopenharmony_ci     * @return isScreenMagnification_.
217885b47fbSopenharmony_ci     */
218885b47fbSopenharmony_ci    bool GetScreenMagnificationFlag()
219885b47fbSopenharmony_ci    {
220885b47fbSopenharmony_ci        return isScreenMagnification_;
221885b47fbSopenharmony_ci    }
222885b47fbSopenharmony_ci
223885b47fbSopenharmony_ci    /**
224885b47fbSopenharmony_ci     * @brief Get flag with whether have touch guide capability.
225885b47fbSopenharmony_ci     * @return isEventTouchGuideState_.
226885b47fbSopenharmony_ci     */
227885b47fbSopenharmony_ci    bool GetEventTouchGuideStateFlag()
228885b47fbSopenharmony_ci    {
229885b47fbSopenharmony_ci        return isEventTouchGuideState_;
230885b47fbSopenharmony_ci    }
231885b47fbSopenharmony_ci
232885b47fbSopenharmony_ci    /**
233885b47fbSopenharmony_ci     * @brief Get flag with whether have key event observer capability.
234885b47fbSopenharmony_ci     * @return isFilteringKeyEvents_.
235885b47fbSopenharmony_ci     */
236885b47fbSopenharmony_ci    bool GetFilteringKeyEventsFlag()
237885b47fbSopenharmony_ci    {
238885b47fbSopenharmony_ci        return isFilteringKeyEvents_;
239885b47fbSopenharmony_ci    }
240885b47fbSopenharmony_ci
241885b47fbSopenharmony_ci    /**
242885b47fbSopenharmony_ci     * @brief Get flag with whether have gesture capability.
243885b47fbSopenharmony_ci     * @return isGesturesSimulation_.
244885b47fbSopenharmony_ci     */
245885b47fbSopenharmony_ci    bool GetGesturesSimulationFlag()
246885b47fbSopenharmony_ci    {
247885b47fbSopenharmony_ci        return isGesturesSimulation_;
248885b47fbSopenharmony_ci    }
249885b47fbSopenharmony_ci    bool GetInstalledAbilitiesFromBMS();
250885b47fbSopenharmony_ci
251885b47fbSopenharmony_ci    std::shared_ptr<AccessibilitySettingsConfig> GetConfig();
252885b47fbSopenharmony_ci
253885b47fbSopenharmony_ci    RetError EnableAbility(const std::string &name, const uint32_t capabilities);
254885b47fbSopenharmony_ci
255885b47fbSopenharmony_ci    void SetScreenReaderState(const std::string &name, const std::string &state);
256885b47fbSopenharmony_ci    bool GetDefaultUserScreenReaderState();
257885b47fbSopenharmony_ci    AccountSA::OsAccountType GetAccountType();
258885b47fbSopenharmony_ci
259885b47fbSopenharmony_ci    void Init();
260885b47fbSopenharmony_ci
261885b47fbSopenharmony_ci    void UpdateEnableAbilityListsState();
262885b47fbSopenharmony_ci    void UpdateInstallAbilityListsState();
263885b47fbSopenharmony_ci
264885b47fbSopenharmony_ci    void AddConfigCallback(const sptr<IAccessibleAbilityManagerConfigObserver>& callback);
265885b47fbSopenharmony_ci    void RemoveConfigCallback(const wptr<IRemoteObject>& callback);
266885b47fbSopenharmony_ci    const std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> GetConfigCallbacks();
267885b47fbSopenharmony_ci    void SetConfigCallbacks(std::vector<sptr<IAccessibleAbilityManagerConfigObserver>>& observer);
268885b47fbSopenharmony_ci
269885b47fbSopenharmony_ci    void GetImportantEnabledAbilities(std::map<std::string, uint32_t> &importantEnabledAbilities) const;
270885b47fbSopenharmony_ci    void UpdateImportantEnabledAbilities(std::map<std::string, uint32_t> &importantEnabledAbilities);
271885b47fbSopenharmony_ci    void UpdateAutoStartEnabledAbilities();
272885b47fbSopenharmony_ci
273885b47fbSopenharmony_ci    uint32_t GetInputFilterFlag() const;
274885b47fbSopenharmony_ci    void UpdateAbilities();
275885b47fbSopenharmony_ci    bool RemoveAbility(const std::string &bundleName);
276885b47fbSopenharmony_ci    void AddAbility(const std::string &bundleName);
277885b47fbSopenharmony_ci    void ChangeAbility(const std::string &bundleName);
278885b47fbSopenharmony_ci
279885b47fbSopenharmony_ci    void AddUITestClient(const sptr<IRemoteObject> &obj,
280885b47fbSopenharmony_ci        const std::string &bundleName, const std::string &abilityName);
281885b47fbSopenharmony_ci    void RemoveUITestClient(sptr<AccessibleAbilityConnection> &connection, const std::string &bundleName);
282885b47fbSopenharmony_ci    void SetAbilityAutoStartState(const std::string &name, const bool state);
283885b47fbSopenharmony_ci    void SetScreenReaderExtInAllAccounts(const bool state);
284885b47fbSopenharmony_ci    void DelAutoStartPrefKeyInRemovePkg(const std::string &bundleName);
285885b47fbSopenharmony_ci    bool GetAbilityAutoStartState(const std::string &name);
286885b47fbSopenharmony_ci    void GetConfigValueAtoHos(ConfigValueAtoHosUpdate &value);
287885b47fbSopenharmony_ci
288885b47fbSopenharmony_ciprivate:
289885b47fbSopenharmony_ci    /**
290885b47fbSopenharmony_ci     * @brief Update connected accessibility whether have touch guide
291885b47fbSopenharmony_ci     * capability. Have touch guide capability isEventTouchGuideState_ is
292885b47fbSopenharmony_ci     * true, otherwise isEventTouchGuideState_ is false.
293885b47fbSopenharmony_ci     */
294885b47fbSopenharmony_ci    void UpdateEventTouchGuideCapability();
295885b47fbSopenharmony_ci
296885b47fbSopenharmony_ci    /**
297885b47fbSopenharmony_ci     * @brief Update connected accessibility whether have gesture capability.
298885b47fbSopenharmony_ci     *        Have gesture capability isGesturesSimulation_ is true,
299885b47fbSopenharmony_ci     *        otherwise isGesturesSimulation_ is false.
300885b47fbSopenharmony_ci     */
301885b47fbSopenharmony_ci    void UpdateGesturesSimulationCapability();
302885b47fbSopenharmony_ci
303885b47fbSopenharmony_ci    /**
304885b47fbSopenharmony_ci     * @brief Update connected accessibility whether have key event observer capability.
305885b47fbSopenharmony_ci     *        Have key event observer capability isFilteringKeyEvents_ is true,
306885b47fbSopenharmony_ci     *        otherwise isFilteringKeyEvents_ is false.
307885b47fbSopenharmony_ci     */
308885b47fbSopenharmony_ci    void UpdateFilteringKeyEventsCapability();
309885b47fbSopenharmony_ci
310885b47fbSopenharmony_ci    /**
311885b47fbSopenharmony_ci     * @brief Update connected accessibility whether have zoom capability.
312885b47fbSopenharmony_ci     *        Have zoom capability isScreenMagnification_ is true,
313885b47fbSopenharmony_ci     *        otherwise isScreenMagnification_ is false.
314885b47fbSopenharmony_ci     */
315885b47fbSopenharmony_ci    void UpdateMagnificationCapability();
316885b47fbSopenharmony_ci
317885b47fbSopenharmony_ci    class AccessibilityAbility {
318885b47fbSopenharmony_ci    public:
319885b47fbSopenharmony_ci        AccessibilityAbility() = default;
320885b47fbSopenharmony_ci        ~AccessibilityAbility() = default;
321885b47fbSopenharmony_ci        void AddAccessibilityAbility(const std::string& uri, const sptr<AccessibleAbilityConnection>& connection);
322885b47fbSopenharmony_ci        sptr<AccessibleAbilityConnection> GetAccessibilityAbilityByName(const std::string& elementName);
323885b47fbSopenharmony_ci        sptr<AccessibleAbilityConnection> GetAccessibilityAbilityByUri(const std::string& uri);
324885b47fbSopenharmony_ci        void GetAccessibilityAbilities(std::vector<sptr<AccessibleAbilityConnection>>& connectionList);
325885b47fbSopenharmony_ci        void GetAbilitiesInfo(std::vector<AccessibilityAbilityInfo>& abilities);
326885b47fbSopenharmony_ci        bool IsExistCapability(Capability capability);
327885b47fbSopenharmony_ci        void GetAccessibilityAbilitiesMap(std::map<std::string, sptr<AccessibleAbilityConnection>>& connectionMap);
328885b47fbSopenharmony_ci        void GetDisableAbilities(std::vector<AccessibilityAbilityInfo>& disabledAbilities);
329885b47fbSopenharmony_ci        int32_t GetSizeByUri(const std::string& uri);
330885b47fbSopenharmony_ci        void RemoveAccessibilityAbilityByName(const std::string& bundleName, bool& result);
331885b47fbSopenharmony_ci        void RemoveAccessibilityAbilityByUri(const std::string& uri);
332885b47fbSopenharmony_ci        void Clear();
333885b47fbSopenharmony_ci        size_t GetSize();
334885b47fbSopenharmony_ci    private:
335885b47fbSopenharmony_ci        std::map<std::string, sptr<AccessibleAbilityConnection>> connectionMap_;
336885b47fbSopenharmony_ci        ffrt::mutex mutex_;
337885b47fbSopenharmony_ci    };
338885b47fbSopenharmony_ci
339885b47fbSopenharmony_ci    int32_t id_;
340885b47fbSopenharmony_ci    AccountSA::OsAccountType accountType_ = AccountSA::OsAccountType::END;
341885b47fbSopenharmony_ci    bool isEventTouchGuideState_ = false;
342885b47fbSopenharmony_ci    bool isScreenMagnification_ = false;
343885b47fbSopenharmony_ci    bool isFilteringKeyEvents_ = false;
344885b47fbSopenharmony_ci    bool isGesturesSimulation_ = false;
345885b47fbSopenharmony_ci    std::string screenReaderAbilityName_ = "com.huawei.hmos.screenreader/AccessibilityExtAbility";
346885b47fbSopenharmony_ci    std::string screenReaderKey_ = "accessibility_screenreader_enabled";
347885b47fbSopenharmony_ci    uint32_t connectCounter_ = 1;
348885b47fbSopenharmony_ci    AccessibilityAbility connectedA11yAbilities_;  // key: bundleName/abilityName
349885b47fbSopenharmony_ci    AccessibilityAbility connectingA11yAbilities_;  // key: bundleName/abilityName
350885b47fbSopenharmony_ci    std::vector<sptr<IAccessibilityEnableAbilityListsObserver>> enableAbilityListsObservers_;
351885b47fbSopenharmony_ci    ffrt::mutex enableAbilityListObserversMutex_; // mutex for enableAbilityListsObservers_
352885b47fbSopenharmony_ci    std::map<int32_t, sptr<AccessibilityWindowConnection>> asacConnections_; // key: windowId
353885b47fbSopenharmony_ci    ffrt::mutex asacConnectionsMutex_; // mutex for map asacConnections_
354885b47fbSopenharmony_ci    CaptionPropertyCallbacks captionPropertyCallbacks_;
355885b47fbSopenharmony_ci    ffrt::mutex captionPropertyCallbacksMutex_; // mutex for captionPropertyCallbacks_
356885b47fbSopenharmony_ci    std::vector<AccessibilityAbilityInfo> installedAbilities_;
357885b47fbSopenharmony_ci    std::vector<std::string> enabledAbilities_; // bundleName/abilityName
358885b47fbSopenharmony_ci    std::vector<sptr<IAccessibleAbilityManagerConfigObserver>> configCallbacks_;
359885b47fbSopenharmony_ci    ffrt::mutex configCallbacksMutex_; // mutex for vector configCallbacks_
360885b47fbSopenharmony_ci    std::shared_ptr<AccessibilitySettingsConfig> config_ = nullptr;
361885b47fbSopenharmony_ci};
362885b47fbSopenharmony_ci
363885b47fbSopenharmony_ciclass AccessibilityAccountDataMap {
364885b47fbSopenharmony_cipublic:
365885b47fbSopenharmony_ci    AccessibilityAccountDataMap() = default;
366885b47fbSopenharmony_ci    ~AccessibilityAccountDataMap() = default;
367885b47fbSopenharmony_ci    sptr<AccessibilityAccountData> AddAccountData(int32_t accountId);
368885b47fbSopenharmony_ci    sptr<AccessibilityAccountData> GetCurrentAccountData(int32_t accountId);
369885b47fbSopenharmony_ci    sptr<AccessibilityAccountData> GetAccountData(int32_t accountId);
370885b47fbSopenharmony_ci    sptr<AccessibilityAccountData> RemoveAccountData(int32_t accountId);
371885b47fbSopenharmony_ci    std::vector<int32_t> GetAllAccountIds();
372885b47fbSopenharmony_ci    void Clear();
373885b47fbSopenharmony_ciprivate:
374885b47fbSopenharmony_ci    std::map<int32_t, sptr<AccessibilityAccountData>> accountDataMap_;
375885b47fbSopenharmony_ci    ffrt::mutex accountDataMutex_;
376885b47fbSopenharmony_ci};
377885b47fbSopenharmony_ci} // namespace Accessibility
378885b47fbSopenharmony_ci} // namespace OHOS
379885b47fbSopenharmony_ci#endif // ACCESSIBILITY_ACCOUNT_DATA_H