OSDN Git Service

android-x86/system-bt.git
8 years agoservice: use Parcelable instead of helpers
Jakub Pawlowski [Wed, 23 Mar 2016 21:43:40 +0000 (21:43 +0000)]
service: use Parcelable instead of helpers
am: 9bceebb

* commit '9bceebb4a441ef7f3c5d9ad2e9b84ec7e1974007':
  service: use Parcelable instead of helpers

8 years agoTell the build system this is a host module.
Ying Wang [Wed, 23 Mar 2016 20:48:41 +0000 (20:48 +0000)]
Tell the build system this is a host module.
am: df515a4

* commit 'df515a46dd4fe27040c39d35b14b3e071319156d':
  Tell the build system this is a host module.

8 years agoservice: use Parcelable instead of helpers
Jakub Pawlowski [Tue, 16 Feb 2016 04:18:19 +0000 (20:18 -0800)]
service: use Parcelable instead of helpers

In order to user .aidl in the future, all types will have to be
parcelable. We don't add Parcelable to base types, as they might
be also used with other transports than binder in future.

Change-Id: I88e6961e69ac0e5d04bd4b6fe3cd7d79bd6f73ba

8 years agoTell the build system this is a host module.
Ying Wang [Wed, 23 Mar 2016 19:53:20 +0000 (19:53 +0000)]
Tell the build system this is a host module.
am: 06b3a57

* commit '06b3a5741afa443966ec1268241c98b8549f8c44':
  Tell the build system this is a host module.

8 years agoTell the build system this is a host module.
Ying Wang [Wed, 23 Mar 2016 18:41:15 +0000 (11:41 -0700)]
Tell the build system this is a host module.

We need to tell the build system this is a host module before calling
local-generated-sources-dir.

Change-Id: Ie36ad938c0c7124865148f20fcb70d5187f158b8
(cherry-pick from commit df515a46dd4fe27040c39d35b14b3e071319156d)

8 years agoTell the build system this is a host module.
Ying Wang [Wed, 23 Mar 2016 18:41:15 +0000 (11:41 -0700)]
Tell the build system this is a host module.

We need to tell the build system this is a host module before calling
local-generated-sources-dir.

Change-Id: Ie36ad938c0c7124865148f20fcb70d5187f158b8

8 years agoHID: Fix to show mouse pointer movements on UI
Nitin Shivpure [Wed, 23 Mar 2016 17:58:51 +0000 (17:58 +0000)]
HID: Fix to show mouse pointer movements on UI
am: 5e8b724

* commit '5e8b7245ae98436b34ecce6dc7b45d7f7dba74d7':
  HID: Fix to show mouse pointer movements on UI

8 years agoInitiate SCO after Mode change event
Mallikarjuna GB [Wed, 23 Mar 2016 17:58:51 +0000 (17:58 +0000)]
Initiate SCO after Mode change event
am: 8847ff1

* commit '8847ff137b311a37c57366ac8d138b605397dce1':
  Initiate SCO after Mode change event

8 years agoAvoid sending SCO disconnect when power mode is processing
Mallikarjuna GB [Wed, 23 Mar 2016 17:54:52 +0000 (17:54 +0000)]
Avoid sending SCO disconnect when power mode is processing
am: 9ab2a9d

* commit '9ab2a9d97f4e0c4b3cd76416e3d6ed03b610ec6f':
  Avoid sending SCO disconnect when power mode is processing

8 years agoHID: Fix to show mouse pointer movements on UI
Nitin Shivpure [Fri, 15 Jan 2016 11:04:37 +0000 (16:34 +0530)]
HID: Fix to show mouse pointer movements on UI

As per the UHID implementation, UHID_OPEN & UHID_CLOSE
can be ignored, but it is useful for power-management.
Since these events are handled on hid host, ready_for_data
needs to be set to TRUE. Previously the hid reports were not
sent to kernel UHID driver leading to no mouse pointer movement
on UI of DUT.

Change-Id: I708f5be4240f07826c6eefc5404af3e42f80cfa4

8 years agoInitiate SCO after Mode change event
Mallikarjuna GB [Mon, 1 Jun 2015 07:28:38 +0000 (12:58 +0530)]
Initiate SCO after Mode change event

Use case:
1. Connect a headset to AG.
2. Make an outgoing call using headset.

Failure:
SCO connection request is rejected by headset.

Root cause:
AG initiated SCO connection when mode change is pending
on headset. Remote is coming out of sniff and rejected
SCO connection request.

Fix:
AG initiates SCO connection request once AG receives mode
change event. It resolves a corner case where remote failed
to accept SCO connection when initiated in between unsniff
LMP request. Issue is seen with WEP301 headset.

Change-Id: I4ea5d073630320b30f90e6141f4daf25943cca0b

8 years agoAvoid sending SCO disconnect when power mode is processing
Mallikarjuna GB [Sat, 30 May 2015 18:03:58 +0000 (23:33 +0530)]
Avoid sending SCO disconnect when power mode is processing

Use case:
1. Pair and connect with Mercedes car kit.
2. Answer incoming call by phone or car kit.
3. Switch audio between car kit and phone.
4. Repease 1-3 steps.

Failure:
Car kit is going into bad state and not accepting SCO disconnect.

Root cause:
Phone has sent SCO disconnect command to car kit when
power mode command(sniff/unsniff) is in the processing
on the ACL where SCO is active. Car kit didn't accept
remove SCO request command and gone into bad state.

Fix:
AG should send sco disconnect once power mode change is completed
to avoid this failure.

Change-Id: I7eba162a8fd9615795009ab26005535a3e5c7e86

8 years agoProcess complete AT cmd response.
Satish Kodishala [Wed, 23 Mar 2016 17:42:59 +0000 (17:42 +0000)]
Process complete AT cmd response.
am: 8c10b05

