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#include "accessibility_setting_provider.h"
17#include "accessibility_datashare_helper.h"
18#include <gtest/gtest.h>
19
20namespace OHOS {
21namespace Accessibility {
22std::shared_ptr<AccessibilitySettingProvider> AccessibilitySettingProvider::instance_ = nullptr;
23ffrt::mutex AccessibilitySettingProvider::mutex_;
24namespace {
25    constexpr int32_t DEFAULT_ACCOUNT_ID = 100;
26} // namespace
27
28AccessibilitySettingProvider::AccessibilitySettingProvider()
29    : AccessibilityDatashareHelper(DATASHARE_TYPE::GLOBAL, DEFAULT_ACCOUNT_ID)
30{
31}
32
33AccessibilitySettingProvider::~AccessibilitySettingProvider()
34{
35    instance_ = nullptr;
36}
37
38std::shared_ptr<AccessibilitySettingProvider> AccessibilitySettingProvider::GetInstance(int32_t systemAbilityId)
39{
40    if (instance_ == nullptr) {
41        instance_ = std::make_shared<AccessibilitySettingProvider>();
42    }
43    return instance_;
44}
45
46void AccessibilitySettingProvider::DeleteInstance()
47{
48}
49
50RetError AccessibilitySettingProvider::GetIntValue(const std::string& key, int32_t& value)
51{
52    (void)key;
53    (void)value;
54    return RET_OK;
55}
56
57RetError AccessibilitySettingProvider::GetLongValue(const std::string& key, int64_t& value)
58{
59    (void)key;
60    (void)value;
61    return RET_OK;
62}
63
64RetError AccessibilitySettingProvider::GetBoolValue(const std::string& key, bool& value)
65{
66    (void)key;
67    (void)value;
68    return RET_OK;
69}
70
71RetError AccessibilitySettingProvider::GetFloatValue(const std::string& key, float& value)
72{
73    (void)key;
74    (void)value;
75    return RET_OK;
76}
77
78RetError AccessibilitySettingProvider::PutIntValue(const std::string& key, int32_t value, bool needNotify)
79{
80    (void)key;
81    (void)value;
82    (void)needNotify;
83    return RET_OK;
84}
85
86RetError AccessibilitySettingProvider::PutLongValue(const std::string& key, int64_t value, bool needNotify)
87{
88    (void)key;
89    (void)value;
90    (void)needNotify;
91    return RET_OK;
92}
93
94RetError AccessibilitySettingProvider::PutBoolValue(const std::string& key, bool value, bool needNotify)
95{
96    (void)key;
97    (void)value;
98    (void)needNotify;
99    return RET_OK;
100}
101
102sptr<AccessibilitySettingObserver> AccessibilitySettingProvider::CreateObserver(const std::string& key,
103    AccessibilitySettingObserver::UpdateFunc& func)
104{
105    (void)key;
106    (void)func;
107    return nullptr;
108}
109
110RetError AccessibilitySettingProvider::RegisterObserver(const std::string& key,
111    AccessibilitySettingObserver::UpdateFunc& func)
112{
113    (void)key;
114    (void)func;
115    return RET_OK;
116}
117
118RetError AccessibilitySettingProvider::UnregisterObserver(const std::string& key)
119{
120    (void)key;
121    return RET_OK;
122}
123
124RetError AccessibilitySettingProvider::GetStringValue(const std::string& key, std::string& value)
125{
126    (void)key;
127    (void)value;
128    return RET_OK;
129}
130
131RetError AccessibilitySettingProvider::PutStringValue
132    (const std::string& key, const std::string& value, bool needNotify)
133{
134    (void)key;
135    (void)value;
136    (void)needNotify;
137    return RET_OK;
138}
139} // namespace Accessibility
140} // namespace OHOS