commit | 7577cd7bf39fb29714efa83e31340e92599f635f | [log] [tgz] |
---|---|---|
author | Jakub Pawlowski <jpawlowski@google.com> | Thu Apr 27 04:52:34 2017 -0700 |
committer | Jacky Cheung <jackyc@google.com> | Fri Apr 28 13:04:24 2017 -0700 |
tree | 7c04384a4cdc88b7ddb20f8f4f83d00fe1dce052 | |
parent | a36562694348da5c8659805779d491a6f675d31f [diff] |
DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing When a device connect to android over LE, the default policy is to keep this connection. If any app "claims" this connnection, and then stop using it, we'll disconnect from the device after a short timeout. If pairing is triggered to such device, that is connected but not used by any app, it will cause disconnect after the pairing is finished. This is because using SMP over fixed LE L2CAP channel is conseidered as connecting, using, and disconnecting a channel by the stack. This is obvious logic error - using fixed channels should not require "connecting" to them. As a temporary workaround, do not trigger a timeout when a fixed SMP channel is closed over LE. For LE only devices, this means they will stay connected after the pairing until some app starts using them or they disconnect. For dual mode devices, Classic connection will be established and SDP will be performed. The classic connection will be disconnected if no app will use it, and the LE connection to the device will stay up. Bug: 37352720 Test: manual Change-Id: Ic9d688aacf84e0267277b12b28dfa7cc57fdcea6 (cherry picked from commit 7c8bab231328956d3b7569280cb162be4e345422)
Just build AOSP - Fluoride is there by default.
Instructions for Ubuntu, tested on 15.10 with GCC 5.2.1.
sudo apt-get install libevent-dev
sudo apt-get install ninja-build
or download binary from https://github.com/ninja-build/ninja/releases
Get sha1 of current version from here and then download corresponding executable:
wget -O gn http://storage.googleapis.com/chromium-gn/<gn.sha1>
i.e. if sha1 is "3491f6687bd9f19946035700eb84ce3eed18c5fa" (value from 24 Feb 2016) do
wget -O gn http://storage.googleapis.com/chromium-gn/3491f6687bd9f19946035700eb84ce3eed18c5fa
Then make binary executable and put it on your PATH, i.e.:
chmod a+x ./gn sudo mv ./gn /usr/bin
mkdir ~/fluoride cd ~/fluoride git clone https://android.googlesource.com/platform/system/bt
Then fetch third party dependencies:
cd ~/fluoride/bt mkdir third_party git clone https://github.com/google/googletest.git git clone https://android.googlesource.com/platform/external/libchrome 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
Fluoride currently has dependency on some internal Android projects, which also need to be downloaded. This will be removed in future:
cd ~/fluoride git clone https://android.googlesource.com/platform/system/core git clone https://android.googlesource.com/platform/hardware/libhardware git clone https://android.googlesource.com/platform/system/media
We need to configure some paths to make the build successful. Run:
cd ~/fluoride/bt gn args out/Default
This will prompt you to fill the contents of your "out/Default/args.gn" file. Make it look like below. Replace "/home/job" with path to your home directory, and don't use "~" in build arguments:
# Build arguments go here. Examples: # is_component_build = true # is_debug = false # See "gn args <out_dir> --list" for available build arguments. libhw_include_path = "/home/job/fluoride/libhardware/include" core_include_path = "/home/job/fluoride/core/include" audio_include_path = "/home/job/fluoride/media/audio/include"
Then generate your build files by calling
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