OSDN Git Service

android-x86/system-bt.git
9 years agoam e1ded77a: Fix compile error in bta_ag_sco.c
Andre Eisenbach [Thu, 4 Jun 2015 20:19:47 +0000 (20:19 +0000)]
am e1ded77a: Fix compile error in bta_ag_sco.c

* commit 'e1ded77ae6d10854dc2bd1aebdd9b53442cc4ba4':
  Fix compile error in bta_ag_sco.c

9 years agoam 5b675bc4: Create listen SCO for HS1 if HS2 disconnects during SCO xfer
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:27 +0000 (19:22 +0000)]
am 5b675bc4: Create listen SCO for HS1 if HS2 disconnects during SCO xfer

* commit '5b675bc41986a159023c51b561e81939f0632f95':
  Create listen SCO for HS1 if HS2 disconnects during SCO xfer

9 years agoam 902ba021: Don\'t open SCO on state change for multi party call on DUT.
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:26 +0000 (19:22 +0000)]
am 902ba021: Don\'t open SCO on state change for multi party call on DUT.

* commit '902ba02141c5cea3320ec1746c0fe0fad80122bc':
  Don't open SCO on state change for multi party call on DUT.

9 years agoam d288b2af: Reset sniff subrating while in SCO
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:25 +0000 (19:22 +0000)]
am d288b2af: Reset sniff subrating while in SCO

* commit 'd288b2af6bf5ebb41554f223adf2e7f536d2f1e5':
  Reset sniff subrating while in SCO

9 years agoam a7ce13fe: Open SCO for held call.
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:24 +0000 (19:22 +0000)]
am a7ce13fe: Open SCO for held call.

* commit 'a7ce13feaa2a84ff329f2bbd4ab964f0f6d54f0a':
  Open SCO for held call.

9 years agoam 7b0bfd32: Update call state before opening SCO.
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:24 +0000 (19:22 +0000)]
am 7b0bfd32: Update call state before opening SCO.

* commit '7b0bfd32833a8da08069b60e6568aace90778b62':
  Update call state before opening SCO.

9 years agoam d345bb20: Handle multi party call states
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:23 +0000 (19:22 +0000)]
am d345bb20: Handle multi party call states

* commit 'd345bb208fe35923b60bca6af76b0a6e023fc56f':
  Handle multi party call states

9 years agoam c2c8a1fc: Update held call state to connected headset
Mallikarjuna GB [Thu, 4 Jun 2015 19:22:22 +0000 (19:22 +0000)]
am c2c8a1fc: Update held call state to connected headset

* commit 'c2c8a1fce4a577fc1a14a96fe96cab3043db4140':
  Update held call state to connected headset

9 years agoFix compile error in bta_ag_sco.c
Andre Eisenbach [Thu, 4 Jun 2015 18:43:57 +0000 (11:43 -0700)]
Fix compile error in bta_ag_sco.c

Change-Id: I8839ba732560a31a5e8a2351ea4bfb16999cf5ea

9 years agoCreate listen SCO for HS1 if HS2 disconnects during SCO xfer
Mallikarjuna GB [Thu, 21 May 2015 14:34:46 +0000 (20:04 +0530)]
Create listen SCO for HS1 if HS2 disconnects during SCO xfer

During SCO transfer process from HS1 to HS2, firstly active SCO for
HS1 is disconnected. However, if suddenly HS2 disconnects even
before SCO transfer is complete, listen SCO for HS1 is not created.
This causes further incoming SCO connections from HS1 to be rejected.
The change creates listen SCO for HS1 and moves SCO state properly
to LISTEN.

Change-Id: I0993c1ba1c24b3b7e9c243d179a913d7a0c40446

9 years agoDon't open SCO on state change for multi party call on DUT.
Mallikarjuna GB [Thu, 21 May 2015 14:20:27 +0000 (19:50 +0530)]
Don't open SCO on state change for multi party call on DUT.

When multi party calls(1 active, 1 held) are ongoing on phone
speaker and any of these call drops, do not open SCO for
other call since user expects call to still remain on phone
speaker.

Change-Id: I9079c809ac665fc1c6e890302e37d23a12f8d4f4

9 years agoReset sniff subrating while in SCO
Mallikarjuna GB [Thu, 21 May 2015 13:11:03 +0000 (18:41 +0530)]
Reset sniff subrating while in SCO

Sniff subrating should not be used when link is
in SCO connection. Since the subrating value is
higher, the link would take more time to process
ACL data while in SCO connection causing unwanted
results like delay in SCO disconnects.

Change-Id: I7b964faa397624b65e0158209b8743efe13a6075

9 years agoOpen SCO for held call.
Mallikarjuna GB [Sat, 30 May 2015 17:25:18 +0000 (22:55 +0530)]
Open SCO for held call.

Use case:
1. Connect to headset/carkit
2. Make an outgoing call from AG
3. Turn off BT on AG
4. Hold the call from AG
5. Turn on BT on AG (No SCO link is established here)
6. Unhold call from AG (still no SCO link is established)

Failure:
No SCO connection established when held call is there
during headset connection.

Root cause:
SCO is not initiated when SLC is done during held call.

Fix:
AG opens SCO connection when HF connected while in call and
the call was in held state.

Change-Id: I63d7655d26ddbf68cbf94c745df745cffa917b5e

9 years agoUpdate call state before opening SCO.
Mallikarjuna GB [Fri, 28 Nov 2014 04:51:15 +0000 (10:21 +0530)]
Update call state before opening SCO.