* commit '8c10b05eda5f1676668cb1504e976f4437851032':
  Process complete AT cmd response.

8 years agoAbort parsing in case of format error
Satish Kodishala [Wed, 23 Mar 2016 17:42:59 +0000 (17:42 +0000)]
Abort parsing in case of format error
am: e77ecc5

* commit 'e77ecc51ba21ebcaba74fb8c890bffba14d652bb':
  Abort parsing in case of format error

8 years agoProcess complete AT cmd response.
Satish Kodishala [Thu, 11 Feb 2016 17:05:40 +0000 (22:35 +0530)]
Process complete AT cmd response.

Usecase:
1. Enable hf client role and connect with AG.
2. Receive an incoming call and accept from hf client.
3. End call from hf client.
4. Repeat the steps few times.

Failure:
UI is not updated with proper call status although
call is active.

Root cause:
When OK is received as part of AT command response,
application is not updated for it. This caused response
state mismatch in application and hence queue was not
cleared properly.

Fix:
Parse complete AT command response and update application
accordingly.

Change-Id: I8cb2362369b209903700e87330ed2a3e3052b188

8 years agoAbort parsing in case of format error
Satish Kodishala [Thu, 11 Feb 2016 14:32:08 +0000 (20:02 +0530)]
Abort parsing in case of format error

Usecase:
1. Enable hf client and connect to AG.
2. Send +COPS with length more than allowed 16 characters.

Failure:
Crash might be seen while parsing +COPS response from AG.

Root cause:
sscanf used for parsing the AT commands does not update
the characters scanned when there is format error.

Fix:
Abort the processing in case of format error.

Change-Id: Id3ca80712df3d0251cf9ffb04d9c766be809ae84

8 years agoMove to idle when remote disconnects during connection.
Ayan Ghosh [Wed, 23 Mar 2016 17:26:58 +0000 (17:26 +0000)]
Move to idle when remote disconnects during connection.
am: 4d10d7f

* commit '4d10d7f5a0bb9444867b2f77b3e92725a851f8ac':
  Move to idle when remote disconnects during connection.

8 years agoAllocate buffer for AV SDP in Stack
Ayan Ghosh [Wed, 23 Mar 2016 17:26:58 +0000 (17:26 +0000)]
Allocate buffer for AV SDP in Stack
am: a986d61

* commit 'a986d610aa91222b3387497705aa12ccebe3835b':
  Allocate buffer for AV SDP in Stack

8 years agoMove to idle when remote disconnects during connection.
Ayan Ghosh [Tue, 7 Jan 2014 11:17:19 +0000 (16:47 +0530)]
Move to idle when remote disconnects during connection.

Chrysler Uconnect Touch initiates disconnect for a2dp on
l2cap just after discovery on AVDTP channel, stack does not
send any message to BTIF layer for disconnection, this
causes btif getting stuck in opening state and later no stable
connection update is sent to app. Since it is intermediate
state all subsequent connection trials fails.

Send disconnect event from incoming state to closing state
and then closing state will send proper msg to btif layer. Add
closing msg handling in btif layer so that we can update app
for connection disconnect when initiated from remote and move to
proper stable state for accepting/initiating connection.

Change-Id: I011d9ffe9d721235217320c1e5281f70328c7f13

8 years agoDo not initiate SDP for incoming AVDTP connection
Ayan Ghosh [Wed, 23 Mar 2016 17:18:34 +0000 (17:18 +0000)]
Do not initiate SDP for incoming AVDTP connection
am: c90c0d4

* commit 'c90c0d48e2adfaf42908177ea7eeab85787d84fc':
  Do not initiate SDP for incoming AVDTP connection

8 years agoAllocate buffer for AV SDP in Stack
Ayan Ghosh [Thu, 3 Mar 2016 10:37:38 +0000 (16:07 +0530)]
Allocate buffer for AV SDP in Stack

Remove buffer allocation in BTA while going for SDP before triggering
A2DP connection. This strategy is followed to address memory corruption
issues due to freeing of BTA buffer before SDP RSP call back is
triggered and access the freed buffer from there, leads to crash when
running Codemonicom tests.

The change allocates and frees buffer in stack.

Change-Id: If6d60d2aa60d19ce5120dd38c2f365d70943db81

8 years agoProcess AV HAL start only when previous instance is cleaned up
Ayan Ghosh [Wed, 23 Mar 2016 17:11:17 +0000 (17:11 +0000)]
Process AV HAL start only when previous instance is cleaned up
am: 59e97c2

* commit '59e97c20314b51cf0c2854e4d2aa889e7137207e':
  Process AV HAL start only when previous instance is cleaned up

8 years agoRestrict DUT supported SBC configuration in GET_CAP response
Ayan Ghosh [Wed, 23 Mar 2016 17:11:16 +0000 (17:11 +0000)]
Restrict DUT supported SBC configuration in GET_CAP response
am: d565837

* commit 'd56583705e63a8a508b908d2a0c62003834accae':
  Restrict DUT supported SBC configuration in GET_CAP response

8 years agoDo not initiate SDP for incoming AVDTP connection
Ayan Ghosh [Thu, 11 Dec 2014 12:26:02 +0000 (17:56 +0530)]
Do not initiate SDP for incoming AVDTP connection

There are few instances when remote initiates L2CAP
channel for AVDTP signaling but keeps quite after that,
and later on timeout DUT goes for rest of the signalling
procedure but does sdp prior to the same.Few peer
devices deletes a2dp sink sdp record when there is an
ongoing connection, as a result sdp request fails and
DUT fails to proceed with signalling procedure and
connection setup fails.

This patch makes sure that DUT does not go for redundant
sdp request for AVDTP, provided remote has already
established L2cap connection for the same. SDP is done
explicitly only incase of outgoing AV connection.

