OSDN Git Service

android-x86/system-bt.git
6 years agoGet rid of BTA_SYS_DM - use do_in_bta_thread instead am: 0d4868040f am: ccd75ed157
Jakub Pawlowski [Wed, 24 Jan 2018 23:06:03 +0000 (23:06 +0000)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead am: 0d4868040f am: ccd75ed157
am: a512b6f2c8

Change-Id: I7e30b91576af3b976e01f9a9b5bbff252e527011

6 years agoGet rid of BTA_SYS_DM - use do_in_bta_thread instead am: 0d4868040f
Jakub Pawlowski [Wed, 24 Jan 2018 20:58:49 +0000 (20:58 +0000)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead am: 0d4868040f
am: ccd75ed157

Change-Id: I5eccfce4aa6c27df33f51786ad4bf74032a68bfc

6 years agoGet rid of BTA_SYS_DM - use do_in_bta_thread instead
Jakub Pawlowski [Wed, 24 Jan 2018 20:55:22 +0000 (20:55 +0000)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead
am: 0d4868040f

Change-Id: I3ce30945bd3127204161d81d3a9bf3dafeb77a0a

6 years agoGet rid of BTA_SYS_DM - use do_in_bta_thread instead
Jakub Pawlowski [Tue, 23 Jan 2018 20:46:07 +0000 (12:46 -0800)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead

Test: Bond, change device name, scan for classic devices
Change-Id: If8d95976c4bb9ee6f346682590285cfc9d163ff5

6 years agoHFP: Add support for Multi-HFP (2/2) am: ca7d6f5912 am: 35f2dae044
Jack He [Wed, 24 Jan 2018 19:54:15 +0000 (19:54 +0000)]
HFP: Add support for Multi-HFP (2/2) am: ca7d6f5912 am: 35f2dae044
am: cfd374515e

Change-Id: I404e225a5c7bbd8a51153b8b3c7e6896abc8252d

6 years agoHFP: Add support for Multi-HFP (2/2) am: ca7d6f5912
Jack He [Wed, 24 Jan 2018 19:47:13 +0000 (19:47 +0000)]
HFP: Add support for Multi-HFP (2/2) am: ca7d6f5912
am: 35f2dae044

Change-Id: Ic13fa9eea73258ee5ec2797adc62dd5d2234762f

6 years agoHFP: Add support for Multi-HFP (2/2)
Jack He [Wed, 24 Jan 2018 19:42:43 +0000 (19:42 +0000)]
HFP: Add support for Multi-HFP (2/2)
am: ca7d6f5912

Change-Id: Ia80e37d828827b70cab4465b8d9044dd463ee8a3

6 years agoHFP: Add support for Multi-HFP (2/2)
Jack He [Wed, 10 Jan 2018 10:34:05 +0000 (02:34 -0800)]
HFP: Add support for Multi-HFP (2/2)

* Allocate at most 6 control blocks for btif_hf and bta_ag,
  this limit is defined by BTA_AG_MAX_NUM_CLIENTS
* Allow at most 6 RFCOMM connections to be managed by bta_ag
* Allow at most 6 SDP callbacks for each bta_ag
* Reject incoming SCO connection and do not start outgoing SCO
  connection if not coming from the current active device
* Reject incoming AT+BCC request if the remote device is not an active
  device
* Support only one device by default
* Fixed a bug in BTM_CreateSco where power mode was checked for old
  device and new power mode is set for new device and caused BTM SCO
  state machine to stuck in SCO_ST_PEND_UNPARK mode
* Added logs at failure conditions to be more verbose about connection
  errors and removed logs from non-error conditions to reduce verbosity
  in normal conditions

Bug: 68952570
Test: runtest -j40 bluetooth, native unit tests, HFP regression for 1
      device, simple tests for multiple devices
Change-Id: I97d20f6a126d77a4ef3a0cd1706b48130b4a6aae

6 years agoMinor improvements in LE Create Connection handling am: 659e34f343 am: 418eed965e
Jakub Pawlowski [Wed, 24 Jan 2018 16:00:09 +0000 (16:00 +0000)]
Minor improvements in LE Create Connection handling am: 659e34f343 am: 418eed965e
am: f9b4369e26

Change-Id: I6961f871ececd8ff5320be62501e32994404d581

6 years agoMinor improvements in LE Create Connection handling am: 659e34f343
Jakub Pawlowski [Wed, 24 Jan 2018 15:56:36 +0000 (15:56 +0000)]
Minor improvements in LE Create Connection handling am: 659e34f343
am: 418eed965e

Change-Id: I93d7415bc612de7c0679a15add60c26a55f7ec2c

6 years agoMinor improvements in LE Create Connection handling
Jakub Pawlowski [Wed, 24 Jan 2018 15:55:08 +0000 (15:55 +0000)]
Minor improvements in LE Create Connection handling
am: 659e34f343

Change-Id: I8153117afffb8b1fca50a33b3da9d23779558cbe

6 years agoMerge "Revert "Audio V4: Split system and vendor Audio.h""
Kevin Rocard [Wed, 24 Jan 2018 06:26:16 +0000 (06:26 +0000)]
Merge "Revert "Audio V4: Split system and vendor Audio.h""

6 years agoRevert "Audio V4: Split system and vendor Audio.h"
Kevin Rocard [Wed, 24 Jan 2018 06:13:51 +0000 (06:13 +0000)]
Revert "Audio V4: Split system and vendor Audio.h"

This reverts commit 68cbb98c8dd5ea4e9892c1ca31ea917069d32c0e.

Reason for revert: Breaks the build of multiple devices

Change-Id: Iec3058053a8ce3560b5f1fc9563e653badbaaca8

6 years agoMerge "Audio V4: Split system and vendor Audio.h"
Kevin Rocard [Wed, 24 Jan 2018 04:04:47 +0000 (04:04 +0000)]
Merge "Audio V4: Split system and vendor Audio.h"

6 years agoMinor improvements in LE Create Connection handling
Jakub Pawlowski [Tue, 23 Jan 2018 17:07:59 +0000 (09:07 -0800)]
Minor improvements in LE Create Connection handling

1. According to spec, controller should never send "Command Complete" event
after "LE Create Connection" or "LE Extened Create Connection" command.
Add error message in such case.

2. Parse Comand Status for LE Enhanced Create Connection.

3. Fix NPE in btm_ble_update_mode_operation, when called from
btm_ble_create_ll_conn_complete.

Test: Bond/unbond with few LE devices while connected.
Change-Id: Ic135d9a8d096634afe33997afb42d054237598c2

6 years agoMerge "Allow L2CAP first packet with partial header" am: 8535edaade am: ef83681de9
Stanley Tng [Tue, 23 Jan 2018 21:08:03 +0000 (21:08 +0000)]
Merge "Allow L2CAP first packet with partial header" am: 8535edaade am: ef83681de9
am: 27478a0e24

Change-Id: I53046bef0daddd516a2a02813b85a0f44057d8bd

6 years agoMerge "Allow L2CAP first packet with partial header" am: 8535edaade
Stanley Tng [Tue, 23 Jan 2018 20:09:56 +0000 (20:09 +0000)]
Merge "Allow L2CAP first packet with partial header" am: 8535edaade
am: ef83681de9

Change-Id: I8b72178c34750ffa2c16af7676377e723d9556ad

6 years agoMerge "Allow L2CAP first packet with partial header"
Stanley Tng [Tue, 23 Jan 2018 19:42:38 +0000 (19:42 +0000)]
Merge "Allow L2CAP first packet with partial header"
am: 8535edaade

Change-Id: I6f2bbbe5a77bd393455b2af00f473e6473d0072e

6 years agoMerge "Allow L2CAP first packet with partial header"
Treehugger Robot [Tue, 23 Jan 2018 19:00:57 +0000 (19:00 +0000)]
Merge "Allow L2CAP first packet with partial header"

6 years agoRemove L2CAP_MASK_LE_COC_CHANNEL flag in channel number am: a34e9b4823 am: 928276cb5f
Stanley Tng [Tue, 23 Jan 2018 16:48:38 +0000 (16:48 +0000)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number am: a34e9b4823 am: 928276cb5f
am: 194c4e76ef

Change-Id: I1667852a4dbcc3cba2741d4f8fce2492dc86bed0

6 years agoRemove L2CAP_MASK_LE_COC_CHANNEL flag in channel number am: a34e9b4823
Stanley Tng [Tue, 23 Jan 2018 16:44:19 +0000 (16:44 +0000)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number am: a34e9b4823
am: 928276cb5f

Change-Id: I1e796a1595b0a89203ce6fc766ee25180b537035

6 years agoRemove L2CAP_MASK_LE_COC_CHANNEL flag in channel number
Stanley Tng [Tue, 23 Jan 2018 16:39:10 +0000 (16:39 +0000)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number
am: a34e9b4823

Change-Id: Ia922c148fcaa38206cb060cbba5b897b5744fed6

6 years agoRemove L2CAP_MASK_LE_COC_CHANNEL flag in channel number
Stanley Tng [Fri, 5 Jan 2018 17:25:11 +0000 (09:25 -0800)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number

Cleanup the code by removing the use of L2CAP_MASK_LE_COC_CHANNEL flag
in the channel number. This flag will be passed in the proper "flags"
parameter.

Test: Ran the new ACTS Tests for LE CoC
Bug: 70683224
Change-Id: I6ed77b46e5434bca5f2501d853ae8181c7197b4c

6 years agoUse do_in_bta_thread in BTA DM layer am: 154be11f74 am: d33cd5ab03
Jakub Pawlowski [Tue, 23 Jan 2018 16:12:53 +0000 (16:12 +0000)]
Use do_in_bta_thread in BTA DM layer am: 154be11f74 am: d33cd5ab03
am: 2b01802134

Change-Id: Iec539de8dfd554fb1c4c2d01f283e599f43a4405

6 years agoUse do_in_bta_thread in BTA DM layer am: 154be11f74
Jakub Pawlowski [Tue, 23 Jan 2018 16:07:50 +0000 (16:07 +0000)]
Use do_in_bta_thread in BTA DM layer am: 154be11f74
am: d33cd5ab03

Change-Id: Ic887a9aacd6e8dabd4ab83cb538e6ad5a77d3803

6 years agoUse do_in_bta_thread in BTA DM layer
Jakub Pawlowski [Tue, 23 Jan 2018 16:02:50 +0000 (16:02 +0000)]
Use do_in_bta_thread in BTA DM layer
am: 154be11f74

Change-Id: I7c7b578985b5094be304f964f371601343a70a58

6 years agoUse do_in_bta_thread in BTA DM layer
Jakub Pawlowski [Mon, 22 Jan 2018 18:22:43 +0000 (10:22 -0800)]
Use do_in_bta_thread in BTA DM layer

This patch is transforming all the trivial cases, where no variable
length data is included in the event struct. Further patches will
convert the non-trivial cases.

Bug: none
Test: scan, connect, set name, remove device
Change-Id: Ia216a8a7c3bb225aedac34375ce07b109398557c

6 years agoForward Hearing Aid UUID when discovered over LE am: 35bd37d395 am: 7167f129a5
Jakub Pawlowski [Tue, 23 Jan 2018 00:28:38 +0000 (00:28 +0000)]
Forward Hearing Aid UUID when discovered over LE am: 35bd37d395 am: 7167f129a5
am: 7095e42a12

Change-Id: Id32d87db40c31ebda4e80fca34bd75a082cae28b

6 years agoForward Hearing Aid UUID when discovered over LE am: 35bd37d395
Jakub Pawlowski [Tue, 23 Jan 2018 00:23:34 +0000 (00:23 +0000)]
Forward Hearing Aid UUID when discovered over LE am: 35bd37d395
am: 7167f129a5

Change-Id: Ie4ba93fa36d0bed27909a8046bc9e1be24f6a2ea

6 years agoForward Hearing Aid UUID when discovered over LE
Jakub Pawlowski [Tue, 23 Jan 2018 00:19:27 +0000 (00:19 +0000)]
Forward Hearing Aid UUID when discovered over LE
am: 35bd37d395

Change-Id: I39945939bc5e899f0000c2a8d05eedd0e61b6249

6 years agoBTE: Allocate LogMsg buffer on the stack am: 7a3819f092 am: a6474abbea
Gurpreet Ghai [Mon, 22 Jan 2018 20:20:13 +0000 (20:20 +0000)]
BTE: Allocate LogMsg buffer on the stack am: 7a3819f092 am: a6474abbea
am: 110a907c0a

Change-Id: I36bcd56e4742265bb518ebb536f281b97c6e6246

6 years agoBTE: Allocate LogMsg buffer on the stack am: 7a3819f092
Gurpreet Ghai [Mon, 22 Jan 2018 20:05:42 +0000 (20:05 +0000)]
BTE: Allocate LogMsg buffer on the stack am: 7a3819f092
am: a6474abbea

Change-Id: Ie6733b5643b0b6ceea1c976cce2288909308d1c1

6 years agoBTE: Allocate LogMsg buffer on the stack
Gurpreet Ghai [Mon, 22 Jan 2018 19:52:42 +0000 (19:52 +0000)]
BTE: Allocate LogMsg buffer on the stack
am: 7a3819f092

Change-Id: I54c0bf8dc64ad9c11a6d745aa64f16bbde3a9f6c

6 years agoForward Hearing Aid UUID when discovered over LE
Jakub Pawlowski [Tue, 21 Nov 2017 20:21:05 +0000 (12:21 -0800)]
Forward Hearing Aid UUID when discovered over LE

This way upper layers (Settings app) can make decision whether to connect
to the profile.

Test: none
Bug: 69623109
Change-Id: I98e93ebbf7ceadd1756e4dfd0e8c4f876544b39d

6 years agoDo SDP when HSP connection starts by remote am: ade654f3dc am: 1bd52b3daf
Satish Kodishala [Mon, 22 Jan 2018 17:01:37 +0000 (17:01 +0000)]
Do SDP when HSP connection starts by remote am: ade654f3dc am: 1bd52b3daf
am: f7b5413b71

Change-Id: Ie754420ef46090db18e2c8dc6d5365bae3ac3b60

6 years agoDo SDP when HSP connection starts by remote am: ade654f3dc
Satish Kodishala [Mon, 22 Jan 2018 16:59:45 +0000 (16:59 +0000)]
Do SDP when HSP connection starts by remote am: ade654f3dc
am: 1bd52b3daf

Change-Id: Ia5e1d753ae4416a401781fd01f05585d1afb09bc

6 years agoBTE: Allocate LogMsg buffer on the stack
Gurpreet Ghai [Mon, 7 Aug 2017 06:05:22 +0000 (11:35 +0530)]
BTE: Allocate LogMsg buffer on the stack

Problem:
Due to static 1k buffer in LogMsg function is leading to a crash in
btapp as this function is called from multiple threads

Steps:
A2DP streaming or similar process that performs excessive logging

Failure: Crash occurs

Root Cause:
Static buffer being accessed and updated by different threads parallelly

Fix:
Used local buffer instead of static buffer from LogMsg function

Test: manual
Fixes: 69586278
Change-Id: I037d85c1ca0e134d1fa86308d0467f88d8ea159d

6 years agoDo SDP when HSP connection starts by remote
Satish Kodishala [Mon, 22 Jan 2018 16:57:03 +0000 (16:57 +0000)]
Do SDP when HSP connection starts by remote
am: ade654f3dc

Change-Id: If3a217646b08e2f2f184d646aa9a786851481328

6 years agoDo SDP when HSP connection starts by remote
Satish Kodishala [Thu, 11 Aug 2016 04:51:48 +0000 (10:21 +0530)]
Do SDP when HSP connection starts by remote

Test: 1. Enable only HSP profile on AG.
2. Connect to AG from BT headset supporting HSP profile only with VGS
3. VOIP call (eg. skype, hangout)
4. Control the volume using AG volume keys.

Failure:
Volume changes are not taking affect.

Rootcause:
When remote is doing SDP first, HSP AG is skipping SDP.
As a result, AG is not aware if remote supports remote
volume control feature.

Fix:
Don't skip SDP when remote does SDP first. Do SDP always
so that AG could find out if remote supports remote volume
control feature.

Fixes: 35657384

Change-Id: I73707f774dc4ec53cbd510ded15f28f87659eec3

6 years agoAllow L2CAP first packet with partial header
Stanley Tng [Wed, 10 Jan 2018 17:25:40 +0000 (09:25 -0800)]
Allow L2CAP first packet with partial header

This change will allow a fragmented and first L2CAP packet that has
partial L2CAP Header to be parsed. Only the first 2 bytes of L2CAP
header are necessary for the packet assembler to work and the subsequent
bytes of the header can be in later packets.

Test: Run RfComm and LE CoC SL4A Tests. Also verify on an OTA received packet
with the partial L2CAP CoC header.
Bug: 70683224

Change-Id: I659ebbe86eab57aa9d725f7b685525b445195e5e

6 years agoHFP: Do not use data in bta_ag_start_open if data is empty am: 26d45dc680 am: 6651130d44
Jack He [Mon, 22 Jan 2018 09:37:54 +0000 (09:37 +0000)]
HFP: Do not use data in bta_ag_start_open if data is empty am: 26d45dc680 am: 6651130d44
am: 281b936bf4

Change-Id: I94ef0b4b20bf36c580669828d9010d0a379f9a11

6 years agoHFP: Do not use data in bta_ag_start_open if data is empty am: 26d45dc680
Jack He [Mon, 22 Jan 2018 09:35:23 +0000 (09:35 +0000)]
HFP: Do not use data in bta_ag_start_open if data is empty am: 26d45dc680
am: 6651130d44

Change-Id: I053042e0f35ff2f2bc4acedfc91bb6c773663980

6 years agoHFP: Do not use data in bta_ag_start_open if data is empty
Jack He [Mon, 22 Jan 2018 09:32:49 +0000 (09:32 +0000)]
HFP: Do not use data in bta_ag_start_open if data is empty
am: 26d45dc680

Change-Id: Ic3b3cc3edcc93d2d15b2058a61373e59f9425d6d

6 years agoHFP: Do not use data in bta_ag_start_open if data is empty
Jack He [Mon, 22 Jan 2018 07:18:05 +0000 (23:18 -0800)]
HFP: Do not use data in bta_ag_start_open if data is empty

* bta_ag_start_open() should not use data when data is empty

Change-Id: Id16d8c0ca90cbecb1b54900bd7f37a6c5c467ebd
Fixes: 72164296
Bug: 72164296
Test: make, pair and connect Bluetooth devices

6 years agoHFP: Use base::Bind instead of messages for bta_ag_api functions am: 8b699d1076 am...
Jack He [Sun, 21 Jan 2018 23:01:37 +0000 (23:01 +0000)]
HFP: Use base::Bind instead of messages for bta_ag_api functions am: 8b699d1076 am: 24f7793da8
am: 38fea9f852

Change-Id: I5d5d8500431f1d38c00921edea54c31e2785f22d

6 years agoHFP: Use base::Bind instead of messages for bta_ag_api functions am: 8b699d1076
Jack He [Sun, 21 Jan 2018 22:59:31 +0000 (22:59 +0000)]
HFP: Use base::Bind instead of messages for bta_ag_api functions am: 8b699d1076
am: 24f7793da8

Change-Id: I83a4472d047aa6406b7807029aad1847f3693a52

6 years agoHFP: Use base::Bind instead of messages for bta_ag_api functions
Jack He [Sun, 21 Jan 2018 22:57:00 +0000 (22:57 +0000)]
HFP: Use base::Bind instead of messages for bta_ag_api functions
am: 8b699d1076

Change-Id: I8bd3327c91b9e755b95245bf3400698060164fe2

6 years agoAudio V4: Split system and vendor Audio.h
Kevin Rocard [Wed, 17 Jan 2018 23:57:40 +0000 (15:57 -0800)]
Audio V4: Split system and vendor Audio.h

audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.

This led to multiple problems:

1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.

2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).

3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).

4) Treble policy is to support at least one previous HAL version

As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.

Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.

The split is implements as such:

 + for system code

    - NOT moving the libaudio_system_headers
      Eg: system/audio.h and system/audio_effects/effect_equalizer.h
          are still in system/media/audio

    - the legacy audio HAL API that were in libhardware headers
          are now in libaudiohal_legacy_headers
      Eg: hardware/audio.h and hardware/audio_effect.h
          are now in frameworks/av/media/libaudiohal/legacy/

 + for vendor code

    - moving libaudio_system_headers and the legacy audio HAL API
          that were in libhardware_headers in
          android.hardware.audio.common.legacy@2.0
      Note that those headers are now versioned, so migrating to a @4.0
          HIDL HAL will mean changing the legacy dependency too.
      Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
          are now in hardware/interfaces/audio/common/2.0/legacy

    - the legacy audio effect HAL API that was in libaudioeffects
          is now moved in android.hardware.audio.effect.legacy@2.0
      Eg: audio_effects/effect*.h are now in
          hardware/interfaces/audio/effect/2.0/legacy

    - the legacy sound trigger HAL API that were in libhardware_headers
          is now moved in android.hardware.soundtrigger.legacy@2.0
      Eg: hardware/sound_trigger.h is now in
          hardware/interfaces/audio/effect/2.0/legacy

libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.

Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.

Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.

Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.

Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.

Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.

Test: compile taimen-userdebug walleye-userdebug
              sailfish-userdebug marlin-userdebug
              gce_x86_phone-userdebug gce_x86_phone
              full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
6 years agoHFP: Use base::Bind instead of messages for bta_ag_api functions
Jack He [Fri, 5 Jan 2018 23:11:39 +0000 (15:11 -0800)]
HFP: Use base::Bind instead of messages for bta_ag_api functions

Summary:
* Do not use bta_sys_sendmsg(BT_HDR) in bta/ag, use base::Bind instead
* Do not use BT_HDR in bta/ag
* Do not do memcpy during thread switch in bta/ag, instead, we use the
  default copy constructor

Details:
* Currently, bta_ag_api functions use explicit messages to cross from
  jni to bta thread. This adds unnecessary indirections that make it
  hard to figure out which methods in bta actually get called
* Instead, base::Bind can bind to methods in bta directly without
  putting parameters in an explicit struct. This greatly simplify our
  code without breaking the current threading model
* With base:Bind, we no longer rely on bta_sys_sendmsg(BT_HDR) to send
  event across threads. We can therefore get rid of BT_HDR in all
  sub-types of tBTA_AG_DATA. Instead of using BT_HDR->layer_specific
  flag to pass down handle IDs, we pass down handle ID directly,
  resulting in less confusion on the actual meaning of data

Bug: 70538124
Test: runtest bluetooth, native unit tests
Change-Id: Ic0b4498dd623d0ea31b4513d6b7861cae390bc72

6 years agoOne less copy when sending LE CoC data. am: 8451931236 am: 46cd2710db
Jakub Pawlowski [Sat, 20 Jan 2018 17:12:30 +0000 (17:12 +0000)]
One less copy when sending LE CoC data. am: 8451931236 am: 46cd2710db
am: 27c6d2f884

Change-Id: I0a487a2f463bde7b4a8d09c240273ee4a9bb0d45

6 years agoOne less copy when sending LE CoC data. am: 8451931236
Jakub Pawlowski [Sat, 20 Jan 2018 17:09:59 +0000 (17:09 +0000)]
One less copy when sending LE CoC data. am: 8451931236
am: 46cd2710db

Change-Id: I792c7373d035d8644a46e7831c87e439a4fc2506

6 years agoOne less copy when sending LE CoC data.
Jakub Pawlowski [Sat, 20 Jan 2018 17:07:27 +0000 (17:07 +0000)]
One less copy when sending LE CoC data.
am: 8451931236

Change-Id: Ie63ed4fa3ce9848c9285c25f037bb676370fa569

6 years agoOne less copy when sending LE CoC data.
Jakub Pawlowski [Fri, 12 Jan 2018 14:22:43 +0000 (06:22 -0800)]
One less copy when sending LE CoC data.

After this patch, data is read from socket directly into BT_HDR that is
passed down the stack, rather than copying the data later.

Test: manual
Bug: 68359837
Change-Id: I3f304e6c7e60ce64b44350678d0ba10324fc97bc

6 years agoAdd Connection Event Min/Max hint to Connection Update Request am: c194ec1e89 am...
Jakub Pawlowski [Sat, 20 Jan 2018 03:53:18 +0000 (03:53 +0000)]
Add Connection Event Min/Max hint to Connection Update Request am: c194ec1e89 am: 235bbca2a4
am: 3295f85db5

Change-Id: I2e0471a3820757479df3612baac1384732512ff6

6 years agoAdd Connection Event Min/Max hint to Connection Update Request am: c194ec1e89
Jakub Pawlowski [Sat, 20 Jan 2018 03:50:16 +0000 (03:50 +0000)]
Add Connection Event Min/Max hint to Connection Update Request am: c194ec1e89
am: 235bbca2a4

Change-Id: Id4194e42c6b504aa83d0b000897a9ab85ed0e5f8

6 years agoAdd Connection Event Min/Max hint to Connection Update Request
Jakub Pawlowski [Sat, 20 Jan 2018 03:47:42 +0000 (03:47 +0000)]
Add Connection Event Min/Max hint to Connection Update Request
am: c194ec1e89

Change-Id: I6ccc959a08ecb6c25029ba9b8a03952f7066395b

6 years agoAdd Connection Event Min/Max hint to Connection Update Request
Jakub Pawlowski [Fri, 19 Jan 2018 19:29:21 +0000 (11:29 -0800)]
Add Connection Event Min/Max hint to Connection Update Request

Bug: 69623109
Test: manual on HA
Change-Id: Idc08d08029f287751fafb4a8e2379dcc118e5ac3

6 years agoMerge "a2dp_source: Use SIZE_MAX queue size for worker_thread" am: f82e7898bb am...
Bailey Forrest [Fri, 19 Jan 2018 21:53:55 +0000 (21:53 +0000)]
Merge "a2dp_source: Use SIZE_MAX queue size for worker_thread" am: f82e7898bb am: 0c46edf7be
am: 2dc68dfb5c

Change-Id: I5c3eb004260e73bd8cbb0c602026ef20f30779ab

6 years agoMerge "a2dp_source: Use SIZE_MAX queue size for worker_thread" am: f82e7898bb
Bailey Forrest [Fri, 19 Jan 2018 21:49:41 +0000 (21:49 +0000)]
Merge "a2dp_source: Use SIZE_MAX queue size for worker_thread" am: f82e7898bb
am: 0c46edf7be

Change-Id: I19a2e485f55daf44f5c71bae953d02b1897162f0

6 years agoMerge "a2dp_source: Use SIZE_MAX queue size for worker_thread"
Bailey Forrest [Fri, 19 Jan 2018 21:47:41 +0000 (21:47 +0000)]
Merge "a2dp_source: Use SIZE_MAX queue size for worker_thread"
am: f82e7898bb

Change-Id: If74f098483a3cb8116351718f1d53ee8fdd9b157

6 years agoMerge "a2dp_source: Use SIZE_MAX queue size for worker_thread"
Treehugger Robot [Fri, 19 Jan 2018 21:41:24 +0000 (21:41 +0000)]
Merge "a2dp_source: Use SIZE_MAX queue size for worker_thread"

6 years agoMerge "SDP: Increase heap buffer size used for A2DP/AVRC" am: 434fc14ef4 am: 63f964bb64
minwoo2.kim [Fri, 19 Jan 2018 20:37:31 +0000 (20:37 +0000)]
Merge "SDP: Increase heap buffer size used for A2DP/AVRC" am: 434fc14ef4 am: 63f964bb64
am: bda1a4b1b2

Change-Id: I86f185ed56d246529c7db405a9083e6f999486ef

6 years agoMerge "SDP: Increase heap buffer size used for A2DP/AVRC" am: 434fc14ef4
minwoo2.kim [Fri, 19 Jan 2018 20:35:32 +0000 (20:35 +0000)]
Merge "SDP: Increase heap buffer size used for A2DP/AVRC" am: 434fc14ef4
am: 63f964bb64

Change-Id: I4bb1382e3c6ec1d1a9b0e6b0f097dc292eb45219

6 years agoMerge "btm_sec_disconnected Check if p_dev_rec is still in scope" am: d6dad56b4b...
Bailey Forrest [Fri, 19 Jan 2018 20:35:29 +0000 (20:35 +0000)]
Merge "btm_sec_disconnected Check if p_dev_rec is still in scope" am: d6dad56b4b am: 610e717c73
am: 7964aaf8b9

Change-Id: I3d1863437c80321d5484dd1e22fd969a009f92cc

6 years agoMerge "btm_sec_disconnected Check if p_dev_rec is still in scope" am: d6dad56b4b
Bailey Forrest [Fri, 19 Jan 2018 20:32:57 +0000 (20:32 +0000)]
Merge "btm_sec_disconnected Check if p_dev_rec is still in scope" am: d6dad56b4b
am: 610e717c73

Change-Id: I660f363a7845a21d43afa4da827e1e3b8642119b

6 years agoMerge "SDP: Increase heap buffer size used for A2DP/AVRC"
minwoo2.kim [Fri, 19 Jan 2018 20:32:55 +0000 (20:32 +0000)]
Merge "SDP: Increase heap buffer size used for A2DP/AVRC"
am: 434fc14ef4

Change-Id: I634d2c18a062fc1518614114619827551ea2908c

6 years agoMerge "btm_sec_disconnected Check if p_dev_rec is still in scope"
Bailey Forrest [Fri, 19 Jan 2018 20:30:27 +0000 (20:30 +0000)]
Merge "btm_sec_disconnected Check if p_dev_rec is still in scope"
am: d6dad56b4b

Change-Id: Iae71e17f3bcf081758d1b9ea85a81a9d43c341c0

6 years agoMerge "SDP: Increase heap buffer size used for A2DP/AVRC"
Treehugger Robot [Fri, 19 Jan 2018 20:27:47 +0000 (20:27 +0000)]
Merge "SDP: Increase heap buffer size used for A2DP/AVRC"

6 years agoMerge "btm_sec_disconnected Check if p_dev_rec is still in scope"
Treehugger Robot [Fri, 19 Jan 2018 20:25:28 +0000 (20:25 +0000)]
Merge "btm_sec_disconnected Check if p_dev_rec is still in scope"

6 years agoRemove casts for callbacks am: fc9eced9bc am: 574924848f
Myles Watson [Fri, 19 Jan 2018 19:33:48 +0000 (19:33 +0000)]
Remove casts for callbacks am: fc9eced9bc am: 574924848f
am: c6266c5964

Change-Id: I2ba2817464a108dbbcf08bf3d4115b11e4f5337f

6 years agoMake GAP_ConnWriteData accept BT_HDR am: 42bdd07088 am: c724643d39
Jakub Pawlowski [Fri, 19 Jan 2018 19:33:29 +0000 (19:33 +0000)]
Make GAP_ConnWriteData accept BT_HDR am: 42bdd07088 am: c724643d39
am: a8a241b99d

Change-Id: I863db9de4bf77a36c026ff8892b9b1c69d31b3e5

6 years agoRemove casts for callbacks am: fc9eced9bc
Myles Watson [Fri, 19 Jan 2018 19:31:03 +0000 (19:31 +0000)]
Remove casts for callbacks am: fc9eced9bc
am: 574924848f

Change-Id: I65b2112322cf6d82d0e4de3f94f1eafe0f5975c7

6 years agoMake GAP_ConnWriteData accept BT_HDR am: 42bdd07088
Jakub Pawlowski [Fri, 19 Jan 2018 19:30:46 +0000 (19:30 +0000)]
Make GAP_ConnWriteData accept BT_HDR am: 42bdd07088
am: c724643d39

Change-Id: Id85d40e7b51f415ab1119a2ea592d8249e6ca4b7

6 years agoRemove casts for callbacks
Myles Watson [Fri, 19 Jan 2018 19:29:03 +0000 (19:29 +0000)]
Remove casts for callbacks
am: fc9eced9bc

Change-Id: I4b512ee541e3a32f323cc29d10f51e9e1b8971d3

6 years agoMake GAP_ConnWriteData accept BT_HDR
Jakub Pawlowski [Fri, 19 Jan 2018 19:28:45 +0000 (19:28 +0000)]
Make GAP_ConnWriteData accept BT_HDR
am: 42bdd07088

Change-Id: If4572b3d43c1076feea8ac07032454fcb1b4f535

6 years agoRemove casts for callbacks
Myles Watson [Thu, 18 Jan 2018 20:30:55 +0000 (12:30 -0800)]
Remove casts for callbacks

Casting callbacks can hide parameter mismatches from
the compiler, which makes it impossible to check
argument types.

Bug: 72005262
Test: Toggle Bluetooth, connect to a headset
Change-Id: I0c3e0653c77e829655377fbf170d1b03efa5ea32

6 years agobtm_sec_disconnected Check if p_dev_rec is still in scope
Bailey Forrest [Fri, 12 Jan 2018 23:52:14 +0000 (15:52 -0800)]
btm_sec_disconnected Check if p_dev_rec is still in scope

|btm_sec_disconnected| may call the callback
|btm_cb.api.p_auth_complete_callback| which can delete |p_dev_rec|.
After deletion, |btm_sec_disconnected| still atempts to use |p_dev_rec|.

Bug: 71913396
Test: Does not crash with a quickly terminated connection.
Change-Id: Ic28beb2888a51090283be04121d785495cf25a84

6 years agoMake GAP_ConnWriteData accept BT_HDR
Jakub Pawlowski [Thu, 18 Jan 2018 02:22:12 +0000 (18:22 -0800)]
Make GAP_ConnWriteData accept BT_HDR

This is next step towards making LE sockets work with zero copies.

Test: transfer file using OPP
Bug: 68359837
Change-Id: Iedcdd59acb223e2982f6cb96b8656f517008dee5

6 years agoRevert "HID: Update condition for checking LE HID handle validity" am: 812d20dfd8...
Hemant Gupta [Fri, 19 Jan 2018 01:40:01 +0000 (01:40 +0000)]
Revert "HID: Update condition for checking LE HID handle validity" am: 812d20dfd8 am: f1cc3e6164
am: 3af0c4d057

Change-Id: I5980cd2e05117705fda127bada3cd59529ad9fa1

6 years agoRevert "HID: Update condition for checking LE HID handle validity" am: 812d20dfd8
Hemant Gupta [Fri, 19 Jan 2018 01:16:47 +0000 (01:16 +0000)]
Revert "HID: Update condition for checking LE HID handle validity" am: 812d20dfd8
am: f1cc3e6164

Change-Id: I2eddb42f1e585e4c87d61713a81cb94a3cc03a1c

6 years agoRevert "HID: Update condition for checking LE HID handle validity"
Hemant Gupta [Fri, 19 Jan 2018 01:07:38 +0000 (01:07 +0000)]
Revert "HID: Update condition for checking LE HID handle validity"
am: 812d20dfd8

Change-Id: Ia541465ba62f3a0c7bb890290f1b2a03925f2756

6 years agoAdded support for new Android API for LE CoC am: 49dd53cb3d am: a1eb49a78f
Stanley Tng [Thu, 18 Jan 2018 18:19:54 +0000 (18:19 +0000)]
Added support for new Android API for LE CoC am: 49dd53cb3d am: a1eb49a78f
am: 7ebd62fe64

Change-Id: Iade72b1d205cc8bbb94d514d3de3b488a2b33d66

6 years agoAdded support for new Android API for LE CoC am: 49dd53cb3d
Stanley Tng [Thu, 18 Jan 2018 18:04:09 +0000 (18:04 +0000)]
Added support for new Android API for LE CoC am: 49dd53cb3d
am: a1eb49a78f

Change-Id: Ie510183ecaa7bb2bbf6b0cdf6b973c8b7f92d9ef

6 years agoAdded support for new Android API for LE CoC
Stanley Tng [Thu, 18 Jan 2018 17:59:28 +0000 (17:59 +0000)]
Added support for new Android API for LE CoC
am: 49dd53cb3d

Change-Id: If4aa43d5571db2f4c41d1851a486a42804a9efca

6 years agoSDP: Increase heap buffer size used for A2DP/AVRC
minwoo2.kim [Fri, 12 Jan 2018 09:09:04 +0000 (18:09 +0900)]
SDP: Increase heap buffer size used for A2DP/AVRC

This buffer is used to save the attributes parsed from the SDP response
transferred from a peer device.

In Android O, SDP fails sometimes due to full memory from SDP DB.

The reason of this shortage seems to be the increasing of allocated
memory for tSDP_DISC_ATTR.

Android N uses a 32-bit bluetooth lib and 4 bytes of memory for
pointers.

In total, 12 bytes are used for tSDP_DISC_ATTR

Android O uses a 64-bit bluetooth lib and 8 bytes of memory for
pointers.

Now, 24 bytes are used for tSDP_DISC_ATTR.

To match this increase of memory consumption, We need to double the heap
buffer size. (from 1000 to 2000)

bug: 71005276
Test: passed the connection test performed with more than 50 BT devices
launched in the market

Signed-off-by: minwoo kim <minwoo2.kim@lge.com>
Change-Id: I24bb50810e224aa1e23141493b5b2fa3b706c495

6 years agoRevert "HID: Update condition for checking LE HID handle validity"
Hemant Gupta [Fri, 12 Jan 2018 06:25:47 +0000 (11:55 +0530)]
Revert "HID: Update condition for checking LE HID handle validity"

This reverts commit af94891aa6e66b0d4b495d60aeac2aa8091c9d33 as changes to
fix same issue already merged via commit 2e3c3d782993c475e608291896db73b0960fa9dd
so this patch is not longer required.

Test: Code analysis for aosp master

Fixes: 71842479
Change-Id: Ifbc2375ad6df7231c85ef30c5e2c5b5d8dde16f0

6 years agoa2dp_source: Use SIZE_MAX queue size for worker_thread
Bailey Forrest [Thu, 18 Jan 2018 01:57:48 +0000 (17:57 -0800)]
a2dp_source: Use SIZE_MAX queue size for worker_thread

If the queue runs out of space, we can run into a deadlock.
Explanation of the deadlock is in the bug.

If I connect and disconnect ~20 times in quick succession I would
usually run into this issue

Bug: 72121764
Test: Connect/disconnect 170 times with script, issue does not occur.
Change-Id: I0a76e51aa99481f9fe4885b879209b3d215ae5b0

6 years agoAdded support for new Android API for LE CoC
Stanley Tng [Wed, 20 Dec 2017 17:38:30 +0000 (09:38 -0800)]
Added support for new Android API for LE CoC

Added support for the new Android API including the management of the
LE_PSM values.
Also fixed a bug when de-registering the L2CAP CoC, the RCB is not
freed correctly.

Test: Ran the new ACTS Tests for LE CoC and existing ACTS for RfComm
Bug: 70683224
Change-Id: I5a545656bece667e7ba942d7b2334e3f5b49b283

6 years agoLimit data accepted by GAP_ConnWriteData to just one SDU am: ce5f485e67 am: bfa287eb85
Jakub Pawlowski [Thu, 18 Jan 2018 13:37:07 +0000 (13:37 +0000)]
Limit data accepted by GAP_ConnWriteData to just one SDU am: ce5f485e67 am: bfa287eb85
am: db9b0f0c1b

Change-Id: I179d70eb13ecb2391998c766bb9cc854bf2c94be

6 years agoLimit data accepted by GAP_ConnWriteData to just one SDU am: ce5f485e67
Jakub Pawlowski [Thu, 18 Jan 2018 13:34:04 +0000 (13:34 +0000)]
Limit data accepted by GAP_ConnWriteData to just one SDU am: ce5f485e67
am: bfa287eb85

Change-Id: Idc19aa5e5a2fe8d742d4b9d8166667ef4cb833d0

6 years agoLimit data accepted by GAP_ConnWriteData to just one SDU
Jakub Pawlowski [Thu, 18 Jan 2018 13:31:31 +0000 (13:31 +0000)]
Limit data accepted by GAP_ConnWriteData to just one SDU
am: ce5f485e67

Change-Id: I6d91324e7b8347d745a358394403258d02456bae

6 years agoMerge "Make BTA_JvL2capWrite take ownership of the data buffer" am: 00fa787f83 am...
Jakub Pawlowski [Thu, 18 Jan 2018 02:28:15 +0000 (02:28 +0000)]
Merge "Make BTA_JvL2capWrite take ownership of the data buffer" am: 00fa787f83 am: e13fcb8cda
am: 7c885998d7

Change-Id: I3cbdc00e067bd59763bd7b7262dfd5d67a7fc2f9

6 years agoMerge "Added internal API getMaxConnectedAudioDevices()" am: 94b769b9f3 am: b652c61044
Pavlin Radoslavov [Thu, 18 Jan 2018 02:25:54 +0000 (02:25 +0000)]
Merge "Added internal API getMaxConnectedAudioDevices()" am: 94b769b9f3 am: b652c61044
am: 727de09ee0

Change-Id: Ic6a196a2038c6fb6f85d270884b73ec5be106441

6 years agoMerge "Make BTA_JvL2capWrite take ownership of the data buffer" am: 00fa787f83
Jakub Pawlowski [Thu, 18 Jan 2018 02:23:30 +0000 (02:23 +0000)]
Merge "Make BTA_JvL2capWrite take ownership of the data buffer" am: 00fa787f83
am: e13fcb8cda

Change-Id: I589bd2296c1374e81c76cc2b9006d6c61ccf74ea

6 years agoMerge "Added internal API getMaxConnectedAudioDevices()" am: 94b769b9f3
Pavlin Radoslavov [Thu, 18 Jan 2018 02:18:33 +0000 (02:18 +0000)]
Merge "Added internal API getMaxConnectedAudioDevices()" am: 94b769b9f3
am: b652c61044

Change-Id: Ifa92e6e4ee011012b7e17910686e668f1b65e8d2

6 years agoMerge "Make BTA_JvL2capWrite take ownership of the data buffer"
Jakub Pawlowski [Thu, 18 Jan 2018 02:16:04 +0000 (02:16 +0000)]
Merge "Make BTA_JvL2capWrite take ownership of the data buffer"
am: 00fa787f83

Change-Id: I139a9c76519330023825464558ee47e62f10ace0

6 years agoMerge "Added internal API getMaxConnectedAudioDevices()"
Pavlin Radoslavov [Thu, 18 Jan 2018 02:10:42 +0000 (02:10 +0000)]
Merge "Added internal API getMaxConnectedAudioDevices()"
am: 94b769b9f3

Change-Id: I67191c51f005479e8fc16ee24789da1bba8db4ce

6 years agoLimit data accepted by GAP_ConnWriteData to just one SDU
Jakub Pawlowski [Fri, 12 Jan 2018 11:19:33 +0000 (03:19 -0800)]
Limit data accepted by GAP_ConnWriteData to just one SDU

This limit is already enforced in BluetoothSocket.java, which is
dividing data into pieces no bigger than MTU.

This is first step towards making it accept BT_HDR with data, in order
to make LE sockets work with zero copies.

Test: transfer file using OPP
Bug: 68359837
Change-Id: I67bfd4ab5c2dc6aa8210058a742c57e1ccf845a0

6 years agoMerge "Make BTA_JvL2capWrite take ownership of the data buffer"
Treehugger Robot [Thu, 18 Jan 2018 01:49:54 +0000 (01:49 +0000)]
Merge "Make BTA_JvL2capWrite take ownership of the data buffer"

6 years agoFix buffer overflow in GAP_ConnWriteData am: 00c922a091 am: 60b02a72a2
Jakub Pawlowski [Thu, 18 Jan 2018 01:35:23 +0000 (01:35 +0000)]
Fix buffer overflow in GAP_ConnWriteData am: 00c922a091 am: 60b02a72a2
am: 3df0876700

Change-Id: I76441c6ac41737f063dbb488054ab759112c44dc