commit | af94891aa6e66b0d4b495d60aeac2aa8091c9d33 | [log] [tgz] |
---|---|---|
author | Hemant Gupta <hemantg@codeaurora.org> | Thu Jan 11 15:22:49 2018 +0530 |
committer | Myles Watson <mylesgw@google.com> | Thu Jan 11 17:10:00 2018 +0000 |
tree | 69cbcf1ab10b483332dec4a73c0608fe701701e0 | |
parent | 9f9c47683e28a0cf99b308deeac04073a9528c59 [diff] |
HID: Update condition for checking LE HID handle validity 1) Pair and connect with BR/EDR HID devices and LE devices such that the total number of connected paired devices becomes 7. It is not required that connection to all devices be maintained, they can be disconnected as well afterwards. 2) Pair and connect with a new LE device. Connection fails 3) Retry connecting to same LE device. Connection does not go through 4) Turn BT off Observed Result: 1) LE device cannot be connected in step 2 2) Tombstone in BT while switching off BT with below signature backtrace: #00 pc 0000000000092438 /system/lib64/libc.so (ifree+88) #01 pc 000000000009298c /system/lib64/libc.so (je_free+120) #02 pc 00000000001b266c /system/lib64/hw/bluetooth.default.so (_Z18osi_free_and_resetPPv+84) #03 pc 0000000000062f84 /system/lib64/hw/bluetooth.default.so (_Z17bta_hh_sm_executeP14tBTA_HH_DEV_CBtP12tBTA_HH_DATA+880) #04 pc 0000000000063120 /system/lib64/hw/bluetooth.default.so (_Z16bta_hh_hdl_eventP6BT_HDR+296) #05 pc 000000000007bbc4 /system/lib64/hw/bluetooth.default.so (_Z13bta_sys_eventP6BT_HDR+60) #06 pc 00000000001b4d88 /system/lib64/hw/bluetooth.default.so (_ZL22internal_dequeue_readyPv+80) #07 pc 00000000001b96f4 /system/lib64/hw/bluetooth.default.so (_ZL11run_reactorP9reactor_ti+312) #08 pc 00000000001b9590 /system/lib64/hw/bluetooth.default.so (_Z13reactor_startP9reactor_t+80) #09 pc 00000000001baf24 /system/lib64/hw/bluetooth.default.so (_ZL10run_threadPv+256) #10 pc 0000000000067bc4 /system/lib64/libc.so (_ZL15__pthread_startPv+36) #11 pc 000000000001f264 /system/lib64/libc.so (__start_thread+68) Root Cause: Wrong conditional check in macro BTA_HH_IS_LE_DEV_HDL_VALID which ignores the condition that max 14 HID devices can be connected and all of them can be LE as well. Fix: Update the condition in macro BTA_HH_IS_LE_DEV_HDL_VALID to compare with BTA_HH_MAX_DEVICE instead of BTA_HH_LE_MAX_KNOWN Test: Not yet performed, only code and log analysis Fixes: 71842479 Change-Id: I2b56b6f109787608e25c340150be313f0f5397be
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/system/bt
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 system/bt is checked out under AOSP, then create symbolic links instead of downloading sources
cd system/bt 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 system/bt gn gen --ide=eclipse out/Default
In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML location under system/bt/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”