This issue is seen with Nokia Es headset.

Change-Id: Id44368687d5b3f97bf0258f8d4ff75f185db23af

8 years agoProcess AV HAL start only when previous instance is cleaned up
Ayan Ghosh [Thu, 3 Mar 2016 13:28:24 +0000 (18:58 +0530)]
Process AV HAL start only when previous instance is cleaned up

Change-Id: Iee232dacd3b79e6e94d26c73fb3e563fddced75c

8 years agoRestrict DUT supported SBC configuration in GET_CAP response
Ayan Ghosh [Thu, 17 Mar 2016 09:29:06 +0000 (14:59 +0530)]
Restrict DUT supported SBC configuration in GET_CAP response

DUT shows all possible SBC configurations as supported
as part of GET_CAP response and also allows AV SINK to
opt for any of these values from that set as part of
SET_CONFIG request, but later opts for only recommended
figures while streaming so that leads to mismatch in
configuration between the config values SINK sets during
SET_CONFIG and config values DUT chooses for streaming
and hence it causes PTS (version 6.4 onwards) certification
failure for below A2DP and AVDTP cases:

A2DP:
TC_SRC_SET_BV_04_I
TC_SRC_SET_BV_06_I

AVDTP:
TC_ACP_SRC_SIG_SMG_BV_18_C
TC_ACP_SRC_SIG_SMG_BV_20_C
TC_ACP_SRC_SIG_SMG_BV_22_C

Restricting DUT supported SBC configurations to reflect only
the configuration DUT opts for during streaming makes sure
remote also opts for those config values during SET_CONFIG
and later there is no mismatch.

Change-Id: I13dbe94e0ca52708fc62c6db7513f7985237c18c

8 years agoUse handles to identify GATT attributes (1/4)
Jakub Pawlowski [Tue, 22 Mar 2016 03:44:36 +0000 (03:44 +0000)]
Use handles to identify GATT attributes (1/4)
am: 26f8828

* commit '26f8828cdb5f02b0b01bafaccd4ad0b0ba9d57ab':
  Use handles to identify GATT attributes (1/4)

8 years agoHID service discovery refactor
Jakub Pawlowski [Tue, 22 Mar 2016 03:44:36 +0000 (03:44 +0000)]
HID service discovery refactor
am: 0673013  -s ours

* commit '06730134eb2d99cc1abb0e648bbff19641adc1ab':
  HID service discovery refactor

8 years agoRestructure GATTC
Jakub Pawlowski [Tue, 22 Mar 2016 03:41:57 +0000 (03:41 +0000)]
Restructure GATTC
am: 36b6707  -s ours

* commit '36b67072266468e4b4becc76c0ddbff6154bb12c':
  Restructure GATTC

8 years agoMerge changes from topic \'bug-27455533-to-nyc-dev-merge-1\' into nyc-dev
Jakub Pawlowski [Tue, 22 Mar 2016 03:39:19 +0000 (03:39 +0000)]
Merge changes from topic \'bug-27455533-to-nyc-dev-merge-1\' into nyc-dev
am: 1af9063  -s ours

* commit '1af906353999b8f25ddd1030803292a4c84087f6':
  Remove bta_gattc_id2handle
  Use attribute handle instead of id in GATT cache
  HID multi-device refactoring
  GATT cache storage refactoring
  Remove dead methods and callbacks
  Simplify UUID handling in GATT cache

8 years agoUse handles to identify GATT attributes (1/4)
Jakub Pawlowski [Thu, 17 Mar 2016 19:05:54 +0000 (12:05 -0700)]
Use handles to identify GATT attributes (1/4)

Bug: 27778668
Change-Id: Id7454450c1ce2164001a1f9ca0b91f18d84e3fd6

8 years agoHID service discovery refactor
Jakub Pawlowski [Tue, 15 Mar 2016 22:35:38 +0000 (15:35 -0700)]
HID service discovery refactor

This patch changes how HID is initialized.
Up till now, HID discovery was intricately chained,
to make sure two operations are not scheduled at same time.
From now on, all discovery is done and all operations are
scheduled for execution right away. There is separate set
of functions making sure all operations will be executed
without collisions.

This patch also removes BTA_HH_SCPP_INST_DEF, which was
used as hardcoded service id.

Bug: 27698756
Change-Id: I30a7388e129844c5e4727b2ed2b7c05867cc73a8

8 years agoRestructure GATTC
Jakub Pawlowski [Tue, 15 Mar 2016 22:35:00 +0000 (15:35 -0700)]
Restructure GATTC

This patch changes how GATTC is structured. Up till now, it
contained tBTA_GATTC_CACHE and tBTA_GATTC_CACHE_ATTR. Those
structures were so ugly, someone hide them inside internal
header, to make sure noone would ever access them from outside
GATTC. They are now replaced with:
tBTA_GATTC_SERVICE,
tBTA_GATTC_CHARACTERISTIC,
tBTA_GATTC_DESCRIPTOR and
tBTA_GATTC_INCLUDED_SVC.

Those looks much better, and were made globally avaliable.
Thanks to way they're build, we no longer need set of access
methods, which were also very ugly:
BTA_GATTC_GetFirstChar
BTA_GATTC_GetNextChar
BTA_GATTC_GetFirstIncludedService
etc.

This patch breaks HID, DO NOT SUBMIT without HID refactor.

Bug: 27455533
Change-Id: Ic42cfff175e0cc1a0d8e1a1216e2b4b756cbf77d

8 years agoMerge changes from topic 'bug-27455533-to-nyc-dev-merge-1' into nyc-dev
Andre Eisenbach [Tue, 22 Mar 2016 02:55:32 +0000 (02:55 +0000)]
Merge changes from topic 'bug-27455533-to-nyc-dev-merge-1' into nyc-dev

