Bluetooth: Implement dynamic blacklist method for role switch
- Blacklist the device if it's rejected the role switch for
max number of times.Same is added to the iot_devlist.conf
file.
- Maximum number of failed (BTM_MAX_SW_ROLE_FAILED_ATTEMPTS)
attempts set to 3 and it is configurable.
- Same blacklisted device is referred by the BTM module when
any other module like profile is requesting for role switch
and BTM module returns BTM_REPEATED_ATTEMPTS as the switch
role status.
- There is option to retry for role switch even though the
device is blacklisted and it can be controlled by feature
flag BTM_SAFE_REATTEMPT_ROLE_SWITCH. And by default it is
enabled.
CRs-Fixed: 831542
Change-Id: I570e1539578e60901794941ca46f0722e368a954
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 20fb5e8..3b62c9a 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -1830,6 +1830,7 @@
btif_storage_load_bonded_devices();
btif_storage_load_autopair_device_list();
+ load_iot_devlist(IOT_DEV_CONF_FILE);
btif_enable_bluetooth_evt(p_data->enable.status);
}
@@ -1847,6 +1848,7 @@
btif_in_execute_service_request(i, FALSE);
}
}
+ unload_iot_devlist();
btif_disable_bluetooth_evt();
break;