This change makes sure to update the current
call state before opening SCO connection when
incoming call is answered. Some car kits are
strict in checking this sequence and go in
bad state if not done this way.

Change-Id: Ie744dc26c02d897eaf016ee73022bfc2a0db067e

9 years agoHandle multi party call states
Mallikarjuna GB [Fri, 22 May 2015 06:26:48 +0000 (11:56 +0530)]
Handle multi party call states

UseCase:
1. Set up Bluetooth connection between phone and remote device.
2. Disconnect BT link by turning off remote device.
3. Start Mo call from phone.
4. Receive MT call from far end.
5. Turn on remote device.
6. BT connection gets established successfully, but audio
doesn't get transferred to headset.

Failure:
Call audio not routed to BT HS. SCO not established.

Root cause:
When a HS connects while in an active call and 2nd call
(incoming/outgoing/alerting) setup ongoing, incorrect post SLC
call setup updates might cause HS to get confused as phone had
already updated correct call states in CIND response during SLC.
This may cause HS to behave abnormally like delayed response to
BCS as seen with jabra wave +.

Fix:
Avoid sending incorrect call updates post SLC since we already
have sent correct updates during SLC as reponse to CIND.

Change-Id: I53e57baf7cca782af6f374a043667971c66a956d

9 years agoUpdate held call state to connected headset
Mallikarjuna GB [Thu, 21 May 2015 12:28:12 +0000 (17:58 +0530)]
Update held call state to connected headset

In a three way call scenario, when an active
call is dropped by remote, the single held call
state is not updated to the connected headset.
This change will make sure that it is updated
properly.

Change-Id: I558602e791279d510edb23989b125cd8f7a7ebde

9 years agoam a954124f: Add support for MITM for BluetoothSockets (4/4)
Casper Bonde [Wed, 3 Jun 2015 04:03:54 +0000 (04:03 +0000)]
am a954124f: Add support for MITM for BluetoothSockets (4/4)

* commit 'a954124fc5429f259e47258af64e159c621cc6e0':
  Add support for MITM for BluetoothSockets (4/4)

9 years agoAdd support for MITM for BluetoothSockets (4/4)
Casper Bonde [Thu, 21 May 2015 09:07:52 +0000 (11:07 +0200)]
Add support for MITM for BluetoothSockets (4/4)

This change adds an option to enforce Man-in-the-middle protection
for the authentication process. This feature is needed for the Sim
Access Profile.

Change-Id: I2eda507ffdcb4a194434adedf207e1e9951b80c3
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
9 years agoam 56a3be0d: Replace malloc/calloc/free with osi_malloc/osi_calloc/osi_free
Pavlin Radoslavov [Wed, 3 Jun 2015 02:22:59 +0000 (02:22 +0000)]
am 56a3be0d: Replace malloc/calloc/free with osi_malloc/osi_calloc/osi_free

* commit '56a3be0d6eaa1bc264736e399fb32d3094f0b513':
  Replace malloc/calloc/free with osi_malloc/osi_calloc/osi_free

9 years agoam 1b0f1077: SAP: Change to use new SDP Api (1/4)
Casper Bonde [Wed, 3 Jun 2015 02:22:12 +0000 (02:22 +0000)]
am 1b0f1077: SAP: Change to use new SDP Api (1/4)

* commit '1b0f107768ba1a0f93abf68851bacbe650f27eff':
  SAP: Change to use new SDP Api (1/4)

9 years agoReplace malloc/calloc/free with osi_malloc/osi_calloc/osi_free
Pavlin Radoslavov [Tue, 2 Jun 2015 20:54:58 +0000 (13:54 -0700)]
Replace malloc/calloc/free with osi_malloc/osi_calloc/osi_free

There were several leftover places that were still using
malloc/calloc/free .
Those are replaced to use osi_malloc/osi_calloc/osi_free like
majority of the rest of the code.

Note: There are few remaining places that are still using
malloc/calloc/free:
 * Some of the unit tests
 * audio_a2dp_hw/audio_a2dp_hw.c
   It is used as part of the audio.a2dp.default.so library,
   and the bluetooth.default.so library
   Its usage of malloc/calloc/free should be refactored
   independently.

Change-Id: Iafbed996e5f1ae8eb1343fb2acfadf32e515e419

9 years agoSAP: Change to use new SDP Api (1/4)
Casper Bonde [Thu, 16 Apr 2015 13:21:27 +0000 (15:21 +0200)]
SAP: Change to use new SDP Api (1/4)

Added support for Sim Access Profile (SAP) in the SDPManager.
To make it easier to test, both SDP record creation and seach
is added.

Change-Id: Idae480fb64224e0e5dec7fb07ff4efb9312a5461
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
9 years agoam 5feb0af8: Fix memory corruption due to BLE multi-adv macro
Sunny Kapdi [Tue, 2 Jun 2015 18:06:06 +0000 (18:06 +0000)]
am 5feb0af8: Fix memory corruption due to BLE multi-adv macro

* commit '5feb0af81d30dbcc33ea2ffb10714a58dd0cef09':
  Fix memory corruption due to BLE multi-adv macro

9 years agoFix memory corruption due to BLE multi-adv macro
Sunny Kapdi [Tue, 2 Jun 2015 05:21:28 +0000 (22:21 -0700)]
Fix memory corruption due to BLE multi-adv macro

INST_ID_IDX_MAX macro was not protected with parenthesis, resulting
in incorrect calculation of the size needed to allocate memory for
the client_if map.

Change-Id: Ib3591f4f9ac7288f2191e9078a71aab431ca7130