* changes:
  Remove bta_gattc_id2handle
  Use attribute handle instead of id in GATT cache
  HID multi-device refactoring
  GATT cache storage refactoring
  Remove dead methods and callbacks
  Simplify UUID handling in GATT cache

8 years agoUse handles to identify GATT attributes (1/4)
Jakub Pawlowski [Tue, 22 Mar 2016 02:47:26 +0000 (02:47 +0000)]
Use handles to identify GATT attributes (1/4)
am: 9dc9985

* commit '9dc998503590163068845827d951fc2f05a17bda':
  Use handles to identify GATT attributes (1/4)

8 years agoUse handles to identify GATT attributes (1/4)
Jakub Pawlowski [Thu, 17 Mar 2016 19:05:54 +0000 (12:05 -0700)]
Use handles to identify GATT attributes (1/4)

Bug: 27778668
Change-Id: Id7454450c1ce2164001a1f9ca0b91f18d84e3fd6

8 years agoCleanup after p_mcb if L2CA_ConnectReq() failed
Pavlin Radoslavov [Tue, 22 Mar 2016 02:30:36 +0000 (02:30 +0000)]
Cleanup after p_mcb if L2CA_ConnectReq() failed
am: d212571

* commit 'd2125712aa0988434d7809e8497f49525a9eae9b':
  Cleanup after p_mcb if L2CA_ConnectReq() failed

8 years agoAdd missing initialization of queue btm_cb.sec_pending_q
Pavlin Radoslavov [Tue, 22 Mar 2016 02:30:36 +0000 (02:30 +0000)]
Add missing initialization of queue btm_cb.sec_pending_q
am: 16c97b9

* commit '16c97b9a1732558868901f4315f4f0b3850be2a1':
  Add missing initialization of queue btm_cb.sec_pending_q

8 years agoCleanup after p_mcb if L2CA_ConnectReq() failed
Pavlin Radoslavov [Fri, 18 Mar 2016 08:02:45 +0000 (01:02 -0700)]
Cleanup after p_mcb if L2CA_ConnectReq() failed

If L2CA_ConnectReq() failed, make sure that
we cleanup the lcid cache state after the
affected p_mcb.

Also, extra check and a log message inside function
rfc_check_send_cmd().

Bug: 27334916
Change-Id: Ib2950d12ce456d74355f4bcc0e3c4d87603f8f91

8 years agoAdd missing initialization of queue btm_cb.sec_pending_q
Pavlin Radoslavov [Tue, 22 Mar 2016 01:47:09 +0000 (01:47 +0000)]
Add missing initialization of queue btm_cb.sec_pending_q
am: 6aef394

* commit '6aef394995e2c99bb29be05fa63298ea56ea3f60':
  Add missing initialization of queue btm_cb.sec_pending_q

8 years agoAdd missing initialization of queue btm_cb.sec_pending_q
Pavlin Radoslavov [Mon, 21 Mar 2016 23:35:41 +0000 (16:35 -0700)]
Add missing initialization of queue btm_cb.sec_pending_q

Bug: 27763878
Change-Id: I93001a679e22b744c3feafda1997e5f7e707db4e

8 years agoLog error code on wakelock acquisition/release failure
Andre Eisenbach [Tue, 22 Mar 2016 01:17:45 +0000 (01:17 +0000)]
Log error code on wakelock acquisition/release failure
am: b71bdd6

* commit 'b71bdd6f5bef9514eb358c4279dca57ae8c1df70':
  Log error code on wakelock acquisition/release failure

8 years agoLog error code on wakelock acquisition/release failure
Andre Eisenbach [Thu, 17 Mar 2016 23:51:36 +0000 (16:51 -0700)]
Log error code on wakelock acquisition/release failure

Bug: 27721443
Change-Id: I8ac9e738d916bfdcf125e33c0e09f90cc8d26d55

8 years agoCleanup after p_mcb if L2CA_ConnectReq() failed
Pavlin Radoslavov [Tue, 22 Mar 2016 00:37:31 +0000 (00:37 +0000)]
Cleanup after p_mcb if L2CA_ConnectReq() failed
am: 757047a

* commit '757047a147582d6c5be22f0fb5148005f345fc9b':
  Cleanup after p_mcb if L2CA_ConnectReq() failed

8 years agoAdd missing initialization of queue btm_cb.sec_pending_q
Pavlin Radoslavov [Mon, 21 Mar 2016 23:35:41 +0000 (16:35 -0700)]
Add missing initialization of queue btm_cb.sec_pending_q

Bug: 27763878
Change-Id: I93001a679e22b744c3feafda1997e5f7e707db4e

8 years agoCleanup after p_mcb if L2CA_ConnectReq() failed
Pavlin Radoslavov [Fri, 18 Mar 2016 08:02:45 +0000 (01:02 -0700)]
Cleanup after p_mcb if L2CA_ConnectReq() failed

If L2CA_ConnectReq() failed, make sure that
we cleanup the lcid cache state after the
affected p_mcb.

Also, extra check and a log message inside function
rfc_check_send_cmd().

Bug: 27334916
Change-Id: Ib2950d12ce456d74355f4bcc0e3c4d87603f8f91

8 years agoDon\'t clear the btsnoop log ringbuffer on compress.
Sharvil Nanavati [Mon, 21 Mar 2016 23:31:23 +0000 (23:31 +0000)]
Don\'t clear the btsnoop log ringbuffer on compress.
am: b35c234

* commit 'b35c23483633826617d2312be805df93aeb9d8ca':
  Don't clear the btsnoop log ringbuffer on compress.

8 years agoAdd config source to dumpsys output
Ajay Panicker [Mon, 21 Mar 2016 23:28:55 +0000 (23:28 +0000)]
Add config source to dumpsys output
am: 63ddbe8

