*/
#include "heremaps-uc-common.h"
+#include <stdlib.h>
+#include <system_info.h>
#define EDJE_PATH "/usr/apps/org.tizen.heremaps-uc/res/edje/heremaps-uc.edj"
+typedef enum {
+ TIZEN_PROFILE_UNKNOWN = 0,
+ TIZEN_PROFILE_MOBILE = 0x1,
+ TIZEN_PROFILE_WEARABLE = 0x2,
+ TIZEN_PROFILE_TV = 0x4,
+ TIZEN_PROFILE_IVI = 0x8,
+ TIZEN_PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+
+static tizen_profile_t _get_tizen_profile()
+{
+ static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+ if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
+ return profile;
+
+ char *profileName;
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = TIZEN_PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = TIZEN_PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = TIZEN_PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = TIZEN_PROFILE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = TIZEN_PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
+}
+
static Evas_Object *create_conformant(Evas_Object * parent)
{
LS_FUNC_ENTER
}
}
-#ifndef TIZEN_WEARABLE
static void disagree_btn_cb(void *data, Evas_Object * obj, void *event)
{
LS_FUNC_ENTER
elm_exit();
}
-#endif
static void agree_btn_cb(void *data, Evas_Object * obj, void *event)
{
return eo;
}
-#ifdef TIZEN_WEARABLE
static Evas_Object *create_popup_wearable(Evas_Object *layout, heremaps_uc_app_data *ad)
{
LS_FUNC_ENTER
return popup;
}
-#else
static Evas_Object *create_popup(Evas_Object *layout, heremaps_uc_app_data *ad)
{
LS_FUNC_ENTER
LS_FUNC_EXIT
return popup;
}
-#endif
static bool _app_create_cb(void *user_data)
{
ad->conformant = create_conformant(ad->win_main);
ad->layout_main = create_layout(ad->conformant);
-#ifdef TIZEN_WEARABLE
- ad->popup = create_popup_wearable(ad->layout_main, ad);
-#else
- ad->popup = create_popup(ad->layout_main, ad);
-#endif
+ if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
+ ad->popup = create_popup_wearable(ad->layout_main, ad);
+ else
+ ad->popup = create_popup(ad->layout_main, ad);
evas_object_show(ad->win_main);
LS_FUNC_EXIT