2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "mgr-app-common-debug.h"
19 #include "mgr-app-common-error.h"
20 #include "mgr-app-common-util.h"
21 #include "mgr-app-view-main.h"
22 #include "mgr-app-view-common.h"
23 #include "mgr-app-string.h"
24 #include "mgr-app-widget.h"
25 #include "mgr-app-uigadget.h"
28 #include <pkgmgr-info.h>
29 #include <package-manager.h>
31 #include <app_manager.h>
34 #define WRT_PREFIX "wgt"
35 #define RPM_PREFIX "rpm"
36 #define TPK_PREFIX "tpk"
38 #define UG_NAME_MIDLET_INFO_EFL "midlet-info-efl"
39 #define UG_NAME_WEBAPP_INFO_EFL "webapp-detail-efl"
40 #define UG_PARAM_KEY_PKG_NAME "pkg_name"
42 #define STR_ICON "icon"
44 #define STR_INSTALLED_SIZE "installed_size"
45 #define STR_DATA_SIZE "data_size"
47 #define STR_BTN_UNINSTALL "btn_uninstall"
48 #define STR_POPUP "popup"
50 #define MAX_NAME_LEN 128
51 #define NUM_KILO (1024)
52 #define NUM_MEGA (1024*1024)
53 #define NUM_GIGA (1024*1024*1024)
55 #define ELM_TEXT_1 "elm.text.1"
56 #define ELM_TEXT_2 "elm.text.2"
57 #define ELM_TEXT "elm.text"
58 #define ELM_ICON "elm.icon"
59 #define ELM_ICON_SWALLOW_1 "elm.slide.swallow.1"
60 #define ELM_ICON_SWALLOW_2 "elm.slide.swallow.2"
61 #define ELM_BUTTON_STYLE "popup_button/default"
63 #define ITC_ITEM_STYLE "dialogue/2text.1icon.2"
64 #define ITC_LIFE_ITEM_STYLE "mode/slide2/custom"
65 #define ITC_STO_TITLE_ITEM_STYLE "dialogue/title"
66 #define ITC_STO_TOTAL_ITEM_STYLE "dialogue/2text.2"
67 #define ITC_STO_APP_ITEM_STYLE "dialogue/2text.2"
68 #define ITC_STO_DATA_ITEM_STYLE "dialogue/2text.2"
69 #define ITC_DATA_ITEM_STYLE "dialogue/bg/2icon"
70 #define ITC_LAUNCH_TITLE_ITEM_STYLE "dialogue/title"
71 #define ITC_LAUNCH_ITEM_STYLE "dialogue/1text"
72 #define ITC_LAUNCH_TEXT_ITEM_STYLE "multiline/1text"
73 #define ITC_DETAIL_ITEM_STYLE "dialogue/1text"
74 #define ITC_SEP_ITEM_STYLE "dialogue/separator"
83 static Evas_Object *_genlist = NULL;
84 static mgr_app_app_info_t *_app_info = NULL;
86 static Elm_Genlist_Item_Class *itc = NULL;
87 static Elm_Genlist_Item_Class *itc_life = NULL;
88 static Elm_Genlist_Item_Class *itc_sto_title = NULL;
89 static Elm_Genlist_Item_Class *itc_sto_total = NULL;
90 static Elm_Genlist_Item_Class *itc_sto_app = NULL;
91 static Elm_Genlist_Item_Class *itc_sto_data = NULL;
92 static Elm_Genlist_Item_Class *itc_data = NULL;
93 static Elm_Genlist_Item_Class *itc_launch_title = NULL;
94 static Elm_Genlist_Item_Class *itc_launch = NULL;
95 static Elm_Genlist_Item_Class *itc_launch_text = NULL;
96 static Elm_Genlist_Item_Class *itc_detail = NULL;
97 static Elm_Genlist_Item_Class *itc_sep = NULL;
99 static void _free_resources(struct ug_data *ugd)
105 if (ugd && ugd->pc) {
106 MGR_APP_DEBUG("pc is freed");
107 pkgmgr_client_free(ugd->pc);
112 if (ugd && ugd->sub_ug) {
113 ret = ug_destroy(ugd->sub_ug);
115 MGR_APP_DEBUG_ERR("ug_destroy ugd->sub_ug is failed");
121 elm_genlist_item_class_free(itc_sep);
122 elm_genlist_item_class_free(itc);
123 elm_genlist_item_class_free(itc_life);
124 elm_genlist_item_class_free(itc_sto_title);
125 elm_genlist_item_class_free(itc_sto_total);
126 elm_genlist_item_class_free(itc_sto_app);
127 elm_genlist_item_class_free(itc_sto_data);
128 elm_genlist_item_class_free(itc_data);
129 elm_genlist_item_class_free(itc_launch_title);
130 elm_genlist_item_class_free(itc_launch);
131 elm_genlist_item_class_free(itc_launch_text);
132 elm_genlist_item_class_free(itc_detail);
137 static void _app_info_back_cb(void *data, Evas_Object *obj, void *event_info)
141 ret_if(data == NULL);
142 struct ug_data *ugd = (struct ug_data*)data;
144 _free_resources(ugd);
146 mgr_app_doubletap_sensor_disable();
148 elm_naviframe_item_pop(ugd->navi_bar);
150 mgrapp_set_view_type(VIEW_TYPE_APP_LIST);
155 static void _force_stop_clicked_cb(void *data, Evas_Object *obj, void *event_info)
159 ret_if(_app_info == NULL);
160 mgr_app_app_info_t *app_info = _app_info;
161 ret_if(app_info->pkg_name == NULL);
162 bool is_running = false;
163 int ret = APP_MANAGER_ERROR_NONE;
164 struct ug_data *ugd = NULL;
166 ret = app_manager_is_running(app_info->main_appid, &is_running);
168 case APP_MANAGER_ERROR_NONE:
169 MGR_APP_DEBUG("is_running APP_MANAGER_ERROR_NONE");
171 case APP_MANAGER_ERROR_INVALID_PARAMETER:
172 MGR_APP_DEBUG("is_running APP_MANAGER_ERROR_INVALID_PARAMETER");
175 MGR_APP_DEBUG("default");
180 MGR_APP_DEBUG("%s app_is_running", app_info->main_appid);
181 app_context_h app_context = {0, };
183 ret = app_manager_get_app_context(app_info->main_appid, &app_context);
185 case APP_MANAGER_ERROR_NONE:
186 MGR_APP_DEBUG("get_app_context APP_MANAGER_ERROR_NONE");
188 case APP_MANAGER_ERROR_INVALID_PARAMETER:
189 MGR_APP_DEBUG("get_app_context APP_MANAGER_ERROR_INVALID_PARAMETER");
191 case APP_MANAGER_ERROR_DB_FAILED:
192 MGR_APP_DEBUG("get_app_context APP_MANAGER_ERROR_DB_FAILED");
194 case APP_MANAGER_ERROR_OUT_OF_MEMORY:
195 MGR_APP_DEBUG("get_app_context APP_MANAGER_ERROR_OUT_OF_MEMORY");
197 case APP_MANAGER_ERROR_NO_SUCH_APP:
198 MGR_APP_DEBUG("get_app_context APP_MANAGER_ERROR_NO_SUCH_APP");
201 MGR_APP_DEBUG("default");
205 ret = app_manager_terminate_app(app_context);
207 case APP_MANAGER_ERROR_NONE:
208 MGR_APP_DEBUG("terminate_app APP_MANAGER_ERROR_NONE");
210 case APP_MANAGER_ERROR_INVALID_PARAMETER:
211 MGR_APP_DEBUG("terminate_app APP_MANAGER_ERROR_INVALID_PARAMETER");
214 MGR_APP_DEBUG("default");
218 ret = app_context_destroy(app_context);
220 case APP_MANAGER_ERROR_NONE:
221 MGR_APP_DEBUG("context_destroy APP_MANAGER_ERROR_NONE");
223 case APP_MANAGER_ERROR_INVALID_PARAMETER:
224 MGR_APP_DEBUG("context_destroy APP_MANAGER_ERROR_INVALID_PARAMETER");
227 MGR_APP_DEBUG("default");
230 ugd = evas_object_data_get(_genlist, STR_UGD);
231 mgrapp_view_list_update_by_uninstall(app_info->pkg_type, app_info->pkg_name, (void*)ugd);
234 MGR_APP_DEBUG("%s app is not running", app_info->main_appid);
239 elm_object_disabled_set(obj, EINA_TRUE);
245 static void _no_response_cb(void *data, Evas_Object *obj, void *event_info)
249 ret_if(data == NULL);
250 evas_object_del(data);
255 static void _uninstall_by_pkgmgr_cb(void *data, Evas_Object *obj, void *event_info)
260 ret_if(_app_info == NULL);
261 mgr_app_app_info_t *app_info = _app_info;
263 struct ug_data *ugd = NULL;
264 ugd = evas_object_data_get(_genlist, STR_UGD);
267 Evas_Object *btn_uninstall = NULL;
268 btn_uninstall = (Evas_Object*)evas_object_data_get(obj, STR_BTN_UNINSTALL);
269 ret_if(btn_uninstall == NULL);
271 Evas_Object *popup = NULL;
272 popup = (Evas_Object*)evas_object_data_get(obj, STR_POPUP);
273 ret_if(popup == NULL);
275 evas_object_data_del(obj, STR_BTN_UNINSTALL);
276 evas_object_data_del(obj, STR_POPUP);
277 evas_object_del(popup);
279 mgr_app_create_popup_progressbar(ugd->win_main, MGRAPP_STR_UNINSTALLING);
281 _force_stop_clicked_cb(data, btn_uninstall, event_info);
283 MGR_APP_DEBUG("pkg_type: %s, pkg_name: %s", app_info->pkg_type, app_info->pkg_name);
286 pkgmgr_client_free(ugd->pc);
289 ugd->pc = pkgmgr_client_new(PC_REQUEST);
291 MGR_APP_DEBUG_ERR("create new pkgmgr client is failed");
296 req_id = pkgmgr_client_uninstall(ugd->pc, app_info->pkg_type, app_info->pkg_name, PM_QUIET, /*mgrapp_view_listen_cb*/NULL, /*(void*)ugd*/NULL);
299 MGR_APP_DEBUG("uninstall success, req_id=%d", req_id);
302 case PKGMGR_R_EINVAL: /* -3: Invalid argument */
303 MGR_APP_DEBUG("PKGMGR_R_EINVAL");
305 case PKGMGR_R_ECOMM: /* -2: Comunication Error */
306 MGR_APP_DEBUG("PKGMGR_R_ECOMM");
308 case PKGMGR_R_OK: /* 0: General success */
309 MGR_APP_DEBUG("PKGMGR_R_OK");
312 MGR_APP_DEBUG("default req_id=%d", req_id);
317 /* the select 'No' noti be available from pkg-mgr then add the condition */
318 elm_object_disabled_set(obj, EINA_FALSE);
323 static void _uninstall_clicked_cb(void *data, Evas_Object *obj, void *event_info)
328 Evas_Object *btn_uninstall = obj;
330 ret_if(_app_info == NULL);
332 Evas_Object *popup = NULL;
333 Evas_Object *btn_yes = NULL;
334 Evas_Object *btn_no = NULL;
335 char buf[MAX_NAME_LEN] = {0, };
336 struct ug_data *ugd = NULL;
338 ugd = evas_object_data_get(_genlist, STR_UGD);
341 popup = elm_popup_add(ugd->navi_bar);
342 ret_if(popup == NULL);
343 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
344 snprintf(buf, sizeof(buf), "%s?", MGRAPP_STR_UNINSTALL);
345 elm_object_text_set(popup, buf);
346 elm_object_part_text_set(popup, "title,text", _app_info->pkg_label);
348 btn_yes = elm_button_add(popup);
349 ret_if(btn_yes == NULL);
350 elm_object_text_set(btn_yes, MGRAPP_STR_YES);
351 elm_object_part_content_set(popup, "button1", btn_yes);
352 elm_object_style_set(btn_yes, ELM_BUTTON_STYLE);
353 evas_object_smart_callback_add(btn_yes, "clicked", _uninstall_by_pkgmgr_cb, data);
354 evas_object_data_set(btn_yes, STR_BTN_UNINSTALL, btn_uninstall);
355 evas_object_data_set(btn_yes, STR_POPUP, popup);
357 btn_no = elm_button_add(popup);
358 ret_if(btn_no == NULL);
359 elm_object_text_set(btn_no, MGRAPP_STR_NO);
360 elm_object_part_content_set(popup, "button2", btn_no);
361 elm_object_style_set(btn_no, ELM_BUTTON_STYLE);
362 evas_object_smart_callback_add(btn_no, "clicked", _no_response_cb, (void*)popup);
364 evas_object_show(popup);
369 static void _clear_data_clicked_cb(void *data, Evas_Object *obj, void *event_info)
374 elm_object_disabled_set(obj, EINA_TRUE);
379 static void _gl_sel(void *data, Evas_Object *obj, void *event_info)
383 Elm_Object_Item *item = (Elm_Object_Item *)event_info;
386 elm_genlist_item_selected_set(item, EINA_FALSE);
392 static void _gl_sel_launch(void *data, Evas_Object *obj, void *event_info)
396 Elm_Object_Item *item = (Elm_Object_Item *)event_info;
397 ret_if(data == NULL);
398 struct ug_data *ugd = (struct ug_data*)data;
400 ret_if(_app_info == NULL);
401 mgr_app_app_info_t *app_info = _app_info;
403 ret_if(app_info->pkg_name == NULL);
404 char *package_name = NULL;
405 package_name = app_info->pkg_name;
408 elm_genlist_item_selected_set(item, EINA_FALSE);
409 elm_object_item_disabled_set(item, EINA_TRUE);
412 if (appsvc_is_defapp(package_name)) {
413 MGR_APP_DEBUG("%s is the default app", package_name);
414 if (appsvc_unset_defapp(package_name) != APPSVC_RET_OK) {
415 MGR_APP_DEBUG_ERR("unset the %s to default app is failed", package_name);
418 MGR_APP_DEBUG("%s is not the default app", package_name);
424 static void _layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
428 ret_if(NULL == priv);
430 Evas_Object *base = NULL;
432 base = ug_get_layout(ug);
433 ret_if(NULL == base);
436 case UG_MODE_FULLVIEW:
437 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
438 ug_disable_effect(ug);
439 evas_object_show(base);
448 static void _result_cb(ui_gadget_h ug, service_h service, void *priv)
452 ret_if(NULL == priv);
454 struct ug_data *mydata = NULL;
459 int ret = SERVICE_ERROR_NONE;
461 ret = service_get_extra_data(service, "name", &val);
463 case SERVICE_ERROR_NONE:
464 MGR_APP_DEBUG_ERR("SERVICE_ERROR_NONE");
466 case SERVICE_ERROR_INVALID_PARAMETER:
467 MGR_APP_DEBUG_ERR("SERVICE_ERROR_INVALID_PARAMETER");
469 case SERVICE_ERROR_KEY_NOT_FOUND:
470 MGR_APP_DEBUG_ERR("SERVICE_ERROR_KEY_NOT_FOUND");
472 case SERVICE_ERROR_OUT_OF_MEMORY:
473 MGR_APP_DEBUG_ERR("SERVICE_ERROR_OUT_OF_MEMORY");
475 case SERVICE_ERROR_INVALID_DATA_TYPE:
476 MGR_APP_DEBUG_ERR("SERVICE_ERROR_INVALID_DATA_TYPE");
479 MGR_APP_DEBUG_ERR("ret value has an error. %d.", ret);
484 MGR_APP_DEBUG("The name of UI gadget that sends result is [%s]", val);
490 MGR_APP_DEBUG("mydata->sub_ug:%d", mydata->sub_ug);
492 mydata->sub_ug = NULL;
497 static void _destroy_cb(ui_gadget_h ug, void *priv)
502 ret_if(NULL == priv);
504 struct ug_data *mydata = (struct ug_data*)priv;
507 mydata->sub_ug = NULL;
512 static void _create_ug(void *data)
516 ret_if(data == NULL);
517 struct ug_data *ugd = (struct ug_data*)data;
518 mgr_app_app_info_t *app_info = NULL;
520 ret_if(ugd->data == NULL);
521 app_info = (mgr_app_app_info_t*)ugd->data;
523 ui_gadget_h ug = {0, };
524 struct ug_cbs cbs = {0,};
525 service_h service = {0, };
526 int ret = MGR_APP_OK;
528 cbs.layout_cb = _layout_cb;
529 cbs.result_cb = _result_cb;
530 cbs.destroy_cb = _destroy_cb;
531 cbs.priv = (void*)ugd;
533 ret = service_create(&service);
535 case SERVICE_ERROR_NONE:
536 MGR_APP_DEBUG("service_create SERVICE_ERROR_NONE");
538 case SERVICE_ERROR_INVALID_PARAMETER:
539 MGR_APP_DEBUG_ERR("service_create SERVICE_ERROR_INVALID_PARAMETER");
541 case SERVICE_ERROR_OUT_OF_MEMORY:
542 MGR_APP_DEBUG_ERR("service_create SERVICE_ERROR_OUT_OF_MEMORY");
545 MGR_APP_DEBUG_ERR("service_create ret value has an error, %d.", ret);
549 if (app_info->pkg_type && 0 == strncmp(app_info->pkg_type, WRT_PREFIX, strlen(WRT_PREFIX))) {
550 MGR_APP_DEBUG("app_info->pkg_type: %s", app_info->pkg_type);
551 MGR_APP_DEBUG("app_info->pkg_name : %s", app_info->pkg_name);
553 ret = service_add_extra_data(service, UG_PARAM_KEY_PKG_NAME, app_info->pkg_name);
555 case SERVICE_ERROR_NONE:
556 MGR_APP_DEBUG("service_add_extra_data SERVICE_ERROR_NONE");
558 case SERVICE_ERROR_INVALID_PARAMETER:
559 MGR_APP_DEBUG_ERR("service_add_extra_data SERVICE_ERROR_INVALID_PARAMETER");
561 case SERVICE_ERROR_KEY_REJECTED:
562 MGR_APP_DEBUG_ERR("service_add_extra_data SERVICE_ERROR_KEY_REJECTED");
565 MGR_APP_DEBUG_ERR("service_add_extra_data ret value has an error, %d.", ret);
569 /* wrt ug more detail info */
570 ug = ug_create(ugd->ug, UG_NAME_WEBAPP_INFO_EFL, UG_MODE_FULLVIEW, service, &cbs);
573 MGR_APP_DEBUG(">>> NOT SUPPORTED TYPE");
577 ret = service_destroy(service);
579 case SERVICE_ERROR_NONE:
580 MGR_APP_DEBUG("service_destroy SERVICE_ERROR_NONE");
582 case SERVICE_ERROR_INVALID_PARAMETER:
583 MGR_APP_DEBUG_ERR("service_destroy SERVICE_ERROR_INVALID_PARAMETER");
585 case SERVICE_ERROR_OUT_OF_MEMORY:
586 MGR_APP_DEBUG_ERR("service_destroy SERVICE_ERROR_OUT_OF_MEMORY");
589 MGR_APP_DEBUG_ERR("service_destroy ret value has an error, %d.", ret);
596 static void _gl_sel_detail(void *data, Evas_Object *obj, void *event_info)
600 Elm_Object_Item *item = (Elm_Object_Item *)event_info;
601 struct ug_data *ugd = (struct ug_data*)data;
604 elm_genlist_item_selected_set(item, 0);
607 _create_ug((void*)ugd);
612 static char *_get_formated_size(float size)
616 char *buf = (char*)malloc(sizeof(char)*MAX_NAME_LEN);
617 retv_if(buf == NULL, NULL);
618 memset(buf, 0, MAX_NAME_LEN);
620 if (size < NUM_KILO) {
621 snprintf(buf, MAX_NAME_LEN, "%d %s", (int)size, MGRAPP_STR_BYTES);
622 } else if (size >= NUM_KILO && size < NUM_MEGA) {
623 snprintf(buf, MAX_NAME_LEN, "%'.2f %s", size / NUM_KILO, MGRAPP_STR_KB);
624 } else if (size >= NUM_MEGA && size < NUM_GIGA) {
625 snprintf(buf, MAX_NAME_LEN, "%'.2f %s", size / NUM_MEGA, MGRAPP_STR_MB);
627 snprintf(buf, MAX_NAME_LEN, "%'.2f %s", size / NUM_GIGA, MGRAPP_STR_GB);
634 static char *_gl_label_get(void *data, Evas_Object *obj, const char *part)
638 retv_if(_app_info == NULL, NULL);
639 mgr_app_app_info_t *app_info = _app_info;
642 char buf[MAX_NAME_LEN] = {0, };
644 char *package_name = app_info->pkg_name;
645 char *package_label = app_info->pkg_label;
646 //char *app_name = app_info->app_name;
647 char *icon_path = app_info->icon_path;
648 char *pkg_type = app_info->pkg_type;
650 // MGR_APP_DEBUG("package_name:[%s], app_name:[%s], x_slp_packagetype:[%s], icon_path:[%s]\n", package_name, app_name, pkg_type, icon_path);
651 MGR_APP_DEBUG("package_label:[%s], x_slp_packagetype:[%s], icon_path:[%s]\n", package_label, pkg_type, icon_path);
653 MGR_APP_DEBUG("part:%s\n", part);
654 retv_if(package_label == NULL, NULL);
656 /* label for 'elm.text' part */
657 if (0 == strcmp(part, ELM_TEXT_1)) {
659 MGR_APP_MEM_STRDUP(label, package_label);
661 } else if (0 == strcmp(part, ELM_TEXT_2)) {
662 snprintf(buf, MAX_NAME_LEN, "%s: %s", MGRAPP_STR_VERSION, app_info->pkg_version);
663 MGR_APP_MEM_STRDUP(label, buf);
665 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_ERROR);
672 static char *_gl_label_get_sto_total(void *data, Evas_Object *obj, const char *part)
676 retv_if(_app_info == NULL, NULL);
677 mgr_app_app_info_t *app_info = _app_info;
681 MGR_APP_DEBUG("part:%s\n", part);
683 /* label for 'elm.text' part */
684 if (0 == strcmp(part, ELM_TEXT_2)) {
685 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_TOTAL);
686 } else if (0 == strcmp(part, ELM_TEXT_1)) {
687 label = _get_formated_size((float)app_info->total_size);
689 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_ERROR);
696 static char *_gl_label_get_sto_app(void *data, Evas_Object *obj, const char *part)
700 retv_if(_app_info == NULL, NULL);
701 mgr_app_app_info_t *app_info = _app_info;
705 MGR_APP_DEBUG("part:%s\n", part);
707 /* label for 'elm.text' part */
708 if (0 == strcmp(part, ELM_TEXT_2)) {
709 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_APPLICATION);
710 } else if (0 == strcmp(part, ELM_TEXT_1)) {
711 label = _get_formated_size((float)app_info->total_size - (float)app_info->data_size);
713 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_ERROR);
720 static char *_gl_label_get_sto_data(void *data, Evas_Object *obj, const char *part)
724 retv_if(_app_info == NULL, NULL);
725 mgr_app_app_info_t *app_info = _app_info;
729 MGR_APP_DEBUG("part:%s\n", part);
731 /* label for 'elm.text' part */
732 if (0 == strcmp(part, ELM_TEXT_2)) {
733 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_DATA);
734 } else if (0 == strcmp(part, ELM_TEXT_1)) {
735 label = _get_formated_size((float)app_info->data_size);
737 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_ERROR);
744 static char *_gl_label_get_launch(void *data, Evas_Object *obj, const char *part)
750 MGR_APP_DEBUG("part:%s\n", part);
752 /* label for 'elm.text' part */
753 if (0 == strcmp(part, ELM_TEXT)) {
754 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_CLEAR_DEFAULTS);
761 static char *_gl_label_get_detail(void *data, Evas_Object *obj, const char *part)
767 MGR_APP_DEBUG("part:%s\n", part);
769 /* label for 'elm.text' part */
770 if (0 == strcmp(part, ELM_TEXT)) {
771 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_MORE_DETAILS);
778 static char *_gl_label_get_launch_text(void *data, Evas_Object *obj, const char *part)
784 MGR_APP_DEBUG("part:%s\n", part);
786 /* label for 'elm.text' part */
787 if (0 == strcmp(part, ELM_TEXT)) {
788 MGR_APP_MEM_STRDUP(label, MGRAPP_STR_DEFAULT_DESC);
795 static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part)
799 retv_if(_app_info == NULL, NULL);
800 mgr_app_app_info_t *app_info = _app_info;
802 Evas_Object *icon = NULL;
803 char *icon_path = NULL;
805 retv_if(app_info->icon_path == NULL, NULL);
806 icon_path = app_info->icon_path;
808 MGR_APP_DEBUG("icon_path:[%s]\n", icon_path);
809 MGR_APP_DEBUG("part:%s\n", part);
811 /* icon for 'elm.icon' part */
812 icon = elm_icon_add(obj);
813 retv_if(icon == NULL, NULL);
814 elm_image_file_set(icon, icon_path, STR_ICON);
816 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
823 static Evas_Object *_gl_icon_get_life(void *data, Evas_Object *obj, const char *part)
827 MGR_APP_DEBUG("part:%s\n", part);
828 retv_if(_app_info == NULL, NULL);
829 mgr_app_app_info_t *app_info = _app_info;
831 Evas_Object *button = NULL;
832 if (0 == strcmp(part, ELM_ICON_SWALLOW_2)) {
833 button = elm_button_add(obj);
835 elm_object_style_set(button, ELM_BUTTON_STYLE);
836 elm_object_disabled_set(button, EINA_TRUE);
837 elm_object_text_set(button, MGRAPP_STR_UNINSTALL);
838 evas_object_smart_callback_add(button, "clicked", _uninstall_clicked_cb, (void*)data);
840 if (app_info->removable) {
841 elm_object_disabled_set(button, EINA_FALSE);
844 } else if (0 == strcmp(part, ELM_ICON_SWALLOW_1)) {
845 button = elm_button_add(obj);
847 elm_object_style_set(button, ELM_BUTTON_STYLE);
848 elm_object_disabled_set(button, EINA_TRUE);
849 elm_object_text_set(button, MGRAPP_STR_FORCE_STOP);
850 evas_object_smart_callback_add(button, "clicked", _force_stop_clicked_cb, (void*)data);
852 if (app_info->taskmanage) {
853 bool is_running = false;
854 int ret = app_manager_is_running(app_info->main_appid, &is_running);
857 case APP_MANAGER_ERROR_NONE:
858 MGR_APP_DEBUG("is_running APP_MANAGER_ERROR_NONE");
860 elm_object_disabled_set(button, EINA_FALSE);
863 case APP_MANAGER_ERROR_INVALID_PARAMETER:
864 MGR_APP_DEBUG("is_running APP_MANAGER_ERROR_INVALID_PARAMETER");
867 MGR_APP_DEBUG("default");
873 MGR_APP_DEBUG_ERR("elm icon part is wrong");
881 static Evas_Object *_gl_icon_get_data(void *data, Evas_Object *obj, const char *part)
885 MGR_APP_DEBUG("part:%s\n", part);
886 retv_if(_app_info == NULL, NULL);
887 mgr_app_app_info_t *app_info = _app_info;
889 Evas_Object *button = NULL;
890 if (0 == strcmp(part, ELM_ICON)) {
891 button = elm_button_add(obj);
893 elm_object_text_set(button, MGRAPP_STR_CLEAR_DATA);
894 elm_object_style_set(button, ELM_BUTTON_STYLE);
895 evas_object_smart_callback_add(button, "clicked", _clear_data_clicked_cb, (void*)data);
896 if (app_info->data_size <= 0) {
897 elm_object_disabled_set(button, EINA_TRUE);
901 MGR_APP_DEBUG_ERR("empty button area");
909 static char *_gl_label_get_title(void *data, Evas_Object *obj, const char *part)
913 char *group_title = (char *)data;
916 MGR_APP_MEM_STRDUP(title, group_title);
922 static void _gl_realized(void *data, Evas_Object *obj, void *event_info)
926 ret_if(event_info == NULL);
928 int type = (int)elm_object_item_data_get(event_info);
930 if (type == ELM_STATE_TOP) {
931 elm_object_item_signal_emit(event_info, "elm,state,top", "");
932 } else if (type == ELM_STATE_CENTER) {
933 elm_object_item_signal_emit(event_info, "elm,state,center", "");
934 } else if (type == ELM_STATE_BOTTOM) {
935 elm_object_item_signal_emit(event_info, "elm,state,bottom", "");
941 static Evas_Object *_create_genlist_app_info(Evas_Object *parent, void *data)
945 retv_if(data == NULL, NULL);
946 struct ug_data *ugd = (struct ug_data*)data;
948 Elm_Object_Item *item_app = NULL;
949 Elm_Object_Item *item_life = NULL;
950 Elm_Object_Item *item_sto_total = NULL;
951 Elm_Object_Item *item_sto_app = NULL;
952 Elm_Object_Item *item_sto_data = NULL;
953 Elm_Object_Item *item_data = NULL;
954 Elm_Object_Item *item_launch_text = NULL;
955 Elm_Object_Item *item_launch = NULL;
956 Elm_Object_Item *item_sep = NULL;
957 Elm_Object_Item *item_detail = NULL;
959 Evas_Object *genlist = NULL;
960 char *sto_title = NULL;
961 char *launch_title = NULL;
964 /* set the genlist item style */
965 itc_sep = elm_genlist_item_class_new();
966 retv_if(itc_sep == NULL, NULL);
967 itc = elm_genlist_item_class_new();
968 retv_if(itc == NULL, NULL);
969 itc_life = elm_genlist_item_class_new();
970 retv_if(itc_life == NULL, NULL);
971 itc_sto_title = elm_genlist_item_class_new();
972 retv_if(itc_sto_title == NULL, NULL);
973 itc_sto_total = elm_genlist_item_class_new();
974 retv_if(itc_sto_total == NULL, NULL);
975 itc_sto_app = elm_genlist_item_class_new();
976 retv_if(itc_sto_app == NULL, NULL);
977 itc_sto_data = elm_genlist_item_class_new();
978 retv_if(itc_sto_data == NULL, NULL);
979 itc_data = elm_genlist_item_class_new();
980 retv_if(itc_data == NULL, NULL);
981 itc_launch_title = elm_genlist_item_class_new();
982 retv_if(itc_launch_title == NULL, NULL);
983 itc_launch = elm_genlist_item_class_new();
984 retv_if(itc_launch == NULL, NULL);
985 itc_launch_text = elm_genlist_item_class_new();
986 retv_if(itc_launch_text == NULL, NULL);
987 itc_detail = elm_genlist_item_class_new();
988 retv_if(itc_detail == NULL, NULL);
990 itc_sep->item_style = ITC_SEP_ITEM_STYLE;
991 itc_sep->func.text_get = NULL;
992 itc_sep->func.content_get = NULL;
993 itc_sep->func.state_get = NULL;
994 itc_sep->func.del = NULL;
996 itc->item_style = ITC_ITEM_STYLE;
997 itc->func.text_get = _gl_label_get;
998 itc->func.content_get = _gl_icon_get;
999 itc->func.state_get = NULL;
1000 itc->func.del = NULL;
1002 itc_life->item_style = ITC_LIFE_ITEM_STYLE;
1003 itc_life->func.text_get = NULL;
1004 itc_life->func.content_get = _gl_icon_get_life;
1005 itc_life->func.state_get = NULL;
1006 itc_life->func.del = NULL;
1008 itc_sto_title->item_style = ITC_STO_TITLE_ITEM_STYLE;
1009 itc_sto_title->func.text_get = _gl_label_get_title;
1010 itc_sto_title->func.content_get = NULL;
1011 itc_sto_title->func.state_get = NULL;
1012 itc_sto_title->func.del = NULL;
1014 itc_sto_total->item_style = ITC_STO_TOTAL_ITEM_STYLE;
1015 itc_sto_total->func.text_get = _gl_label_get_sto_total;
1016 itc_sto_total->func.content_get = NULL;
1017 itc_sto_total->func.state_get = NULL;
1018 itc_sto_total->func.del = NULL;
1020 itc_sto_app->item_style = ITC_STO_APP_ITEM_STYLE;
1021 itc_sto_app->func.text_get = _gl_label_get_sto_app;
1022 itc_sto_app->func.content_get = NULL;
1023 itc_sto_app->func.state_get = NULL;
1024 itc_sto_app->func.del = NULL;
1026 itc_sto_data->item_style = ITC_STO_DATA_ITEM_STYLE;
1027 itc_sto_data->func.text_get = _gl_label_get_sto_data;
1028 itc_sto_data->func.content_get = NULL;
1029 itc_sto_data->func.state_get = NULL;
1030 itc_sto_data->func.del = NULL;
1032 itc_data->item_style = ITC_DATA_ITEM_STYLE;
1033 itc_data->func.text_get = NULL;
1034 itc_data->func.content_get = _gl_icon_get_data;
1035 itc_data->func.state_get = NULL;
1036 itc_data->func.del = NULL;
1038 itc_launch_title->item_style = ITC_LAUNCH_TITLE_ITEM_STYLE;
1039 itc_launch_title->func.text_get = _gl_label_get_title;
1040 itc_launch_title->func.content_get = NULL;
1041 itc_launch_title->func.state_get = NULL;
1042 itc_launch_title->func.del = NULL;
1044 itc_launch->item_style = ITC_LAUNCH_ITEM_STYLE;
1045 itc_launch->func.text_get = _gl_label_get_launch;
1046 itc_launch->func.content_get = NULL;
1047 itc_launch->func.state_get = NULL;
1048 itc_launch->func.del = NULL;
1050 itc_launch_text->item_style = ITC_LAUNCH_TEXT_ITEM_STYLE;
1051 itc_launch_text->func.text_get = _gl_label_get_launch_text;
1052 itc_launch_text->func.content_get = NULL;
1053 itc_launch_text->func.state_get = NULL;
1054 itc_launch_text->func.del = NULL;
1056 itc_detail->item_style = ITC_DETAIL_ITEM_STYLE;
1057 itc_detail->func.text_get = _gl_label_get_detail;
1058 itc_detail->func.content_get = NULL;
1059 itc_detail->func.state_get = NULL;
1060 itc_detail->func.del = NULL;
1062 retv_if(ugd->data == NULL, NULL);
1063 mgr_app_app_info_t *app_info = (mgr_app_app_info_t *)ugd->data;
1066 genlist = elm_genlist_add(parent);
1067 retv_if(genlist == NULL, NULL);
1068 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1069 evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
1070 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
1071 elm_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
1072 evas_object_data_set(genlist, STR_UGD, (void*)ugd);
1073 evas_object_show(genlist);
1074 evas_object_smart_callback_add(genlist, "realized", _gl_realized, NULL);
1076 MGR_APP_MEM_STRDUP(sto_title, MGRAPP_STR_STORAGE);
1077 MGR_APP_MEM_STRDUP(launch_title, MGRAPP_STR_LAUNCH_BY_DEFAULT);
1081 item_app = elm_genlist_item_append(genlist, itc, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1083 elm_genlist_item_select_mode_set(item_app, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1085 /* Force stop & Uninstall */
1086 item_life = elm_genlist_item_append(genlist, itc_life, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1088 elm_genlist_item_select_mode_set(item_life, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1091 elm_genlist_item_append(genlist, itc_sto_title, sto_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
1092 item_sto_total = elm_genlist_item_append(genlist, itc_sto_total, ELM_STATE_TOP, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1094 elm_genlist_item_select_mode_set(item_sto_total, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1095 item_sto_app = elm_genlist_item_append(genlist, itc_sto_app, ELM_STATE_CENTER, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1097 elm_genlist_item_select_mode_set(item_sto_app, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1098 item_sto_data = elm_genlist_item_append(genlist, itc_sto_data, ELM_STATE_BOTTOM, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1100 elm_genlist_item_select_mode_set(item_sto_data, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1103 /* separator with no bottom line */
1104 item_sep = elm_genlist_item_append(genlist, itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1106 elm_genlist_item_select_mode_set(item_sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1110 /* remove the button until the feature is supported */
1111 item_data = elm_genlist_item_append(genlist, &itc_data, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel, NULL);
1114 /* separator with bottom line */
1115 /* the separator is located bottom of Clear Data button */
1116 item_sep = elm_genlist_item_append(genlist, &itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1118 elm_genlist_item_select_mode_set(item_sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1122 elm_genlist_item_append(genlist, itc_launch_title, launch_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
1123 item_launch = elm_genlist_item_append(genlist, itc_launch, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_launch, (void*)ugd);
1124 if (item_launch && !appsvc_is_defapp(app_info->pkg_name)) {
1125 elm_genlist_item_selected_set(item_launch, EINA_FALSE);
1126 elm_object_item_disabled_set(item_launch, EINA_TRUE);
1128 item_launch_text = elm_genlist_item_append(genlist, itc_launch_text, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1129 if (item_launch_text)
1130 elm_genlist_item_select_mode_set(item_launch_text, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1131 item_sep = elm_genlist_item_append(genlist, itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1133 elm_genlist_item_select_mode_set(item_sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1137 item_detail = elm_genlist_item_append(genlist, itc_detail, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_detail, (void*)ugd);
1139 elm_genlist_item_selected_set(item_detail, EINA_FALSE);
1140 elm_object_item_disabled_set(item_detail, EINA_TRUE);
1143 if (app_info->pkg_type) {
1144 if (item_detail && (!strncmp(app_info->pkg_type, TPK_PREFIX, strlen(TPK_PREFIX)) || !strncmp(app_info->pkg_type, RPM_PREFIX, strlen(RPM_PREFIX)))) {
1145 elm_genlist_item_selected_set(item_detail, EINA_FALSE);
1146 elm_object_item_disabled_set(item_detail, EINA_TRUE);
1149 MGR_APP_DEBUG_ERR("app_info->pkg_type is NULL");
1154 item_sep = elm_genlist_item_append(genlist, itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1156 elm_genlist_item_select_mode_set(item_sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1158 if (elm_genlist_first_item_get(genlist)) {
1159 item_sep = elm_genlist_item_prepend(genlist, itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1161 elm_genlist_item_select_mode_set(item_sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1168 static void _doubletap_sensor_cb(void *data)
1172 ret_if(NULL == data);
1174 Evas_Object *genlist = (Evas_Object*)data;
1175 Elm_Object_Item *item = NULL;
1177 item = elm_genlist_first_item_get(genlist);
1178 ret_if(NULL == item);
1180 elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
1185 static void _get_app_info_from_pkgmgr(char *pkg_name, mgr_app_app_info_t *app_info)
1189 ret_if(NULL == pkg_name);
1191 pkgmgrinfo_appinfo_h appinfo_h = NULL;
1192 pkgmgrinfo_pkginfo_h pkginfo_h = NULL;
1193 char *main_appid = NULL;
1194 char *icon_path = NULL;
1195 char *pkg_label = NULL;
1196 char *pkg_type = NULL;
1197 char *pkg_version = NULL;
1198 char *data_size = NULL;
1199 char *total_size = NULL;
1202 MGR_APP_DEBUG("pkg_name: %s", pkg_name);
1203 MGR_APP_MEM_STRDUP(app_info->pkg_name, pkg_name);
1205 r = pkgmgrinfo_pkginfo_get_pkginfo(pkg_name, &pkginfo_h);
1207 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_get_pkginfo is failed %d", r);
1210 MGR_APP_DEBUG("pkg_name: %s", pkg_name);
1212 r = pkgmgrinfo_pkginfo_get_mainappid(pkginfo_h, &main_appid);
1214 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_get_mainappid is failed %d", r);
1217 MGR_APP_DEBUG("main_appid: %s", main_appid);
1219 r = pkgmgrinfo_appinfo_get_appinfo(main_appid, &appinfo_h);
1221 MGR_APP_DEBUG_ERR("pkgmgrinfo_appinfo_get_appinfo is failed %d", r);
1225 if (NULL == app_info->pkg_label) {
1226 r = pkgmgrinfo_appinfo_get_label(appinfo_h, &pkg_label);
1228 MGR_APP_DEBUG_ERR("pkgmgrinfo_appinfo_get_label failed. %d", r);
1230 } else if (pkg_label) {
1231 MGR_APP_MEM_STRDUP(app_info->pkg_label, pkg_label);
1233 MGR_APP_MEM_STRDUP(app_info->pkg_label, "");
1236 MGR_APP_DEBUG("pkg_label: %s", pkg_label);
1238 if (NULL == app_info->pkg_type) {
1239 r = pkgmgrinfo_pkginfo_get_type(pkginfo_h, &pkg_type);
1241 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_get_type failed. %d", r);
1243 } else if (pkg_type) {
1244 MGR_APP_MEM_STRDUP(app_info->pkg_type, pkg_type);
1246 MGR_APP_MEM_STRDUP(app_info->pkg_type, "");
1249 MGR_APP_DEBUG("pkg_type: %s", pkg_type);
1251 if (NULL == app_info->pkg_version) {
1252 r = pkgmgrinfo_pkginfo_get_version(pkginfo_h, &pkg_version);
1254 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_get_version failed. %d", r);
1256 } else if (pkg_version) {
1257 MGR_APP_MEM_STRDUP(app_info->pkg_version, pkg_version);
1259 MGR_APP_MEM_STRDUP(app_info->pkg_version, "");
1262 MGR_APP_DEBUG("pkg_version: %s", pkg_version);
1264 r = pkgmgrinfo_pkginfo_get_data_size(pkginfo_h, &app_info->data_size);
1266 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_get_data_size failed. %d", r);
1269 MGR_APP_DEBUG("data_size: %d", data_size);
1271 r = pkgmgrinfo_pkginfo_get_total_size(pkginfo_h, &app_info->total_size);
1273 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_get_total_size failed. %d", r);
1276 MGR_APP_DEBUG("total_size: %d", total_size);
1278 r = pkgmgrinfo_pkginfo_is_removable(pkginfo_h, &app_info->removable);
1280 MGR_APP_DEBUG_ERR("pkgmgrinfo_pkginfo_is_removable failed. %d", r);
1284 r = pkgmgrinfo_appinfo_is_taskmanage(appinfo_h, &app_info->taskmanage);
1286 MGR_APP_DEBUG_ERR("pkgmgrinfo_appinfo_is_taskmanage failed. %d", r);
1290 r = pkgmgrinfo_appinfo_is_nodisplay(appinfo_h, &app_info->nodisplay);
1292 MGR_APP_DEBUG_ERR("pkgmgrinfo_appinfo_is_nodisplay failed. %d", r);
1296 if (NULL == app_info->icon_path) {
1297 r = pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon_path);
1299 MGR_APP_DEBUG_ERR("pkgmgrinfo_appinfo_get_icon failed. %d", r);
1301 } else if (icon_path) {
1302 MGR_APP_MEM_STRDUP(app_info->icon_path, icon_path);
1304 MGR_APP_MEM_STRDUP(app_info->icon_path, "");
1307 if (app_info->nodisplay) {
1308 mgr_app_set_default_icon(&app_info->icon_path, DEFAULT_ICON_SERVICE);
1310 mgr_app_set_default_icon(&app_info->icon_path, DEFAULT_ICON_APP);
1313 MGR_APP_DEBUG("icon_path: %s", icon_path);
1317 pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
1321 pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h);
1328 void mgrapp_view_info_create(char *pkg_name, void *data)
1332 ret_if(NULL == pkg_name || NULL == data);
1333 struct ug_data *ugd = (struct ug_data*)data;
1334 Evas_Object *back_btn = NULL;
1336 mgrapp_set_view_type(VIEW_TYPE_APP_INFO);
1339 _app_info = (mgr_app_app_info_t*)ugd->data;
1341 _app_info = (mgr_app_app_info_t*)malloc(sizeof(mgr_app_app_info_t));
1342 ret_if(_app_info == NULL);
1343 memset(_app_info, 0, sizeof(mgr_app_app_info_t));
1344 ugd->data = (void*)_app_info;
1347 _get_app_info_from_pkgmgr(pkg_name, _app_info);
1349 _genlist = _create_genlist_app_info(ugd->navi_bar, (void*)ugd);
1352 back_btn = elm_button_add(ugd->navi_bar);
1353 ret_if(NULL == back_btn);
1354 elm_object_style_set(back_btn, "naviframe/end_btn/default");
1355 evas_object_smart_callback_add(back_btn, "clicked", _app_info_back_cb, (void*)ugd);
1357 elm_naviframe_item_push(ugd->navi_bar, MGRAPP_STR_APPLICATION_INFO, back_btn, NULL, _genlist, NULL);
1359 mgr_app_doubletap_sensor_set_cb(_doubletap_sensor_cb, _genlist);
1360 mgr_app_doubletap_sensor_enable();
1365 void mgrapp_view_info_update(void *data)
1370 elm_genlist_realized_items_update(_genlist);
1376 void mgrapp_view_info_destroy(void *data)
1380 ret_if(data == NULL);
1381 struct ug_data *ugd = (struct ug_data*)data;
1383 _free_resources(ugd);
1385 mgr_app_doubletap_sensor_disable();
1387 elm_naviframe_item_pop(ugd->navi_bar);
1389 mgrapp_set_view_type(VIEW_TYPE_APP_LIST);
1393 /* bg must delete before starting on_destroy */
1395 evas_object_del(ugd->bg);
1400 ug_destroy_me(ugd->ug);