OSDN Git Service

android: Detect adapter removal in daemon and exit
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 23 Oct 2013 07:20:30 +0000 (10:20 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 23 Oct 2013 07:20:30 +0000 (10:20 +0300)
android/main.c

index 5e297f7..e13e5b0 100644 (file)
@@ -382,6 +382,12 @@ static void mgmt_index_removed_event(uint16_t index, uint16_t length,
                                        const void *param, void *user_data)
 {
        DBG("index %u", index);
+
+       if (index != adapter_index)
+               return;
+
+       error("Adapter was removed. Exiting.");
+       g_main_loop_quit(event_loop);
 }
 
 static void read_index_list_complete(uint8_t status, uint16_t length,