* GirishAshok Joshi <girish.joshi@samsung.com>
* DoHyun Pyun <dh79.pyun@samsung.com>
*
-* Licensed under the Flora License, Version 1.0 (the "License");
+* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
#include <aul.h>
#include <notification.h>
#include <dpm/restriction.h>
-#ifndef TIZEN_PROFILE_TV
+
+// #ifndef TIZEN_PROFILE_TV
#include <contacts.h>
#include <dirent.h>
#include <fcntl.h>
-#endif
+// #endif
+
+#include <stdlib.h>
+#include <system_info.h>
#include "bt-main-ug.h"
#include "bt-util.h"
{
FN_START;
-#ifdef TIZEN_COMMON
- return FALSE;
-#endif
-
int value = 0;
int charging = 0;
+ if (TIZEN_COMMON)
+ return FALSE;
+
if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, (void *)&charging))
BT_ERR("Get the battery charging status fail");
case BT_HID_CONNECTED:
profile = BT_PROFILE_HID;
break;
-#ifdef TIZEN_FEATURE_BT_HOG
case BT_LE_HID_CONNECTED:
- profile = BT_PROFILE_GATT;
- break;
-#endif
+ if (TIZEN_FEATURE_BT_HOG) {
+ profile = BT_PROFILE_GATT;
+ break;
+ } else {
+ goto _default_;
+ }
case BT_NETWORK_CONNECTED:
profile = BT_PROFILE_NAP;
break;
case BT_NETWORK_SERVER_CONNECTED:
profile = BT_PROFILE_NAP_SERVER;
break;
+_default_:
default:
BT_ERR("Unknown type!");
return FALSE;
goto done;
}
-#ifdef TIZEN_FEATURE_BT_HOG
/* TODO : other GATT device scenario should be considered.
In this case, only HOG device scenario is considered. */
- if (dev->is_le_device) {
+ if (TIZEN_FEATURE_BT_HOG && dev->is_le_device) {
connected = _bt_util_is_profile_connected(BT_LE_HID_CONNECTED,
dev->bd_addr);
if (connected)
goto done;
}
-#endif
FN_END;
done:
ugd = (bt_ug_data *)ug_data;
- ret = dpm_context_remove_policy_changed_cb(ugd->dpm_handle, ugd->dpm_callback_id);
+ ret = dpm_remove_policy_changed_cb(ugd->dpm_handle, ugd->dpm_callback_id);
if (ret != DPM_ERROR_NONE)
BT_ERR("Fail to remove callback [%d]", ret);
return (dpm_state == 0) ? TRUE : FALSE;
}
-#ifndef TIZEN_PROFILE_TV
static bool __bt_util_file_exists(const char *file)
{
bool res = false;
}
size_left = strlen(vcard_buff);
- while (size_left) {
+ while (size_left > 0) {
int written = write(fd, vcard_buff, size_left);
if (written == -1) {
BT_ERR("write() failed: %d", errno);
bool ok = false;
int ret;
+ if (TIZEN_PROFILE_TV)
+ return 0;
+
BT_DBG("id = %i my_profile = %d", id, my_profile);
ret = contacts_connect();
else
contacts_record_get_str_p(record, _contacts_person.display_name, &display_name);
+ (void) display_name; /* Ignore unused variable for dummy contacts.h */
+
vcard_path = __bt_util_make_vcard_file_path(working_dir, "Contact");
if (!vcard_path) {
BT_ERR("_make_vcard_file_path() failed");
bool ok = false;
int ret;
+ if (TIZEN_PROFILE_TV)
+ return 0;
+
if (!id_list || count <= 0)
return NULL;
return vcard_path;
}
-#endif
+
+tizen_profile_t _get_tizen_profile()
+{
+ static tizen_profile_t profile = _PROFILE_UNKNOWN;
+ char *profileName;
+
+ if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+ return profile;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = _PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = _PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = _PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = _PROFILE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = _PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
+}