9 years agoam 87072892: HID: Handle closing of uhid driver in case failure
Hemant Gupta [Tue, 2 Jun 2015 14:25:08 +0000 (14:25 +0000)]
am 87072892: HID: Handle closing of uhid driver in case failure

* commit '87072892dc006f4c037aae0a346eda6c18e6b8ba':
  HID: Handle closing of uhid driver in case failure

9 years agoam 6ba8fda6: Add proper checks for PAN & BNEP in BD stack
Hemant Gupta [Tue, 2 Jun 2015 14:24:42 +0000 (14:24 +0000)]
am 6ba8fda6: Add proper checks for PAN & BNEP in BD stack

* commit '6ba8fda60a9137a9f53f7e14edd87184610744fc':
  Add proper checks for PAN & BNEP in BD stack

9 years agoam e11f228d: Reset pairing state to idle only for the current device
Srinu Jella [Tue, 2 Jun 2015 14:24:23 +0000 (14:24 +0000)]
am e11f228d: Reset pairing state to idle only for the current device

* commit 'e11f228d1a18486cd00c36487812a763487a236f':
  Reset pairing state to idle only for the current device

9 years agoam a9130e07: Moved the OSI alarm_shutdown() operations to alarm_cleanup()
Pavlin Radoslavov [Tue, 2 Jun 2015 14:22:28 +0000 (14:22 +0000)]
am a9130e07: Moved the OSI alarm_shutdown() operations to alarm_cleanup()

* commit 'a9130e07646835a8550611bed32138ed79385a38':
  Moved the OSI alarm_shutdown() operations to alarm_cleanup()

9 years agoam b65ec7bd: Disable the OSI allocation tracker.
Pavlin Radoslavov [Tue, 2 Jun 2015 14:21:51 +0000 (14:21 +0000)]
am b65ec7bd: Disable the OSI allocation tracker.

* commit 'b65ec7bdb30115ce0d39cf7ee1e355b61fc2a360':
  Disable the OSI allocation tracker.

9 years agoam a250280f: Check transport before subscribing for service changes
Andre Eisenbach [Tue, 2 Jun 2015 14:20:18 +0000 (14:20 +0000)]
am a250280f: Check transport before subscribing for service changes

* commit 'a250280feff8c8fa28a2e33881a2cdf73540f753':
  Check transport before subscribing for service changes

9 years agoHID: Handle closing of uhid driver in case failure
Hemant Gupta [Wed, 19 Nov 2014 13:39:54 +0000 (19:09 +0530)]
HID: Handle closing of uhid driver in case failure

This patch handles closure of the uhid driver in case of following:
- Due to concurrency of disconnection from a conencted device
  and an incoming connection request from another device, the error
  code for the ACL disconnection becomes HCI_ERR_HOST_REJECT_SECURITY
  in the stack.
- On reception of disconnection with that error codes, the uhid driver
  was not closed from the btif layer leading to issues in reconnection
  with same device that got disconnected.

Change-Id: I13c83757051850cc631aa1c24a036a2e1a4d0087

9 years agoAdd proper checks for PAN & BNEP in BD stack
Hemant Gupta [Wed, 15 Oct 2014 14:29:23 +0000 (19:59 +0530)]
Add proper checks for PAN & BNEP in BD stack

This patch fixes issues for PAN & BNEP in BD stack identified
by static analysis tool.

Change-Id: I29417dae982abb5cef11379f8d03baad11ffde8b

9 years agoReset pairing state to idle only for the current device
Srinu Jella [Thu, 13 Nov 2014 11:52:28 +0000 (17:22 +0530)]
Reset pairing state to idle only for the current device

Reset the pair state during auth complete for the BD_ADDR of the pairing
device only. The authentication complete event may come for profile level
authetication also. In such cases, if device already in paired state,
there is no need to reset the pairing state.

Change-Id: Id0ef9127895177527a6d4559ad873aa1c62a56bb

9 years agoam e35d6ccc: gn-build: Build net_test_device using GN + ninja
Miao Chou [Tue, 2 Jun 2015 05:27:19 +0000 (05:27 +0000)]
am e35d6ccc: gn-build: Build net_test_device using GN + ninja

* commit 'e35d6ccc58c52279eae36078ba3368d240f3ab1f':
  gn-build: Build net_test_device using GN + ninja

9 years agogn-build: Build net_test_device using GN + ninja
Miao Chou [Sat, 30 May 2015 04:16:19 +0000 (21:16 -0700)]
gn-build: Build net_test_device using GN + ninja

This CL adds gtest dependency to device/BUILD.gn to enable building
net_test_device using GN + ninja.

Bug: 21444879
Change-Id: I3760511d884f7b3562f86abcec96f679704ef2f4

9 years agoam 6c014aca: gn-build: Get bluetooth.default.so to compile
Arman Uguray [Tue, 2 Jun 2015 01:57:01 +0000 (01:57 +0000)]
am 6c014aca: gn-build: Get bluetooth.default.so to compile

* commit '6c014acaabf783f2f07b66695ee8bf510a2fff88':
  gn-build: Get bluetooth.default.so to compile

9 years agoam 303b6ff1: gn-build: Get //bta:bta to compile
Arman Uguray [Tue, 2 Jun 2015 00:46:58 +0000 (00:46 +0000)]
am 303b6ff1: gn-build: Get //bta:bta to compile

* commit '303b6ff16e1d257a491d2ae4fac2cd1b78850f67':
  gn-build: Get //bta:bta to compile

