[LSC] Add LOCAL_LICENSE_KINDS to system/bt

Added SPDX-license-identifier-Apache-2.0 to:
  apex/Android.bp
  audio_a2dp_hw/Android.bp
  audio_bluetooth_hw/Android.bp
  audio_hal_interface/Android.bp
  audio_hearing_aid_hw/Android.bp
  binder/Android.bp
  bta/Android.bp
  btcore/Android.bp
  btif/Android.bp
  build/Android.bp
  common/Android.bp
  conf/Android.bp
  device/Android.bp
  embdrv/g722/fuzzer/Android.bp
  embdrv/sbc/Android.bp
  embdrv/sbc/decoder/Android.bp
  embdrv/sbc/encoder/Android.bp
  gd/att/Android.bp
  gd/common/Android.bp
  gd/dumpsys/Android.bp
  gd/dumpsys/bundler/Android.bp
  gd/fuzz/Android.bp
  gd/hal/Android.bp
  gd/hci/Android.bp
  gd/iso/Android.bp
  gd/l2cap/Android.bp
  gd/l2cap/fuzz/Android.bp
  gd/neighbor/Android.bp
  gd/os/Android.bp
  gd/packet/Android.bp
  gd/packet/parser/Android.bp
  gd/packet/parser/test/Android.bp
  gd/proto/Android.bp
  gd/rust/common/Android.bp
  gd/rust/facade/Android.bp
  gd/rust/gddi/Android.bp
  gd/rust/hal/Android.bp
  gd/rust/hci/Android.bp
  gd/rust/link/Android.bp
  gd/rust/main/Android.bp
  gd/rust/shim/Android.bp
  gd/security/Android.bp
  gd/security/channel/Android.bp
  gd/security/pairing/Android.bp
  gd/security/record/Android.bp
  gd/shim/Android.bp
  gd/storage/Android.bp
  hci/Android.bp
  include/Android.bp
  internal_include/Android.bp
  main/Android.bp
  main/shim/Android.bp
  osi/test/fuzzers/Android.bp
  osi/test/fuzzers/alarm/Android.bp
  osi/test/fuzzers/allocation_tracker/Android.bp
  osi/test/fuzzers/allocator/Android.bp
  osi/test/fuzzers/array/Android.bp
  osi/test/fuzzers/buffer/Android.bp
  osi/test/fuzzers/compat/Android.bp
  osi/test/fuzzers/fixed_queue/Android.bp
  osi/test/fuzzers/future/Android.bp
  osi/test/fuzzers/list/Android.bp
  osi/test/fuzzers/ringbuffer/Android.bp
  packet/Android.bp
  packet/avrcp/Android.bp
  packet/base/Android.bp
  packet/tests/fuzzers/Android.bp
  profile/avrcp/Android.bp
  profile/sdp/Android.bp
  service/Android.bp
  service/common/Android.bp
  stack/test/fuzzers/Android.bp
  stack/test/fuzzers/a2dp/Android.bp
  stack/test/fuzzers/a2dp/codec/Android.bp
  stack/test/fuzzers/sdp/Android.bp
  test/Android.bp
  test/headless/Android.bp
  test/rootcanal/Android.bp
  test/suite/Android.bp
  types/Android.bp
  udrv/Android.bp
  utils/Android.bp
  vendor_libs/Android.bp
  vendor_libs/linux/Android.bp
  vendor_libs/linux/interface/Android.bp
  vendor_libs/test_vendor_lib/Android.bp
  vendor_libs/test_vendor_lib/types/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  gd/Android.bp
  gd/crypto_toolbox/Android.bp
  stack/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    legacy_unencumbered
to:
  embdrv/g722/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  osi/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I883bd6b68223a5bc77fdac89e0280993f617d6d0
93 files changed
tree: 124c80aea47dfaa9aef64b2b8a84cc04e598f7c7
  1. apex/
  2. system/
  3. .clang-format
  4. .gitignore
  5. .style.yapf
  6. Android.bp
  7. AndroidTestTemplate.xml
  8. BUILD.gn
  9. CleanSpec.mk
  10. EventLogTags.logtags
  11. METADATA
  12. MODULE_LICENSE_APACHE2
  13. NOTICE
  14. OWNERS
  15. PREUPLOAD.cfg
  16. README.md
  17. TEST_MAPPING
README.md

Fluoride Bluetooth stack

Building and running on AOSP

Just build AOSP - Fluoride is there by default.

Building and running on Linux

Instructions for Ubuntu, tested on 14.04 with Clang 3.5.0 and 16.10 with Clang 3.8.0

Download source

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

Generate your build files

cd ~/fluoride/bt
gn gen out/Default

Build

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.

Run

cd ~/fluoride/bt/out/Default
LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride

Eclipse IDE Support

  1. Follows the Chromium project Eclipse Setup Instructions until "Optional: Building inside Eclipse" section (don't do that section, we will set it up differently)

  2. Generate Eclipse settings:

cd packages/modules/Bluetooth/system
gn gen --ide=eclipse out/Default
  1. In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML location under packages/modules/Bluetooth/system/out/Default

  2. 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"

  3. Goto Behaviour tab, change clean command to "-t clean"