* commit '63ddbe8813aac242071dffc0bd413ba60e6dd7bf':
  Add config source to dumpsys output

8 years agoDon't clear the btsnoop log ringbuffer on compress.
Sharvil Nanavati [Mon, 29 Feb 2016 23:50:49 +0000 (15:50 -0800)]
Don't clear the btsnoop log ringbuffer on compress.

Change-Id: I0bf4279104e87b151553eba913491d934f3cde41

8 years agoAdd config source to dumpsys output
Ajay Panicker [Mon, 21 Mar 2016 18:23:09 +0000 (11:23 -0700)]
Add config source to dumpsys output

This logs where the config file was loaded from in the Bluetooth
Manager dumpsys output.

Bug: 27354612
Change-Id: I50d4aaa0be4f4d1d890580b03742713f4345c80f

8 years agoAdd config source to dumpsys output
Ajay Panicker [Mon, 21 Mar 2016 23:23:17 +0000 (23:23 +0000)]
Add config source to dumpsys output
am: 190cf46

* commit '190cf46ff6937bceff146aec026cf9f53c40e84d':
  Add config source to dumpsys output

8 years agoAdd config source to dumpsys output
Ajay Panicker [Mon, 21 Mar 2016 18:23:09 +0000 (11:23 -0700)]
Add config source to dumpsys output

This logs where the config file was loaded from in the Bluetooth
Manager dumpsys output.

Bug: 27354612
Change-Id: I50d4aaa0be4f4d1d890580b03742713f4345c80f

8 years agoDo not leak eventfd\'s for RFCOMM/AVDT/L2CAP
Andre Eisenbach [Mon, 21 Mar 2016 16:21:31 +0000 (16:21 +0000)]
Do not leak eventfd\'s for RFCOMM/AVDT/L2CAP
am: 072bd75

* commit '072bd753e6ac2a011421cd7e4a2e622ee7d052fc':
  Do not leak eventfd's for RFCOMM/AVDT/L2CAP

8 years agoDo not leak eventfd\'s for RFCOMM/AVDT/L2CAP
Andre Eisenbach [Mon, 21 Mar 2016 16:11:58 +0000 (16:11 +0000)]
Do not leak eventfd\'s for RFCOMM/AVDT/L2CAP
am: 9ccca2b

* commit '9ccca2b5937ec42409d8b6354884f1f4b6d524f7':
  Do not leak eventfd's for RFCOMM/AVDT/L2CAP

8 years agoDo not leak eventfd's for RFCOMM/AVDT/L2CAP
Andre Eisenbach [Fri, 18 Mar 2016 09:09:58 +0000 (02:09 -0700)]
Do not leak eventfd's for RFCOMM/AVDT/L2CAP

Various users of fixed_queue's do not free the lists properly after
using them. As a result two event fd's leak for each fixed_queue that
is not free'd, as fixed_queue contains two semaphores.

This can lead to run-away file descriptor allocation and an eventual
hard limit leading to various undefined behaviours.

Bug: 27731859
Change-Id: If9ce64b711083bf474d217aa537220065722ad3a

8 years agoDo not leak eventfd's for RFCOMM/AVDT/L2CAP
Andre Eisenbach [Fri, 18 Mar 2016 09:09:58 +0000 (02:09 -0700)]
Do not leak eventfd's for RFCOMM/AVDT/L2CAP

Various users of fixed_queue's do not free the lists properly after
using them. As a result two event fd's leak for each fixed_queue that
is not free'd, as fixed_queue contains two semaphores.

This can lead to run-away file descriptor allocation and an eventual
hard limit leading to various undefined behaviours.

Bug: 27731859
Change-Id: If9ce64b711083bf474d217aa537220065722ad3a

8 years agoLog error code on wakelock acquisition/release failure
Andre Eisenbach [Fri, 18 Mar 2016 01:36:28 +0000 (01:36 +0000)]
Log error code on wakelock acquisition/release failure
am: f4f3b60

* commit 'f4f3b602395c8961fce5937f8e97a57db276b978':
  Log error code on wakelock acquisition/release failure

8 years agoLog error code on wakelock acquisition/release failure
Andre Eisenbach [Thu, 17 Mar 2016 23:51:36 +0000 (16:51 -0700)]
Log error code on wakelock acquisition/release failure

Bug: 27721443
Change-Id: I8ac9e738d916bfdcf125e33c0e09f90cc8d26d55

8 years agoMerge "Use audio_session_t consistently" into nyc-dev
Glenn Kasten [Thu, 17 Mar 2016 18:21:08 +0000 (18:21 +0000)]
Merge "Use audio_session_t consistently" into nyc-dev
am: 1b1bcbb

* commit '1b1bcbb3b0bc812410a3ee4f798570d40e0463bc':
  Use audio_session_t consistently

8 years agoDO NOT MERGE Check size of pin before replying
Marie Janssen [Thu, 17 Mar 2016 18:21:07 +0000 (18:21 +0000)]
DO NOT MERGE Check size of pin before replying
am: fcc536a

* commit 'fcc536af189dfe534e5e7c6b352ee114de71b3a1':
  DO NOT MERGE Check size of pin before replying

8 years agoMerge "Use audio_session_t consistently" into nyc-dev
Glenn Kasten [Thu, 17 Mar 2016 14:22:50 +0000 (14:22 +0000)]
Merge "Use audio_session_t consistently" into nyc-dev

8 years agoMerge "Wait for UHID interface on boot"
Warren Rehman [Thu, 17 Mar 2016 04:32:13 +0000 (04:32 +0000)]
Merge "Wait for UHID interface on boot"
am: 1302ca7