9 years agoam d30195cb: gn-build: Get btif to compile as its own module
Arman Uguray [Tue, 2 Jun 2015 00:35:35 +0000 (00:35 +0000)]
am d30195cb: gn-build: Get btif to compile as its own module

* commit 'd30195cbf09735da593e186c4c99cce6232b072e':
  gn-build: Get btif to compile as its own module

9 years agogn-build: Get bluetooth.default.so to compile
Arman Uguray [Fri, 29 May 2015 22:30:13 +0000 (15:30 -0700)]
gn-build: Get bluetooth.default.so to compile

Now that most of the modules here are compiled in their own static libraries,
there is no need to include their sources from main/BUILD.gn. This CL cleans
this up and adds all the missing dependencies for the //main:bluetooth.default
shared library target. Missing includes and non-Android compile errors have
always been fixed.

BUG=21339022

Change-Id: Ibcc693d5ff17aa9c446db777d4b9fbb706f8c7dd

9 years agogn-build: Get //bta:bta to compile
Arman Uguray [Fri, 29 May 2015 22:49:34 +0000 (15:49 -0700)]
gn-build: Get //bta:bta to compile

This CL gets the //bta:bta target to compile using GN + ninja.

BUG=21339022

Change-Id: I98e7ab732515b638f4f0c356a62f218ec223662a

9 years agogn-build: Get btif to compile as its own module
Arman Uguray [Fri, 29 May 2015 22:27:58 +0000 (15:27 -0700)]
gn-build: Get btif to compile as its own module

This CL adds support to build //btif:btif as its own target as a static library
by introducing a new module-level BUILD.gn file, adding missing includes, and
conditionally compiling code that is Android-specific (depends on libcutils).
This removes/breaks some functionality on non-Android builds since the
corresponding features are missing until we have a more unified replacement.

BUG=21339022

Change-Id: Ibb0372da45f256c55fa894fdda3d70319ea008c9

9 years agoMoved the OSI alarm_shutdown() operations to alarm_cleanup()
Pavlin Radoslavov [Mon, 1 Jun 2015 23:08:18 +0000 (16:08 -0700)]
Moved the OSI alarm_shutdown() operations to alarm_cleanup()

Also, removed the OSI module's start_up and shut_down steps,
because now they are no-op.

Bug: 21558791
Change-Id: I24259b327f399af57c37937111158baa9704f644

9 years agoam 17cd1274: gn-build: Get //udrv:udrv to compile
Arman Uguray [Mon, 1 Jun 2015 23:09:51 +0000 (23:09 +0000)]
am 17cd1274: gn-build: Get //udrv:udrv to compile

* commit '17cd127445af1bd8a89bb1ea419e415392f1eee3':
  gn-build: Get //udrv:udrv to compile

9 years agoam 6b5811e2: gn-build: Get //embrdv/sbc to compile
Arman Uguray [Mon, 1 Jun 2015 23:09:51 +0000 (23:09 +0000)]
am 6b5811e2: gn-build: Get //embrdv/sbc to compile

* commit '6b5811e2b4c6369738ad2d58a7d4cf4740d9a298':
  gn-build: Get //embrdv/sbc to compile

9 years agoam 24253fd1: gn-build: Compile audio.a2dp.default.so
Arman Uguray [Mon, 1 Jun 2015 23:09:50 +0000 (23:09 +0000)]
am 24253fd1: gn-build: Compile audio.a2dp.default.so

* commit '24253fd1f10e34e820d2b8bd6c0c78d342dd1591':
  gn-build: Compile audio.a2dp.default.so

9 years agoam 499282bc: gn-build: Get //utils:utils to compile
Arman Uguray [Mon, 1 Jun 2015 23:09:50 +0000 (23:09 +0000)]
am 499282bc: gn-build: Get //utils:utils to compile

* commit '499282bc6a165ef3aa76bbef4722a833a2aea675':
  gn-build: Get //utils:utils to compile

9 years agoam 6850e336: gn-build: Get //stack:stack to compile
Arman Uguray [Mon, 1 Jun 2015 22:53:50 +0000 (22:53 +0000)]
am 6850e336: gn-build: Get //stack:stack to compile

* commit '6850e3364800487eb4c7b5f9ab5a6e366a9a11eb':
  gn-build: Get //stack:stack to compile

9 years agoam a2647d0f: gn-build: Get HCI and net_test_hci to compile
Arman Uguray [Mon, 1 Jun 2015 22:53:49 +0000 (22:53 +0000)]
am a2647d0f: gn-build: Get HCI and net_test_hci to compile

* commit 'a2647d0f5b0078d95d547a96548462b910bd453c':
  gn-build: Get HCI and net_test_hci to compile

9 years agoam 2c494e15: gn-build: Clean up GN files
Arman Uguray [Mon, 1 Jun 2015 22:48:55 +0000 (22:48 +0000)]
am 2c494e15: gn-build: Clean up GN files

* commit '2c494e15583364de89ab12f417c19dc2d61efea6':
  gn-build: Clean up GN files

9 years agoam bbb12526: gn-build: Add tinyxml2 as a secondary source
Arman Uguray [Mon, 1 Jun 2015 22:48:54 +0000 (22:48 +0000)]
am bbb12526: gn-build: Add tinyxml2 as a secondary source

* commit 'bbb12526d4810511cb7c79e17fdf75b0884d8c3d':
  gn-build: Add tinyxml2 as a secondary source

9 years agogn-build: Get //udrv:udrv to compile
Arman Uguray [Fri, 29 May 2015 22:24:14 +0000 (15:24 -0700)]
gn-build: Get //udrv:udrv to compile

