OSDN Git Service

android: Clear adapter uuids during initialization
authorMarcin Kraglak <marcin.kraglak@tieto.com>
Tue, 12 Nov 2013 15:36:24 +0000 (16:36 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 12 Nov 2013 16:59:07 +0000 (18:59 +0200)
Clear adapter uuids during init. We have to do it before
other profiles will be able to register sdp records and add
their uuids.

android/adapter.c

index 5af5256..f3281ee 100644 (file)
@@ -1207,6 +1207,17 @@ static uint8_t set_discoverable_timeout(uint8_t *timeout)
 
        return HAL_STATUS_SUCCESS;
 }
+
+static void clear_uuids(void)
+{
+       struct mgmt_cp_remove_uuid cp;
+
+       memset(&cp, 0, sizeof(cp));
+
+       mgmt_send(adapter->mgmt, MGMT_OP_REMOVE_UUID, adapter->index,
+                                       sizeof(cp), &cp, NULL, NULL, NULL);
+}
+
 static void read_info_complete(uint8_t status, uint16_t length, const void *param,
                                                        void *user_data)
 {
@@ -1247,6 +1258,8 @@ static void read_info_complete(uint8_t status, uint16_t length, const void *para
        /* TODO: Register all event notification handlers */
        register_mgmt_handlers();
 
+       clear_uuids();
+
        load_link_keys(NULL);
 
        set_io_capability();