adding exception handling code about drawing window.
authorMinho Kim <minho07.kim@samsung.com>
Wed, 6 Feb 2013 07:44:30 +0000 (16:44 +0900)
committerMinho Kim <minho07.kim@samsung.com>
Wed, 6 Feb 2013 08:03:51 +0000 (17:03 +0900)
Change-Id: I5748144826b4e6970a640254a1c587dbb5849d9a

src/_logic.c
src/_sound.c

index 3a64155b098fa799422f2969e42c7f0e4291f2f4..9e7c077e039d28d087a0d72a81ebda336fb7ce87 100755 (executable)
@@ -72,7 +72,8 @@ int _close_volume(void *data)
        DEL_TIMER(ad->ldtimer)
        DEL_TIMER(ad->ptimer)
 
-       if (ad->win){
+       if (evas_object_visible_get(ad->win) == EINA_TRUE){
+               _D("hide window\n");
                evas_object_hide(ad->win);
        }
        appcore_flush_memory();
@@ -880,9 +881,16 @@ int _app_reset(bundle *b, void *data)
        ad->type = type;
        mm_sound_volume_get_value(type, (unsigned int*)(&val));
 
-       win = _add_window(PACKAGE);
-       retvm_if(win == NULL, -1, "Failed add window\n");
-       ad->win = win;
+       if(ad->win == NULL) {
+               win = _add_window(PACKAGE);
+               retvm_if(win == NULL, -1, "Failed add window\n");
+               _D("create window\n");
+               ad->win = win;
+       }
+       else {
+               _E("window already exist\n");
+               return -1;
+       }
 
        th = elm_theme_new();
        elm_theme_ref_set(th, NULL);
@@ -893,9 +901,16 @@ int _app_reset(bundle *b, void *data)
        if(!ad->flag_emul)
        {
                block = _add_layout(win, EDJ_APP, GRP_VOLUME_BLOCKEVENTS);
+               retvm_if(block == NULL, -1, "Failed to add block layout\n");
+
                edje_object_signal_callback_add(elm_layout_edje_get(block), "clicked", "*", _block_clicked_cb, ad);
+
                outer = _add_layout(win, EDJ_APP, GRP_VOLUME_LAYOUT);
+               retvm_if(outer== NULL, -1, "Failed to add outer layout\n");
+
                inner = _add_layout(win, EDJ_APP, "popup_volumebar");
+               retvm_if(inner == NULL, -1, "Failed to add inner layout\n");
+
                ad->block_events = block;
                ad->ly = outer;
 
index 80222b90cc922fa5c6809f88887bc4749fd34ecc..4bb43bcdef15da7dcdde887b9556ba21cf68d9c5 100755 (executable)
@@ -44,7 +44,7 @@ void _play_sound(int type, int handle)
        if (type == VOLUME_TYPE_MEDIA) {
 
        } else {
-               svi_play_sound(handle, SVI_SND_TOUCH_TOUCH1);
+               feedback_play(FEEDBACK_PATTERN_VOLUME_KEY);
        }
        feedback_deinitialize();
 }