#include <gio/giotypes.h>
#include <efl_util.h>
#include <Ecore_Wl2.h>
+#include <system_info.h>
#include "bt-syspopup-m.h"
static void __popup_terminate(void);
+typedef enum {
+ _PROFILE_UNKNOWN = 0,
+ _PROFILE_MOBILE = 0x1,
+ _PROFILE_WEARABLE = 0x2,
+ _PROFILE_TV = 0x4,
+ _PROFILE_IVI = 0x8,
+ _PROFILE_IOT = 0x10,
+ _PROFILE_COMMON = 0x20,
+} tizen_profile_t;
+
+typedef enum {
+ _MODEL_UNKNOWN = 0,
+ _MODEL_COMMON = 0x1,
+ _MODEL_FHUB = 0x2,
+ _MODEL_DA = 0x4,
+} tizen_model_t;
+
+extern tizen_profile_t _get_tizen_profile();
+extern tizen_profile_t profile;
+
+extern tizen_model_t _get_tizen_model();
+extern tizen_model_t model;
+
+#define TIZEN_PROFILE_(x) (((__builtin_expect(profile != _PROFILE_UNKNOWN, 1)) ? \
+ (profile) : _get_tizen_profile()) \
+ & (x))
+
+#define TIZEN_MODEL_(x) (((__builtin_expect(model != _MODEL_UNKNOWN, 1)) ? \
+ (model) : _get_tizen_model()) \
+ & (x))
+
+#define TIZEN_FEATURE_FHUB_REFERENCE TIZEN_MODEL_(_MODEL_FHUB)
+
+tizen_profile_t profile = _PROFILE_UNKNOWN;
+tizen_profile_t _get_tizen_profile()
+{
+ char *profileName = NULL;
+
+ if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+ return profile;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ if (!profileName)
+ return _PROFILE_UNKNOWN;
+
+ 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':
+ if (!strncasecmp(profileName, "ivi", 3))
+ profile = _PROFILE_IVI;
+ else if (!strncasecmp(profileName, "iot", 3))
+ profile = _PROFILE_IOT;
+ else
+ profile = _PROFILE_COMMON;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = _PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
+}
+
+tizen_model_t model = _MODEL_UNKNOWN;
+tizen_model_t _get_tizen_model(void)
+{
+ char *model_name = NULL;
+
+ if (__builtin_expect(model != _MODEL_UNKNOWN, 1))
+ return model;
+
+ system_info_get_platform_string("http://tizen.org/system/model_name", &model_name);
+
+ if (model_name == NULL) {
+ model = _MODEL_COMMON;
+ return model;
+ }
+
+ if (!strncasecmp(model_name, "Family Hub", 10))
+ model = _MODEL_FHUB;
+ else if (!strcasecmp(model_name, "Robot Vacuum Cleaner") ||
+ !strcasecmp(model_name, "Smart Dryer") ||
+ !strcasecmp(model_name, "Smart Washer") ||
+ !strcasecmp(model_name, "DDMS") ||
+ !strcasecmp(model_name, "Smart Cooktop") ||
+ !strcasecmp(model_name, "Smart Range") ||
+ !strcasecmp(model_name, "Refrigerator") ||
+ !strcasecmp(model_name, "Echo Heating System Controller") ||
+ !strcasecmp(model_name, "Bespoke Washer") ||
+ !strcasecmp(model_name, "Bespoke Dryer") ||
+ !strcasecmp(model_name, "Appliance Emulator") ||
+ !strcasecmp(model_name, "AI Hub Smart EHS"))
+ model = _MODEL_DA;
+ else
+ model = _MODEL_COMMON;
+
+ free(model_name);
+
+ return model;
+}
+
static char *format_string(const char *format, ...)
{
va_list arg;
BT_DBG("__bluetooth_draw_popup");
ad->popup = elm_popup_add(ad->layout);
- elm_popup_align_set(ad->popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+ if (!TIZEN_FEATURE_FHUB_REFERENCE)
+ elm_popup_align_set(ad->popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
/*set window level to HIGH*/
__bluetooth_set_win_level(ad->win_main);
ret_if(!wl_win);
ecore_wl2_window_type_set(wl_win, ECORE_WL2_WINDOW_TYPE_NOTIFICATION);
- efl_util_set_notification_window_level(parent, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+ if (TIZEN_FEATURE_FHUB_REFERENCE)
+ efl_util_set_notification_window_level(parent, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+ else
+ efl_util_set_notification_window_level(parent, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
}
static Evas_Object *__bluetooth_create_win(const char *name)
{
Evas_Object *eo;
+
+ if (TIZEN_FEATURE_FHUB_REFERENCE)
+ elm_config_accel_preference_set("gl");
+
eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
retv_if(!eo, NULL);