avrc_copy_packet: Zero initialize packet

Bug: 174149901
Change-Id: Iefa41749ebbacd34afaa24131de7ee25d706e23f
Tag: Security
Test: POC
(cherry picked from commit 960c3f3c9a1f912544b92b7a744e22069a0bc27e)
(cherry picked from commit 0f447e4fffc45b10d29e1cfcc2eb66067abaf034)
1 file changed
tree: b02b1378193ac32cbe10a11b9251cbf64b18be97
  1. .clang-format
  2. .gitignore
  3. .gn
  4. .style.yapf
  5. Android.bp
  6. AndroidTestTemplate.xml
  7. BUILD.gn
  8. CleanSpec.mk
  9. EventLogTags.logtags
  11. NOTICE
  12. OWNERS
  13. PREUPLOAD.cfg
  14. README.md
  16. apex/
  17. audio_a2dp_hw/
  18. audio_bluetooth_hw/
  19. audio_hal_interface/
  20. audio_hearing_aid_hw/
  21. binder/
  22. bta/
  23. btcore/
  24. btif/
  25. build/
  26. common/
  27. conf/
  28. device/
  29. doc/
  30. embdrv/
  31. gd/
  32. hci/
  33. include/
  34. internal_include/
  35. linux_include/
  36. main/
  37. osi/
  38. packet/
  39. profile/
  40. proto/
  41. service/
  42. stack/
  43. test/
  44. tools/
  45. types/
  46. udrv/
  47. utils/
  48. vendor_libs/
  49. vnd/

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/system/bt

Install dependencies (require sudo access):

cd ~/fluoride/bt

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

Generate your build files

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

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 system/bt
gn gen --ide=eclipse out/Default
  1. In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML location under system/bt/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”