[TBT][storage][Non-ACR][TSAM-5826][Fixed as per developer comment] 16/78016/2
authorNibha Sharma <nibha.sharma@samsung.com>
Mon, 4 Jul 2016 02:39:01 +0000 (11:39 +0900)
committerNibha Sharma <nibha.sharma@samsung.com>
Mon, 4 Jul 2016 02:39:59 +0000 (19:39 -0700)
Change-Id: I8b3924281d1f71a879dd9af85e8919f78cc7193b
Signed-off-by: Nibha Sharma <nibha.sharma@samsung.com>
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk
tbtcoreapp/src/view/tbt-storage-view.c

index fbf42343b19c7d6918b83cedf16891f7e6f31f49..fcfff315d4a92e1da433e8899454ea1ac0cd892f 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index aeb9bee77b4566605cb05078ae2bbae46620b580..74691d0921adefd7d32507e0ffe290b4c16b2d9a 100644 (file)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ
index 5d3fafa34aa2abf80e4f190b1d3519251c2dfc77..801606cb43284a94a800cc78e7d43ab859bda161 100644 (file)
@@ -46,7 +46,7 @@ static void _app_destroy_cb(void* this);
 static void _storage_state_changed_cb(int storage_id, storage_state_e state, void *user_data);
 bool storage_device_supported_cb_p(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data);
 
-static int StorageID;
+static int StorageID = -1;
 static bool is_not_supported = false;
 
 /**
@@ -93,7 +93,6 @@ char* get_storage_type_error(int ret)
 */
 bool storage_device_supported_cb_p(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
 {
-       StorageID = 0;
        storage_view *this = NULL;
        this = (storage_view*) user_data;
        if(type == STORAGE_TYPE_EXTERNAL)
@@ -137,7 +136,12 @@ storage_view *storage_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object
                elm_object_text_set(popup, "Storage is not supported");
                RETVM_IF(!this->view, NULL,"Storage is not supported");
        }
-               
+         
+       if(StorageID<0)
+       {
+               DBG("There is no external storage");
+               return NULL;
+       }      
        ret = storage_set_state_changed_cb(StorageID, _storage_state_changed_cb, this);
        RETVM_IF(ret != STORAGE_ERROR_NONE, NULL, "storage_set_state_changed_cb failed : %s", get_storage_type_error(ret));
                 
@@ -172,9 +176,11 @@ static void _app_destroy_cb(void* this)
                elm_genlist_item_update(view->view->item);
        }
 
-       int ret = storage_unset_state_changed_cb( StorageID, _storage_state_changed_cb);
-       RETM_IF(ret != STORAGE_ERROR_NONE, "storage_unset_state_changed_cb fail > Error = %s", get_storage_type_error(ret));
-
+       if(StorageID >=0)
+       {
+               int ret = storage_unset_state_changed_cb( StorageID, _storage_state_changed_cb);
+               RETM_IF(ret != STORAGE_ERROR_NONE, "storage_unset_state_changed_cb fail > Error = %s", get_storage_type_error(ret));
+       }
        SAFE_DELETE(view->view);
        SAFE_DELETE(view);
 }