This patch gets the //udrv:udrv target to compile using GN + ninja as its own
build target. Since this module only contains a single file, keeping it as a
"source_set".

Change-Id: I98c3b78b374f4102b2e6e565841eaa474bef9056

9 years agogn-build: Get //embrdv/sbc to compile
Arman Uguray [Fri, 29 May 2015 22:21:43 +0000 (15:21 -0700)]
gn-build: Get //embrdv/sbc to compile

This CL builds the SBC codec that lives in embdrv/sbc to compile as a static
library. Unlike the Android build that creates two separate libraries for the
encoder and the decoder, the GN build creates a single static library.

BUG=21339022

Change-Id: I9f12e63339c850d26f49a3756526a185ca7fec8d

9 years agogn-build: Compile audio.a2dp.default.so
Arman Uguray [Fri, 29 May 2015 22:18:11 +0000 (15:18 -0700)]
gn-build: Compile audio.a2dp.default.so

This patch adds the build file to get the audio.a2dp.default shared module to
compile using GN + ninja.

BUG=21339022

Change-Id: I2c39ee49ca01f023c73b3fa675f6d9d2dc80e133

9 years agogn-build: Get //utils:utils to compile
Arman Uguray [Fri, 29 May 2015 22:10:45 +0000 (15:10 -0700)]
gn-build: Get //utils:utils to compile

This CL conditionally removes the dependency on libcutils to get the
//utils:utils static library target to compile in GN. This technically breaks
the functionality on non-Android platforms until we come up with a common way to
make the logic work.

BUG=21339022

Change-Id: I47cd8f7991942dbe43a577cef1f95626560f7f72

9 years agoDisable the OSI allocation tracker.
Pavlin Radoslavov [Mon, 1 Jun 2015 18:42:39 +0000 (11:42 -0700)]
Disable the OSI allocation tracker.

Temporary disable the allocation tracker initialization
(even for BLUEDROID_DEBUG) when initializing Bluetooth.
This is a short-term workaround solution for several issues related to
the usage of the allocation tracker.

* Inconsistent usage of osi_malloc()/osi_calloc() and osi_free()
  - Within some of the Bluetooth-related unit tests we have two copies
    of the same libosi library: one copy statically linked against the
    unit test, and another dlopen() at runtime as part of bluetooth.default.so
    Each of those copy has its own static variables.
  - For the dlopen() copy we do call allocation_tracker_init(), while for the
    static copy within the unit test we don't call allocation_tracker_init()
  - Occasionally, there is a  memory allocation via osi_calloc()
    within the dlopen()-ed library, and then it is osi_free()-ed
    within the statically linked library.
 Such (mis)usage creates issues in two ways: (1) free()-ing incorrect
 pointer, and (2) the osi hash_map() in the dlopen()-ed library still considers
 the osi-tracked memory as allocated.
 NOTE: (1) could trigger random crashes, while (2) is the reason the unit
 test triggers an assert

* Avoid potential issues that could result from the fact that calling
  allocation_tracker_init() is not mandatory; i.e., the same
  issue described above could be triggered if osi_malloc()/osi_callod()
  was called before the call to allocation_tracker_init()

* There is still code that uses malloc(3)/calloc(3) and free(3) instead
  of osi_malloc()/osi_calloc() and osi_free()

Also, add missing pthread_mutex_lock()/pthread_mutex_unlock() guards,
and fix the allocation_tracker_uninit() implementation so it works
properly even if void allocation_tracker_init() wasn't called.

Bug: 21561735
Change-Id: Ic83d6cd40af1189c4ee9c1dbfd0ad8e4666e1502

9 years agogn-build: Get //stack:stack to compile
Arman Uguray [Fri, 29 May 2015 22:07:51 +0000 (15:07 -0700)]
gn-build: Get //stack:stack to compile

This CL adds a missing include to get the //stack:stack target to compile.

BUG=21339022

Change-Id: Ie41816514c97ddcb1e4f1f0b9481364a563d8b9b

9 years agogn-build: Get HCI and net_test_hci to compile
Arman Uguray [Fri, 29 May 2015 22:01:38 +0000 (15:01 -0700)]
gn-build: Get HCI and net_test_hci to compile

This CL fixes the HCI module so that the HCI static library and the net_test_hci
unit test can be compiled using GN + ninja.

BUG=21339022,21444689

Change-Id: If3d8649b25297880e5e674a2026badb1b0e01fee

9 years agogn-build: Clean up GN files
Arman Uguray [Fri, 29 May 2015 21:43:20 +0000 (14:43 -0700)]
gn-build: Clean up GN files

Removed unnecessary library and include flags from build files. To make the
initial build outputs more similar to Android, this CL changes the usage of the
GN "source_set" idiom to "static_library". This comes at a performance loss
while keeping the builds similar until we get the whole stack to compile.

BUG=21339022

Change-Id: I46f70b3b64b2537634a1dbb517a5168566230efb

9 years agoam b8a38cc4: build: Build net_test_btcore using GN + ninja
Marie Janssen [Fri, 29 May 2015 22:23:21 +0000 (22:23 +0000)]
am b8a38cc4: build: Build net_test_btcore using GN + ninja

* commit 'b8a38cc4be1bc41135cf20b5ad344343fa9ed38c':
  build: Build net_test_btcore using GN + ninja

9 years agoam e4477781: gn-build: Add missing global compiler flags
Arman Uguray [Fri, 29 May 2015 22:23:20 +0000 (22:23 +0000)]
am e4477781: gn-build: Add missing global compiler flags

