Crash Fix: Don't call indicator APIs for ARTIC device profile 35/187935/3 accepted/tizen/unified/20180831.165216 submit/tizen/20180831.123741
authorKartik Tidke <kr.tidke@samsung.com>
Wed, 29 Aug 2018 21:54:24 +0000 (03:24 +0530)
committerKartik Tidke <kr.tidke@samsung.com>
Thu, 30 Aug 2018 14:17:53 +0000 (19:47 +0530)
Change-Id: I73ecb6d16ea82f332e2d00b35b809f33cc9fdfde
Signed-off-by: Kartik Tidke <kr.tidke@samsung.com>
inc/util.h
src/menu_screen.c
src/util.c

index e9e0860..b1a276e 100644 (file)
@@ -158,6 +158,7 @@ extern void _evas_object_resize_cb(void *data, Evas *e, Evas_Object *obj, void *
 extern void _evas_object_event_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 extern void _evas_object_event_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 extern void _evas_object_event_show_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+extern char *util_get_device_profile(void);
 extern const char *util_get_file_path(const char *relative);
 
 #define util_get_res_file_path(x) util_get_file_path(x);
index 47d479f..1d9c15e 100644 (file)
@@ -326,13 +326,19 @@ static void _fini_theme(void)
 static Evas_Object *_create_conformant(Evas_Object *win)
 {
        Evas_Object *conformant;
+       char *device_profile;
 
        conformant = elm_conformant_add(win);
        retv_if(NULL == conformant, NULL);
 
        evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW);
-       elm_win_indicator_opacity_set(menu_screen_info.win, ELM_WIN_INDICATOR_TRANSLUCENT);
+       device_profile = util_get_device_profile();
+       if (device_profile) {
+               if (!strcmp(device_profile, "mobile")) {
+                       elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW);
+                       elm_win_indicator_opacity_set(menu_screen_info.win, ELM_WIN_INDICATOR_TRANSLUCENT);
+               }
+       }
        elm_object_signal_emit(conformant, "elm,state,indicator,overlap", "elm");
        evas_object_data_set(conformant, "win", win);
        evas_object_show(conformant);
@@ -340,6 +346,9 @@ static Evas_Object *_create_conformant(Evas_Object *win)
        elm_win_resize_object_add(win, conformant);
        elm_win_conformant_set(win, EINA_TRUE);
 
+       if (device_profile)
+               free(device_profile);
+
        return conformant;
 }
 
index a2a4858..e4fdc02 100644 (file)
 
 #include <Evas.h>
 #include <app_common.h>
-
+#include <system_info.h>
 #include "util.h"
 
-
+char *util_get_device_profile(void)
+{
+       char *value;
+       int ret;
+       ret = system_info_get_platform_string("http://tizen.org/feature/profile", &value);
+       if (ret != SYSTEM_INFO_ERROR_NONE) {
+               _E("Error: system_info_get_platform_string");
+               return NULL;
+       }
+       _I("Device profile: %s", value);
+       return value;
+}
 
 const char *util_get_file_path(const char *relative)
 {