* commit '1302ca714a1fc812c392ab841253b5731e3c110b':
  Wait for UHID interface on boot

8 years agoMerge "Wait for UHID interface on boot"
wrehman [Thu, 17 Mar 2016 04:24:35 +0000 (04:24 +0000)]
Merge "Wait for UHID interface on boot"

8 years agoDon\'t send AT+BCC if local device doesn\'t support codec negotiation.
Sharvil Nanavati [Thu, 17 Mar 2016 00:22:39 +0000 (00:22 +0000)]
Don\'t send AT+BCC if local device doesn\'t support codec negotiation.
am: e79eaef

* commit 'e79eaef05e0778917dcc77d95292370d5aa4491e':
  Don't send AT+BCC if local device doesn't support codec negotiation.

8 years agoDon't send AT+BCC if local device doesn't support codec negotiation.
Sharvil Nanavati [Tue, 15 Mar 2016 20:13:45 +0000 (13:13 -0700)]
Don't send AT+BCC if local device doesn't support codec negotiation.

The current code only checked if the peer supported codec negotiation
before sending AT+BCC. But if codec negotation is disabled on the
local device, we should definitely not send AT+BCC.

Bug: 27213013
Change-Id: Id372a32a61a3d96d5c093bc50594ef0b8c2eff2e

8 years agoHID service discovery refactor
Jakub Pawlowski [Wed, 16 Mar 2016 19:27:22 +0000 (19:27 +0000)]
HID service discovery refactor
am: e8187e5

* commit 'e8187e565382ae9afb52a7992e9a6ab1e3108999':
  HID service discovery refactor

8 years agoRestructure GATTC
Jakub Pawlowski [Wed, 16 Mar 2016 19:27:22 +0000 (19:27 +0000)]
Restructure GATTC
am: 5204fd7

* commit '5204fd71b3ca799942c45a36548faeba4d89477d':
  Restructure GATTC

8 years agoHID service discovery refactor
Jakub Pawlowski [Tue, 15 Mar 2016 22:35:38 +0000 (15:35 -0700)]
HID service discovery refactor

This patch changes how HID is initialized.
Up till now, HID discovery was intricately chained,
to make sure two operations are not scheduled at same time.
From now on, all discovery is done and all operations are
scheduled for execution right away. There is separate set
of functions making sure all operations will be executed
without collisions.

This patch also removes BTA_HH_SCPP_INST_DEF, which was
used as hardcoded service id.

Bug: 27698756
Change-Id: I30a7388e129844c5e4727b2ed2b7c05867cc73a8

8 years agoRestructure GATTC
Jakub Pawlowski [Tue, 15 Mar 2016 22:35:00 +0000 (15:35 -0700)]
Restructure GATTC

This patch changes how GATTC is structured. Up till now, it
contained tBTA_GATTC_CACHE and tBTA_GATTC_CACHE_ATTR. Those
structures were so ugly, someone hide them inside internal
header, to make sure noone would ever access them from outside
GATTC. They are now replaced with:
tBTA_GATTC_SERVICE,
tBTA_GATTC_CHARACTERISTIC,
tBTA_GATTC_DESCRIPTOR and
tBTA_GATTC_INCLUDED_SVC.

Those looks much better, and were made globally avaliable.
Thanks to way they're build, we no longer need set of access
methods, which were also very ugly:
BTA_GATTC_GetFirstChar
BTA_GATTC_GetNextChar
BTA_GATTC_GetFirstIncludedService
etc.

This patch breaks HID, DO NOT SUBMIT without HID refactor.

Bug: 27455533
Change-Id: Ic42cfff175e0cc1a0d8e1a1216e2b4b756cbf77d

8 years agoAdd LE L2CAP Connection Oriented Channel
Navin Kochar [Wed, 16 Mar 2016 18:59:34 +0000 (18:59 +0000)]
Add LE L2CAP Connection Oriented Channel
am: 6721232

* commit '6721232129f137ab024d9b95fc1094a714bc4c01':
  Add LE L2CAP Connection Oriented Channel

8 years agoStart listener thread only after successful open call
Srinu Jella [Wed, 16 Mar 2016 18:59:34 +0000 (18:59 +0000)]
Start listener thread only after successful open call
am: 95b9bc0

* commit '95b9bc0e533545a14cf12877c72e0d96ab4370fd':
  Start listener thread only after successful open call

8 years agoDO NOT MERGE Check size of pin before replying
Marie Janssen [Wed, 9 Mar 2016 23:31:48 +0000 (15:31 -0800)]
DO NOT MERGE Check size of pin before replying

If a malicious client set a pin that was too long it would overflow
the pin code memory.

Bug: 27411268
Change-Id: I9197ac6fdaa92a4799dacb6364e04671a39450cc

8 years agoAdd LE L2CAP Connection Oriented Channel
Navin Kochar [Wed, 9 Mar 2016 17:41:53 +0000 (23:11 +0530)]
Add LE L2CAP Connection Oriented Channel

This implementation for LE L2CAP Connection Oriented Channel (a Bluetooth
Core Spec 4.1 feature) has been tested on the following formal and informal
IOP events conducted by BT SIG Sport and Fitness Working Group.

* Informal IOP – Tokyo 2014
* UPF 49 – Berlin 2014
* Formal IOP – Tokyo 2014
* Formal IOP – Santa Clara 2015

Change-Id: Ia6de62f9321a78b98930629f65078884157a9c0d
Signed-off-by: Navin Kochar <navin.kochar@intel.com>
8 years agoStart listener thread only after successful open call
Srinu Jella [Fri, 22 Jan 2016 12:19:15 +0000 (17:49 +0530)]
Start listener thread only after successful open call

Use case: Stress tests ON\OFF with different concurrent
scenarios

Failure: Crash in btsnoop_net_listen thread

