summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-02-17 17:26:30 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-02-21 11:45:12 +0100
commit240eec7fed2850a51e66df821ddbdf752382468e (patch)
treee5e165a7182218ee7babfafa2331bac74bddc259 /android
parentbe76f91c20f830ae984920225497bdde3719ca0d (diff)
downloadbluez-240eec7fed2850a51e66df821ddbdf752382468e.tar.gz
android: Do not resolve name if we have it in the cache
With this patch, deamon will not ask kernel to resolve name of remote device during inquiry in case device name is already in the local cache. Instead Android will be updated with already known device name.
Diffstat (limited to 'android')
-rw-r--r--android/bluetooth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 94bd8ba5b..31092e3c7 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1186,6 +1186,14 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
bool resolve_name = true;
ba2str(bdaddr, addr);
+
+ /* Don't need to confirm name if we have it already in cache
+ * Just check if device name is different than bdaddr */
+ if (g_strcmp0(dev->name, addr)) {
+ get_device_name(dev);
+ resolve_name = false;
+ }
+
info("Device %s needs name confirmation (resolve_name=%d)",
addr, resolve_name);
confirm_device_name(bdaddr, bdaddr_type, resolve_name);