* commit 'e4477781e54bd54ff8628f5ec1ce4594324c9e9e':
  gn-build: Add missing global compiler flags

9 years agogn-build: Add tinyxml2 as a secondary source
Arman Uguray [Fri, 29 May 2015 21:30:42 +0000 (14:30 -0700)]
gn-build: Add tinyxml2 as a secondary source

Added tinyxml2 as a secondary source. Moved //build/secondary/testing to
//build/secondary/third_party in the process. This means that all third_party
sources (gtest, tinyxml2) should be placed in a top-level third_party directory.

BUG=21339022

Change-Id: If324ef1eb0d5061e005f62a80d23fef25e7e78a4

9 years agobuild: Build net_test_btcore using GN + ninja
Marie Janssen [Wed, 27 May 2015 19:36:23 +0000 (12:36 -0700)]
build: Build net_test_btcore using GN + ninja

Changes needed:
 - add gtest dependency
 - add includes to allow build on Goobuntu Trusty

Bug: 21444625
Change-Id: Ic2495258681c6b93de8d4ddb5dfff2c24248b979

9 years agogn-build: Add missing global compiler flags
Arman Uguray [Fri, 29 May 2015 21:46:30 +0000 (14:46 -0700)]
gn-build: Add missing global compiler flags

This CL introduces compiler flags that enable stripping of unused symbols out of
static libraries at the linking stage. This is used by the Android build to keep
module dependencies small while building specialized executables (such as unit
tests).

Also added a preprocessor definition for the EXPORT_SYMBOL macro, recently
introduced by icoolidge@.

BUG=21339022

Change-Id: I7d3f9f64abc1f4e080196c18ccb893443ee1b64a

9 years agoCheck transport before subscribing for service changes
Andre Eisenbach [Fri, 29 May 2015 21:05:30 +0000 (14:05 -0700)]
Check transport before subscribing for service changes

Don't subscribe to the service changed characteristic if SMP pairing
was a result of cross-key pairing.

Change-Id: Ieb4901e82060e2fa2d9d0e909e384de5f6890222
Author: Chaojing Sun <cjsun@broadcom.com>
Bug: 20894154

9 years agoam 660fd9ef: Merge "Fix use-after-free while setting advertisement data."
Ian Coolidge [Thu, 28 May 2015 20:16:27 +0000 (20:16 +0000)]
am 660fd9ef: Merge "Fix use-after-free while setting advertisement data."

* commit '660fd9ef8dad381066d797b39778ff2667631f1e':
  Fix use-after-free while setting advertisement data.

9 years agoam 05bb84c6: Handle pairing timeout during remote name request
Srinu Jella [Thu, 28 May 2015 19:29:28 +0000 (19:29 +0000)]
am 05bb84c6: Handle pairing timeout during remote name request

* commit '05bb84c66dc4813b5da13a7d2db27e80fb613293':
  Handle pairing timeout during remote name request

9 years agoHandle pairing timeout during remote name request
Srinu Jella [Wed, 8 Oct 2014 11:06:43 +0000 (16:36 +0530)]
Handle pairing timeout during remote name request

If a remote name request is in progress and a pairing timeout is
triggered, the host needs to post the bond failure to the UI and
needs to reset the pairing cb state, otherwise the UI will be stuck
in pairing mode and scanning won't work until Bluetooth is cycled
OFF->ON.

Change-Id: I76d9a83b1db7236db51617da998b5857b0de39f0

9 years agoam 8a7e179c: Reduce GATT log verbosity
Andre Eisenbach [Thu, 28 May 2015 18:53:31 +0000 (18:53 +0000)]
am 8a7e179c: Reduce GATT log verbosity

* commit '8a7e179c9ebe76c0c16a71c33bf322b77e0aa439':
  Reduce GATT log verbosity

9 years agoReduce GATT log verbosity
Andre Eisenbach [Thu, 28 May 2015 18:16:52 +0000 (11:16 -0700)]
Reduce GATT log verbosity

Change-Id: I55e6ec1afdd8a13f4401809ef89ef2d80efb7f66

9 years agoam 780afa36: Avoid null pointer exception for invalid L2CAP channels
Srinu Jella [Thu, 28 May 2015 17:37:15 +0000 (17:37 +0000)]
am 780afa36: Avoid null pointer exception for invalid L2CAP channels

* commit '780afa366705dfe53b9c69e8deb075e0bcbf31c4':
  Avoid null pointer exception for invalid L2CAP channels

9 years agoam 0d6a501d: Add missing clean_up step for the OSI module.
Pavlin Radoslavov [Thu, 28 May 2015 17:31:01 +0000 (17:31 +0000)]
am 0d6a501d: Add missing clean_up step for the OSI module.

* commit '0d6a501d0517c186f11cbee294ae2c509073de91':
  Add missing clean_up step for the OSI module.

9 years agoam 0d45f25e: DO NOT MERGE Fix use-after-free while setting advertisement data.
Ian Coolidge [Thu, 28 May 2015 17:30:45 +0000 (17:30 +0000)]
am 0d45f25e: DO NOT MERGE Fix use-after-free while setting advertisement data.

* commit '0d45f25e4102b14d942efa530f0e6a1a6c19787a':
  DO NOT MERGE Fix use-after-free while setting advertisement data.

9 years agoam f4932db3: Merge "Sniff: Use correct sniff configuration for PAN & HS" into mnc-dev
Andre Eisenbach [Thu, 28 May 2015 17:30:44 +0000 (17:30 +0000)]
am f4932db3: Merge "Sniff: Use correct sniff configuration for PAN & HS" into mnc-dev