Root cause: While starting and shutting down the module
we are calling same function update_logging(). While at
the start it is creating listen thread and throwing error
and exiting without closing the listen thread. While
shutdown of module it "should_log" matches with "is_logging"
and it considers cleanup is not required and returns,
leaving Behind the listen thread open. In the next BT ON,
another listen thread is created and causes the crash.

Fix: Started listener thread after prerequisite operations
are successful.

Change-Id: I92ef293d9b061d0ea65a0c41b506870152114bb0

8 years agoWait for UHID interface on boot
Warren Rehman [Thu, 10 Mar 2016 11:02:10 +0000 (20:02 +0900)]
Wait for UHID interface on boot

Poll and sleep to wait for UHID interface on boot to avoid losing
initial input event after boot.

Bug: 27442119
Change-Id: Ie2141c94624363385951c8316ad854d6ae2e82ec

8 years agoAllocate sufficient memory for FCS
Srinu Jella [Tue, 15 Mar 2016 18:11:30 +0000 (18:11 +0000)]
Allocate sufficient memory for FCS
am: f6a64de84f

* commit 'f6a64de84ff3045d6b4e5a9de44da947f597fbb7':
  Allocate sufficient memory for FCS

8 years agoAllocate sufficient memory for FCS
Srinu Jella [Tue, 15 Mar 2016 11:06:19 +0000 (16:36 +0530)]
Allocate sufficient memory for FCS

Use Case: Hit LeakCanary detection during HDP

Failure: Crash while running LeakCanary detection.

Root cause: Did not have sufficient memory for data frame
which lead to crash.

Fix: Allocating sufficient memory for the data frame
which includes FCS in the header field.

Change-Id: I3bb862f29ecc854423796dc89820ba21c5db6050

8 years agoosi: add osi_rand()
Marie Janssen [Mon, 14 Mar 2016 22:52:40 +0000 (22:52 +0000)]
osi: add osi_rand()
am: 093f013ab8

* commit '093f013ab883ed2ffeef875b17fd940dd92af659':
  osi: add osi_rand()

8 years agoosi: add osi_rand()
Marie Janssen [Thu, 10 Mar 2016 19:27:53 +0000 (11:27 -0800)]
osi: add osi_rand()

Provide a replacement for rand() which has a better random source.

Change-Id: I38a8c74d86b89ec160b43b0f648f53b463be89bb

8 years agoRemoved unused function bta_sys_vs_hdl()
Pavlin Radoslavov [Mon, 14 Mar 2016 19:56:21 +0000 (19:56 +0000)]
Removed unused function bta_sys_vs_hdl()
am: bea3130893

* commit 'bea31308930f20aac1f7422f262e509e9f51f084':
  Removed unused function bta_sys_vs_hdl()

8 years agoRemoved unused function bta_sys_vs_hdl()
Pavlin Radoslavov [Mon, 14 Mar 2016 16:45:24 +0000 (09:45 -0700)]
Removed unused function bta_sys_vs_hdl()

Change-Id: Iaf199d418aafc0b518df2f7febfa1c9e29f1fa42

8 years agoRemoved duplicate (re)define of BTA_DM_SDP_DB_SIZE
Pavlin Radoslavov [Mon, 14 Mar 2016 18:53:05 +0000 (18:53 +0000)]
Removed duplicate (re)define of BTA_DM_SDP_DB_SIZE
am: f958ee655d

* commit 'f958ee655d67b78018a56a593b6e669ca543991e':
  Removed duplicate (re)define of BTA_DM_SDP_DB_SIZE

8 years agoRemoved duplicate (re)define of BTA_DM_SDP_DB_SIZE
Pavlin Radoslavov [Mon, 14 Mar 2016 17:06:45 +0000 (10:06 -0700)]
Removed duplicate (re)define of BTA_DM_SDP_DB_SIZE

Removed conditional duplicate re-define of BTA_DM_SDP_DB_SIZE.
BTA_DM_SDP_DB_SIZE has been already (conditionally) defined to 8000
in file include/bt_target.h

The conditional re-define of BTA_DM_SDP_DB_SIZE to a smaller
value (250) in file bta/dm/bta_dm_int.h should be removed, because
it is confusing and error-prone.

Change-Id: Id10a45562c7c57fd0a9131ef50b7b7a5c2801ec5

8 years agoFree allocation tracker hash map entries to reduce memory pressure
Srinu Jella [Mon, 14 Mar 2016 16:24:30 +0000 (16:24 +0000)]
Free allocation tracker hash map entries to reduce memory pressure
am: 2bea757aba

* commit '2bea757aba0d0d84865d7d0d675d8bcf31f90b22':
  Free allocation tracker hash map entries to reduce memory pressure

8 years agoFree allocation tracker hash map entries to reduce memory pressure
Srinu Jella [Mon, 14 Mar 2016 16:08:54 +0000 (16:08 +0000)]
Free allocation tracker hash map entries to reduce memory pressure
am: bb9148eda2

* commit 'bb9148eda25d7d39399fd837d4b13be9b4ecccb4':
  Free allocation tracker hash map entries to reduce memory pressure

8 years agoFree allocation tracker hash map entries to reduce memory pressure
Srinu Jella [Fri, 6 Nov 2015 09:29:10 +0000 (14:59 +0530)]
Free allocation tracker hash map entries to reduce memory pressure

Use case:
A2DP playback becomes choppy after long hours of testing.

Steps:
1. installed 3rd party app that performs recurring LE scans.
2. Leave phone to run overnight.
3. After 24h+, connect a Bluetooth headset and music is very choppy.

Root cause:
The memory allocation tracker has support for double free check
where it stores all allocations in hash map but it never get
removed to track double free issue, A2DP memory allocation is
taking more time and leading to choppyness.

