2 * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 #include "sstt_mock.h"
24 static bool sstm_system_info_get_platform_string_enable = true;
25 static bool sstm_system_info_get_platform_bool_enable = true;
27 API void sstm_system_info_get_platform_string_setup(bool enable)
29 sstm_system_info_get_platform_string_enable = enable;
32 API void sstm_system_info_get_platform_bool_setup(bool enable)
34 sstm_system_info_get_platform_bool_enable = enable;
37 API int system_info_get_platform_bool(const char *key, bool *value)
39 if (false == sstm_system_info_get_platform_bool_enable)
40 return TIZEN_ERROR_IO_ERROR;
42 if (0 == strcmp(key, "tizen.org/feature/systemsetting.font")) {
46 if (0 == strcmp(key, "tizen.org/feature/systemsetting.incoming_call")) {
50 if (0 == strcmp(key, "tizen.org/feature/systemsetting.home_screen")) {
54 if (0 == strcmp(key, "tizen.org/feature/systemsetting.lock_screen")) {
58 if (0 == strcmp(key, "tizen.org/feature/systemsetting.notification_email")) {
62 if (0 == strcmp(key, "tizen.org/feature/network.wifi")) {
66 if (0 == strcmp(key, "tizen.org/feature/network.telephony")) {
70 if (0 == strcmp(key, "tizen.org/feature/accessibility.grayscale")) {
74 if (0 == strcmp(key, "tizen.org/feature/accessibility.negative")) {
78 if (0 == strcmp(key, "tizen.org/feature/input.rotating_bezel")) {
83 int (*fn_org)(const char *, bool *) = NULL;
84 fn_org = dlsym(RTLD_NEXT, "system_info_get_platform_bool");
85 return fn_org(key, value);
88 API int system_info_get_platform_string(const char *key, char **value)
90 if (false == sstm_system_info_get_platform_string_enable)
91 return TIZEN_ERROR_IO_ERROR;
93 if (0 == strcmp(key, "tizen.org/feature/profile")) {
94 *value = strdup("wearable");
98 int (*fn_org)(const char *, char **) = NULL;
99 fn_org = dlsym(RTLD_NEXT, "system_info_get_platform_string");
100 return fn_org(key, value);