* commit 'f4932db32e7553a9d9771e0bed2f517631eaa20c':
  Sniff: Use correct sniff configuration for PAN & HS

9 years agoAvoid null pointer exception for invalid L2CAP channels
Srinu Jella [Fri, 30 May 2014 15:45:01 +0000 (21:15 +0530)]
Avoid null pointer exception for invalid L2CAP channels

Change-Id: I8ac40e9cfe6dd015f40c6f493727e123a0d247e6

9 years agoresolved conflicts for merge of 1f81b64b to mnc-dev-plus-aosp
Ian Coolidge [Thu, 28 May 2015 16:53:38 +0000 (09:53 -0700)]
resolved conflicts for merge of 1f81b64b to mnc-dev-plus-aosp

Change-Id: I7997086b1d83bc5ee06068f82ca31c290389bc44

9 years agoMerge "Fix use-after-free while setting advertisement data."
Ian Coolidge [Thu, 28 May 2015 16:45:38 +0000 (16:45 +0000)]
Merge "Fix use-after-free while setting advertisement data."

9 years agoAdd missing clean_up step for the OSI module.
Pavlin Radoslavov [Sat, 23 May 2015 02:47:49 +0000 (19:47 -0700)]
Add missing clean_up step for the OSI module.

Now the OSI module's shut_down processing is split into "shut_down"
and "clean_up".

Previously, there was an ordering issue manipulating some of the
internal state during graceful shutdown/cleanup. Some of the modules
had two steps: shut_down, followed by clean_up, while other had only
shut_down step. This triggered the following assert in file alarm.c

    alarm_cancel: assertion "alarms != NULL" failed

Bug: 21406940
Change-Id: Iab1f033a69cbff646a6b0f346760ae82f8b00b8f

9 years agoDO NOT MERGE Fix use-after-free while setting advertisement data.
Ian Coolidge [Thu, 21 May 2015 02:59:10 +0000 (19:59 -0700)]
DO NOT MERGE Fix use-after-free while setting advertisement data.

Producer context was freeing data buffers without
performing a deep copy on the passed structure.

Also added some const correctness so we can reason
about the state of btif_adv_data_t as its data
gets associated with the advertising instance.

Bug: 21343750
Change-Id: Ifea0209e8426b61d8456c299c836ba640bd30f31

9 years agoMerge "Sniff: Use correct sniff configuration for PAN & HS" into mnc-dev
Andre Eisenbach [Thu, 28 May 2015 16:18:46 +0000 (16:18 +0000)]
Merge "Sniff: Use correct sniff configuration for PAN & HS" into mnc-dev

9 years agoSniff: Use correct sniff configuration for PAN & HS
Hemant Gupta [Thu, 15 Jan 2015 14:45:07 +0000 (20:15 +0530)]
Sniff: Use correct sniff configuration for PAN & HS

Change-Id: I95c302dd46cdcc63058c9cb3de17fdfd6ffe8d2e

9 years agoSet default symbol visibility to 'hidden'.
Ian Coolidge [Tue, 21 Apr 2015 23:25:08 +0000 (16:25 -0700)]
Set default symbol visibility to 'hidden'.

Bug: 20427982
Change-Id: I003469d6dfce681a38baa71b5709236a1a4a2189

9 years agoFix use-after-free while setting advertisement data.
Ian Coolidge [Thu, 21 May 2015 02:59:10 +0000 (19:59 -0700)]
Fix use-after-free while setting advertisement data.

Producer context was freeing data buffers without
performing a deep copy on the passed structure.

Also added some const correctness so we can reason
about the state of btif_adv_data_t as its data
gets associated with the advertising instance.

Bug: 21343750

Change-Id: Ifea0209e8426b61d8456c299c836ba640bd30f31

9 years agoam 6c56b871: Merge "A2DP audio HAL: implement get_presentation_position()" into mnc-dev
Eric Laurent [Thu, 28 May 2015 01:37:22 +0000 (01:37 +0000)]
am 6c56b871: Merge "A2DP audio HAL: implement get_presentation_position()" into mnc-dev

* commit '6c56b87166fc7893204c4dd468d873eb6cb64c03':
  A2DP audio HAL: implement get_presentation_position()

9 years agoMerge "A2DP audio HAL: implement get_presentation_position()" into mnc-dev
Eric Laurent [Thu, 28 May 2015 01:08:35 +0000 (01:08 +0000)]
Merge "A2DP audio HAL: implement get_presentation_position()" into mnc-dev

9 years agoMerge commit '82f066fa' into manualmerge
Prerepa Viswanadham [Wed, 27 May 2015 05:20:36 +0000 (22:20 -0700)]
Merge commit '82f066fa' into manualmerge

Change-Id: If90cefa8c28b1784d2403533d4d349e5dd4dfa91

9 years agoam 67a784b9: Make secure connections mode configurable
Andre Eisenbach [Wed, 27 May 2015 01:50:24 +0000 (01:50 +0000)]
am 67a784b9: Make secure connections mode configurable

* commit '67a784b9f9fc73816b9dccd18fcb3863888b444a':
  Make secure connections mode configurable

9 years agoMerge "Increase the min LE connection interval to 11.25ms" into mnc-dev
Prerepa Viswanadham [Wed, 27 May 2015 01:03:37 +0000 (01:03 +0000)]
Merge "Increase the min LE connection interval to 11.25ms" into mnc-dev

