Fix the PLM Issue (No Bluetooth Device message appears twice)
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 27 Aug 2012 01:22:53 +0000 (10:22 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Aug 2012 06:51:12 +0000 (15:51 +0900)
[Issue] P120824-0217

[Problem] When the bluetooth device not found by search, Popup message appears twice

[Cause] Even if UG is not in searching state, it is possible to recieve
        the searching complete event. In this case, this bug will be occured.

[Fix] Add the depending codes

Change-Id: Ibfc36d048b92d7957cb6af583b30d338246fc242

debian/changelog
packaging/ug-bluetooth-efl.spec
src/libraries/bt-callback.c

index 141b6f122f4c762cc08c1bfcef75c880d401ec41..712d6ef7af5655051e46456b6c5aac5d49cf5b41 100644 (file)
@@ -1,3 +1,11 @@
+ug-setting-bluetooth-efl (0.2.109) unstable; urgency=low
+
+  * Upload the package
+  * Git: magnolia/apps/home/ug-bluetooth-efl
+  * Tag: ug-setting-bluetooth-efl_0.2.109
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Mon, 27 Aug 2012 10:10:27 +0900
+
 ug-setting-bluetooth-efl (0.2.108) unstable; urgency=low
 
   * Upload the package
index bd88ac6e27c4c4fc1113522007909c983e6ba318..08c7aacac4a995efd8a078614e567427f1419806 100644 (file)
@@ -5,7 +5,7 @@
 
 Name:       ug-bluetooth-efl
 Summary:    UI gadget about the bluetooth
-Version: 0.2.108
+Version: 0.2.109
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    TO BE FILLED IN
index 59ced7e3b52ba720dd32085d0164b7f170b7a49a..424e39ded787fd40670215474919aa14243f7a69 100644 (file)
@@ -48,6 +48,8 @@ static void __bt_cb_auto_discovery(void *data)
        /* If there is no paired devices, device searching starts. */
        if (ugd->search_req == TRUE ||
             eina_list_count(ugd->paired_device) == 0) {
+               _bt_main_remove_all_searched_devices(ugd);
+
                ret = bt_adapter_start_device_discovery();
                if (!ret) {
                        ugd->op_status = BT_SEARCHING;
@@ -207,6 +209,8 @@ static void __bt_cb_search_completed(int result, void *data)
 
        if (ugd->searched_device == NULL ||
             eina_list_count(ugd->searched_device) == 0) {
+               /* Don't add the no device item, if no device item already exist */
+               ret_if(ugd->no_device_item != NULL);
                ugd->no_device_item = _bt_main_add_no_device_found(ugd);
        }
 
@@ -291,9 +295,6 @@ static void __bt_cb_new_device_found(bt_adapter_device_discovery_info_s *info,
 
        ugd = (bt_ug_data *)data;
 
-       /* This UG is not in the searching state. */
-       ret_if(ugd->op_status != BT_SEARCHING);
-
        /* Check the service_class */
        if (__bt_cb_match_discovery_type(
                                info->bt_class.major_device_class,
@@ -365,6 +366,15 @@ void _bt_cb_discovery_state_changed(int result,
 {
        FN_START;
 
+       bt_ug_data *ugd = NULL;
+
+       ret_if(user_data == NULL);
+
+       ugd = (bt_ug_data *)user_data;
+
+       /* This UG is not in the searching state. */
+       ret_if(ugd->op_status != BT_SEARCHING);
+
        if (discovery_state == BT_ADAPTER_DEVICE_DISCOVERY_FOUND)
                __bt_cb_new_device_found(discovery_info, user_data);
        else if (discovery_state == BT_ADAPTER_DEVICE_DISCOVERY_FINISHED)
@@ -471,6 +481,11 @@ void _bt_cb_bonding_destroyed(int result, char *remote_address,
 
                        _bt_main_remove_paired_device(ugd, item);
 
+                       if (ugd->no_device_item) {
+                               elm_object_item_del(ugd->no_device_item);
+                               ugd->no_device_item = NULL;
+                       }
+
                        if (_bt_main_add_searched_device(ugd, new_item) != NULL) {
                                ugd->searched_device = eina_list_append(
                                                ugd->searched_device, new_item);