BLE: Updating the WL if addr_type is not matched for same BDaddr
Issue:
Connection is not happening with same remote device after BT
reset.
Steps to Repro:
1. Scan and connect to remote device with "Random" address
2. Toggle BT OFF and ON
3. Without scanning, App tries to connect to remote device and
device gets added as default "Public" addr_type in WL
4. Connection doesn't go through (as expected) since remote device
has "Random" address
5. App cancels the attempt or 30 sec direct connection timeout
happens. The device is marked for removal
6. App scans for the device and the correct addr_type (Random)
is now in the inquiry database in stack
7. App initiates connection for the device but the connection
attempt still goes with "Public" address type and hence never
succeeds.
RootCause:
At step 5, stack just marks the device to be removed from whitelist
(pending_removal) but doesn't actually remove it from Controller
until the next WL connection is needed. Later in step 7, when the
WL connection is needed from the App, stack attempts to add the
device to the whitelist, but realizes that the device is already in
the Controller whitelist and hence doesn't do remove and add.
There is no check to see if the device in Controller's WL is with
correct addr_type.
Fix:
When checking for remote addr that needs to be added/removed
from WL, also take into the account the remote addr_type.
Test:
Tested with the fix multiple times. Issue not seen with this fix.
Bug:
140085561
Change-Id: I415b5fa29800b975c2ebcbf95b36cf8879841b3e