Fix:
Free the hash map entry to avoid memory leak from
allocation tracker.

Bug: 27621407
Change-Id: If57bd0b89c1d9b99c4f066c537a9e0fa49bc093f

8 years agoFree allocation tracker hash map entries to reduce memory pressure
Srinu Jella [Fri, 6 Nov 2015 09:29:10 +0000 (14:59 +0530)]
Free allocation tracker hash map entries to reduce memory pressure

Use case:
A2DP playback becomes choppy after long hours of testing.

Steps:
1. installed 3rd party app that performs recurring LE scans.
2. Leave phone to run overnight.
3. After 24h+, connect a Bluetooth headset and music is very choppy.

Root cause:
The memory allocation tracker has support for double free check
where it stores all allocations in hash map but it never get
removed to track double free issue, A2DP memory allocation is
taking more time and leading to choppyness.

Fix:
Free the hash map entry to avoid memory leak from
allocation tracker.

Bug: 27621407
Change-Id: If57bd0b89c1d9b99c4f066c537a9e0fa49bc093f

8 years agoAdd pair event device class and fix timestamp
Ajay Panicker [Fri, 11 Mar 2016 23:51:18 +0000 (23:51 +0000)]
Add pair event device class and fix timestamp
am: fecf606348

* commit 'fecf606348a0751e0be30e376c9817195afe68ca':
  Add pair event device class and fix timestamp

8 years agoAdd pair event device class and fix timestamp
Ajay Panicker [Thu, 10 Mar 2016 23:30:16 +0000 (15:30 -0800)]
Add pair event device class and fix timestamp

Added a function to get the device class to use with pair events.
Also update check_cod_hid as it was only being used with COD_HID_MAJOR.
Also fixed an issue with pair event timestamps where they were
using the wrong clock.

Bug: 27499938
Change-Id: I0805d7a3f82b28e7d7e73d80818948843f51a82b

8 years agoMerge "Add pair event device class and fix timestamp"
Ajay Panicker [Fri, 11 Mar 2016 19:44:55 +0000 (19:44 +0000)]
Merge "Add pair event device class and fix timestamp"
am: 00ada513e7

* commit '00ada513e7a034ac372557de5ef8097fc99a9109':
  Add pair event device class and fix timestamp

8 years agoMerge "Add pair event device class and fix timestamp"
Ajay Panicker [Fri, 11 Mar 2016 19:33:21 +0000 (19:33 +0000)]
Merge "Add pair event device class and fix timestamp"

8 years agoAdd pair event device class and fix timestamp
Ajay Panicker [Thu, 10 Mar 2016 23:30:16 +0000 (15:30 -0800)]
Add pair event device class and fix timestamp

Added a function to get the device class to use with pair events.
Also update check_cod_hid as it was only being used with COD_HID_MAJOR.
Also fixed an issue with pair event timestamps where they were
using the wrong clock.

Bug: 27499938
Change-Id: I0805d7a3f82b28e7d7e73d80818948843f51a82b

8 years agoFix startup error when no config file provided
Jakub Pawlowski [Thu, 10 Mar 2016 20:08:31 +0000 (20:08 +0000)]
Fix startup error when no config file provided
am: e919eda232

* commit 'e919eda23208efd6c8d94e27d973632551412b95':
  Fix startup error when no config file provided

8 years agoFix startup error when no config file provided
Jakub Pawlowski [Thu, 10 Mar 2016 17:20:45 +0000 (09:20 -0800)]
Fix startup error when no config file provided

If bluetoothtbd was started without config file
present, it would die on asserts about missing config.
From now it'll proceed with default settings.

Change-Id: I46c35fb2ed71efa49430206da13a19ca7df44a64

8 years agoMerge "Linux vendor driver linkage fixes"
Jakub Pawlowski [Thu, 10 Mar 2016 19:06:44 +0000 (19:06 +0000)]
Merge "Linux vendor driver linkage fixes"
am: a15f218c9c

* commit 'a15f218c9c3164d943bbf32b463d6a9d866e76bd':
  Linux vendor driver linkage fixes

8 years agoMerge "Linux vendor driver linkage fixes"
Jakub Pawlowski [Thu, 10 Mar 2016 18:58:43 +0000 (18:58 +0000)]
Merge "Linux vendor driver linkage fixes"

8 years agoLinux vendor driver linkage fixes
Jakub Pawlowski [Thu, 10 Mar 2016 17:25:48 +0000 (09:25 -0800)]
Linux vendor driver linkage fixes

Linux driver depends on osi, so it must be linked with it.
It also must export bt_vendor_interface_t, and named properly,
otherwise it is not being recognized as vendor library.

Bug: 27589244
Change-Id: Ib6817b11e4226f2e289ff0d521daca059ca9aca6

8 years agoUse audio_session_t consistently
Glenn Kasten [Tue, 8 Mar 2016 20:12:33 +0000 (12:12 -0800)]
Use audio_session_t consistently

Bug: 27562099
Change-Id: I10780c8bfc84af568795a2c15557020fbe89a1c4

8 years agoMerge "Fix build error caused by missing LOG_TAG"
Patrick Tsai [Wed, 9 Mar 2016 19:31:43 +0000 (19:31 +0000)]
Merge "Fix build error caused by missing LOG_TAG"
am: a34a404e3d

* commit 'a34a404e3d59b7c25a64471b4502f37c2c75d4de':
  Fix build error caused by missing LOG_TAG

8 years agoMerge "Add missing \'cd third_party\' step"
Patrick Tsai [Wed, 9 Mar 2016 19:31:43 +0000 (19:31 +0000)]
Merge "Add missing \'cd third_party\' step"
am: 8b1e8c3154

* commit '8b1e8c3154884451a4d71db4583334ba1c09729b':
  Add missing 'cd third_party' step