OSDN Git Service

Update device type in NVRAM correctly during inquiry
authorSubramanian Srinivasan <subrsrin@codeaurora.org>
Thu, 23 Jul 2015 22:05:05 +0000 (15:05 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 4 Mar 2016 22:00:03 +0000 (22:00 +0000)
If the NVRAM device type for a device is not dual mode and the inquiry
result is received for BLE or BR/EDR transport, then this patch updates
the NVRAM device type to dual mode.

Change-Id: I688e7c5e3bd8d844288d095cb97c2e55ddf652c6

btif/src/btif_dm.c

index ab74dab..357ce0c 100644 (file)
@@ -1406,9 +1406,9 @@ static void btif_dm_search_devices_evt (UINT16 event, char *p_param)
                 /* Verify if the device is dual mode in NVRAM */
                 int stored_device_type = 0;
                 if (btif_get_device_type(bdaddr.address, &stored_device_type) &&
-                    ((stored_device_type == BT_DEVICE_TYPE_BLE &&
+                    ((stored_device_type != BT_DEVICE_TYPE_BREDR &&
                         p_search_data->inq_res.device_type == BT_DEVICE_TYPE_BREDR) ||
-                     (stored_device_type == BT_DEVICE_TYPE_BREDR &&
+                     (stored_device_type != BT_DEVICE_TYPE_BLE &&
                         p_search_data->inq_res.device_type == BT_DEVICE_TYPE_BLE))) {
                     dev_type = BT_DEVICE_TYPE_DUMO;
                 } else {