9 years agoMake secure connections mode configurable
Andre Eisenbach [Wed, 27 May 2015 00:40:12 +0000 (17:40 -0700)]
Make secure connections mode configurable

Change-Id: Id6101abc1fc339147c8b55023c7426ec1c807ee6

9 years agoIncrease the min LE connection interval to 11.25ms
Prerepa Viswanadham [Wed, 27 May 2015 00:25:38 +0000 (17:25 -0700)]
Increase the min LE connection interval to 11.25ms

To reduce audio choppiness, increase the min LE connection interval
to 11.25ms from 7.5ms

Bug: 18776956
Change-Id: I8404ebe2f9562d555a2131ae30dd63b74bb362a4

9 years agoA2DP audio HAL: implement get_presentation_position()
Eric Laurent [Tue, 26 May 2015 22:50:29 +0000 (15:50 -0700)]
A2DP audio HAL: implement get_presentation_position()

Bug: 21199150.
Change-Id: If8e95645b636be82a32420cad1ca6a3993e14f1c

9 years agoam bb6836b8: build: Build net_test_osi using GN + ninja
Arman Uguray [Tue, 26 May 2015 22:54:05 +0000 (22:54 +0000)]
am bb6836b8: build: Build net_test_osi using GN + ninja

* commit 'bb6836b8e3145522c119e9478d5c7e7df75c3890':
  build: Build net_test_osi using GN + ninja

9 years agoam cdc6f3a3: build: Add build arguments for libhardware and core dirs
Arman Uguray [Tue, 26 May 2015 22:54:05 +0000 (22:54 +0000)]
am cdc6f3a3: build: Add build arguments for libhardware and core dirs

* commit 'cdc6f3a3efb18bdbed6dad93d9537c18d15af717':
  build: Add build arguments for libhardware and core dirs

9 years agoam 5c57faaa: build: Add gtest as a secondary source
Arman Uguray [Tue, 26 May 2015 22:54:04 +0000 (22:54 +0000)]
am 5c57faaa: build: Add gtest as a secondary source

* commit '5c57faaaca6b6f10647b46cf291546501a1aa837':
  build: Add gtest as a secondary source

9 years agoam 9ca3fb82: build: Add missing copyright headers to new GN build files
Arman Uguray [Tue, 26 May 2015 22:54:03 +0000 (22:54 +0000)]
am 9ca3fb82: build: Add missing copyright headers to new GN build files

* commit '9ca3fb824639c2f15c104ca99be872e0e55035cb':
  build: Add missing copyright headers to new GN build files

9 years agobuild: Build net_test_osi using GN + ninja
Arman Uguray [Thu, 21 May 2015 20:52:25 +0000 (13:52 -0700)]
build: Build net_test_osi using GN + ninja

This CL adds support to build the net_test_osi target using GN + ninja.
The BUILD.gn file now pulls in gtest as a dependency. Missing libc
includes have been added to sources that prevented compilation on
Goobuntu (14.04).

The osi/include/log.h header has been modified to conditionally call the
Android log utilities vs plain-old printf on non-Android builds.

BUG=21339022

Change-Id: If3c356360c56c63b3bf551b41dc8d3269d8e7e09

9 years agobuild: Add build arguments for libhardware and core dirs
Arman Uguray [Thu, 21 May 2015 20:39:18 +0000 (13:39 -0700)]
build: Add build arguments for libhardware and core dirs

This patch adds GN arguments to add libhardware and core library include
paths in a generic manner.

Example args.gn file:

    libhw_include_path = "../../libhardware/include"
    core_include_path = "../../core/include"

Also introduced in this CL is the "OS_GENERIC" preprocessor define, that
will allow us to conditionally compile Android-specific vs generic code
until we shed the Android-specific dependencies.

BUG=21339022

Change-Id: I42b1cc501738653a6e886a0365c9cbef2e9a525e

9 years agobuild: Add gtest as a secondary source
Arman Uguray [Thu, 21 May 2015 20:20:01 +0000 (13:20 -0700)]
build: Add gtest as a secondary source

As a temporary solution, this CL introduces gtest as a secondary build
source. For now, gtest can be included in testonly targets as a direct
GN target dependency, by placing the gtest source under "testing/gtest"
at the root of the tree.

Moving forward, we can use solutions like gclient to pull in external
dependencies such as gtest, or we can depend on it being available on
the system.

BUG=21339022,21340407

Change-Id: I80ab3a81a53d7c29d54857a8d0cd9677fed77549

9 years agobuild: Add missing copyright headers to new GN build files
Arman Uguray [Tue, 26 May 2015 21:50:36 +0000 (14:50 -0700)]
build: Add missing copyright headers to new GN build files

BUG=21339022

Change-Id: I946fad7bf8116054f9081e064748793e79a6f85a

9 years agoam dea4f9b4: Pairing is prompted with a wrong bd-address
Satya Calloji [Sat, 23 May 2015 01:18:00 +0000 (01:18 +0000)]
am dea4f9b4: Pairing is prompted with a wrong bd-address

* commit 'dea4f9b42fd373d8a46565d933ec49a6583a9117':
  Pairing is prompted with a wrong bd-address

9 years agoPairing is prompted with a wrong bd-address
Satya Calloji [Thu, 21 May 2015 23:44:06 +0000 (16:44 -0700)]
Pairing is prompted with a wrong bd-address

Slave initiated encryption was not being notified on the correct
address and causes the key to be lost on slave device triggering
new pairing once in a while.

Change-Id: I5441a9e0bcf8ba45199483ccd02f207892ec296e