4 * Copyright (c) 2012 - 2017 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __CAL_SERVER_PROFLIE_H__
21 #define __CAL_SERVER_PROFLIE_H__
25 #endif /* __cplusplus */
28 #include <system_info.h>
32 _PROFILE_MOBILE = 0x1,
33 _PROFILE_WEARABLE = 0x2,
36 _PROFILE_COMMON = 0x10,
39 /* For optimization, make this extern and define in a shared C file */
40 extern tizen_profile_t profile;
42 /* Accessing system info */
43 int system_info_get_platform_string(const char *key, char **value);
45 static inline tizen_profile_t get_tizen_profile()
47 char *profileName = NULL;
49 if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
52 system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
54 /* To pass the checking of g_ir */
56 return _PROFILE_UNKNOWN;
58 switch (*profileName) {
61 profile = _PROFILE_MOBILE;
65 profile = _PROFILE_WEARABLE;
69 profile = _PROFILE_TV;
73 profile = _PROFILE_IVI;
75 default: // common or unknown ==> ALL ARE COMMON.
76 profile = _PROFILE_COMMON;
82 #define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)
83 #define TIZEN_PROFILE_IVI (get_tizen_profile() == _PROFILE_IVI)
84 #define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
85 #define TIZEN_PROFILE_MOBILE (get_tizen_profile() == _PROFILE_MOBILE)
87 #define TIZEN_FEATURE_NETWORK_TETHERING_ENABLE (get_tizen_profile() & (_PROFILE_MOBILE))
88 #define TIZEN_FEATURE_TELEPHONY_ENABLED (get_tizen_profile() & (_PROFILE_MOBILE))
89 #define TIZEN_FEATURE_FLIGHTMODE_ENABLED (get_tizen_profile() & (_PROFILE_MOBILE | _PROFILE_WEARABLE))
90 #define TIZEN_FEATURE_BT_USB_DONGLE (get_tizen_profile() & (_PROFILE_TV))
94 #endif /* __cplusplus */
96 #endif /* __CAL_SERVER_PROFLIE_H__ */