Do not load a dev info if no technology has 94/101494/1
authorSeungyoun Ju <sy39.ju@samsung.com>
Wed, 30 Nov 2016 05:30:12 +0000 (14:30 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 1 Dec 2016 09:09:59 +0000 (18:09 +0900)
[Problem] Old storage could have invalid directory. It causes paired
list corrupted
[Cause & Measure] Old bluez has some issues to store CSRK. It makes
invalid directory. It should be ignored when devices are loaded from
storage.

Change-Id: Ib18a4050f1d86145b2f53f8fff7629aebdff43ff
Signed-off-by: Injun Yang <injun.yang@samsung.com>
src/adapter.c

index 0193fdd..70f7064 100644 (file)
@@ -7599,7 +7599,7 @@ static uint8_t get_addr_type(GKeyFile *keyfile)
        techno = g_key_file_get_string_list(keyfile, "General",
                                        "SupportedTechnologies", NULL, NULL);
        if (!techno)
-               return BDADDR_BREDR;
+               return 0xff;
 
        for (t = techno; *t; t++) {
                if (g_str_equal(*t, "LE"))
@@ -7719,6 +7719,10 @@ static void load_devices(struct btd_adapter *adapter)
 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
                str2ba(entry->d_name, &addr.bdaddr);
                addr.bdaddr_type = get_addr_type(key_file);
+               if (addr.bdaddr_type == 0xff) {
+                       error("No SupportedTechnologies. Skipping");
+                       goto free;
+               }
 
                list = g_slist_find_custom(adapter->devices, &addr,
                                                device_addr_type_strict_cmp);