commit | 0a2e52cb040e7bc0724666983bf9b072d94e7a1b | [log] [tgz] |
---|---|---|
author | Janardhana Rao Bokka <quic_jbokka@quicinc.com> | Tue Sep 10 10:01:16 2019 +0530 |
committer | Jakub Pawlowski <jpawlowski@google.com> | Wed Sep 11 08:33:36 2019 +0200 |
tree | 596c20c8c40cc83fd9efcb5b0d436f9b262d1e2e | |
parent | 86b58d4899abb75593601ec3098b15bd91588c67 [diff] |
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
Just build AOSP - Fluoride is there by default.
Instructions for Ubuntu, tested on 14.04 with Clang 3.5.0 and 16.10 with Clang 3.8.0
mkdir ~/fluoride cd ~/fluoride git clone https://android.googlesource.com/platform/packages/modules/Bluetooth/system
Install dependencies (require sudo access):
cd ~/fluoride/bt build/install_deps.sh
Then fetch third party dependencies:
cd ~/fluoride/bt mkdir third_party cd third_party git clone https://github.com/google/googletest.git git clone https://android.googlesource.com/platform/external/aac git clone https://android.googlesource.com/platform/external/libchrome git clone https://android.googlesource.com/platform/external/libldac git clone https://android.googlesource.com/platform/external/modp_b64 git clone https://android.googlesource.com/platform/external/tinyxml2
And third party dependencies of third party dependencies:
cd fluoride/bt/third_party/libchrome/base/third_party mkdir valgrind cd valgrind curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/valgrind.h?format=TEXT | base64 -d > valgrind.h curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
NOTE: If packages/modules/Bluetooth/system is checked out under AOSP, then create symbolic links instead of downloading sources
cd packages/modules/Bluetooth/system mkdir third_party cd third_party ln -s ../../../external/aac aac ln -s ../../../external/libchrome libchrome ln -s ../../../external/libldac libldac ln -s ../../../external/modp_b64 modp_b64 ln -s ../../../external/tinyxml2 tinyxml2 ln -s ../../../external/googletest googletest
cd ~/fluoride/bt gn gen out/Default
cd ~/fluoride/bt ninja -C out/Default all
This will build all targets (the shared library, executables, tests, etc) and put them in out/Default. To build an individual target, replace "all" with the target of your choice, e.g. ninja -C out/Default net_test_osi
.
cd ~/fluoride/bt/out/Default LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride
Follows the Chromium project Eclipse Setup Instructions until "Optional: Building inside Eclipse" section (don't do that section, we will set it up differently)
Generate Eclipse settings:
cd packages/modules/Bluetooth/system gn gen --ide=eclipse out/Default
In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML location under packages/modules/Bluetooth/system/out/Default
Right click on the project. Go to Preferences->C/C++ Build->Builder Settings. Uncheck "Use default build command", but instead using "ninja -C out/Default"
Goto Behaviour tab, change clean command to "-t clean"