OSDN Git Service

android-x86/system-bt.git
7 years agoAV: Use separate AV sig timeout timer for dual connections.
Sumit Bajpai [Wed, 14 Jun 2017 08:45:25 +0000 (14:15 +0530)]
AV: Use separate AV sig timeout timer for dual connections.

In dual a2dp connection scenario, if both remote devices
initiate connection at same time, DUT replaces AV signalling
timeout timer which started for 1st device when avdtp l2cap
sig channel was established with that of 2nd device when
its channel is established. In case remote1 doesn't start
AV signalling procedure hence, then DUT also fails to do
so as timer for remote1 was lost. The fix keeps two separate
timers for two connections.

Change-Id: I3ceea4f035a115985d692d30f39c3a0e4729a323

7 years agoMerge "SDP: Dont start SDP search with invalid BD Addr" into bt.lnx.2.1.c1-dev
CNSS_WLAN Service [Fri, 16 Jun 2017 05:55:44 +0000 (22:55 -0700)]
Merge "SDP: Dont start SDP search with invalid BD Addr" into bt.lnx.2.1.c1-dev

7 years agoMerge "Fix: btapp will crash when pair request from both DUT & Remote device simultan...
CNSS_WLAN Service [Fri, 9 Jun 2017 11:32:26 +0000 (04:32 -0700)]
Merge "Fix: btapp will crash when pair request from both DUT & Remote device simultaneously" into bt.lnx.2.1.c1-dev

7 years agoFix: btapp will crash when pair request from both DUT & Remote device simultaneously
Tim Jiang [Tue, 23 May 2017 10:07:24 +0000 (06:07 -0400)]
Fix: btapp will crash when pair request from both DUT & Remote device simultaneously

Invalid p_rec_dev->p_callback pointer cause this issue.

CRs-Fixed: 2050966
Change-Id: Id624f0eb656dc782948d14542e4d321abff4339f

7 years agoRFCOMM: stop multiplexer disconnect timer while reconnect DLC
zhenchao [Thu, 18 May 2017 08:11:26 +0000 (16:11 +0800)]
RFCOMM: stop multiplexer disconnect timer while reconnect DLC

In very low rate, re-send file failed due to rfcomm multiplexer
disconnect timer timeout while reconnect RFCOMM DLC. During
reconnection, sender sent SABM to establish DLC and await UA.
But multiplexer disconnect timer of receiver timeout so that
rfcomm connection disconnect.

Change-Id: Ied08635e3f786a175dab192a5aba069f33d3f36f
CRs-Fixed: 2054878

7 years agoMerge "Cancel the link idle timer during gatt_connect"
Linux Build Service Account [Tue, 30 May 2017 21:12:58 +0000 (14:12 -0700)]
Merge "Cancel the link idle timer during gatt_connect"

7 years agoMerge "Fix time consuming doing Bluetooth OFF/ON while a2dp steaming." into bt.lnx...
CNSS_WLAN Service [Wed, 17 May 2017 07:32:28 +0000 (00:32 -0700)]
Merge "Fix time consuming doing Bluetooth OFF/ON while a2dp steaming." into bt.lnx.2.1.c1-dev

7 years agoMerge "resolve merge conflicts of a3ee2e35 to nyc-dev"
Linux Build Service Account [Sat, 13 May 2017 11:39:27 +0000 (04:39 -0700)]
Merge "resolve merge conflicts of a3ee2e35 to nyc-dev"

7 years agoresolve merge conflicts of a3ee2e35 to nyc-dev
Pavlin Radoslavov [Tue, 14 Mar 2017 21:46:15 +0000 (14:46 -0700)]
resolve merge conflicts of a3ee2e35 to nyc-dev

Bug: 34946955
Change-Id: Ieff690edd3aa527a0639483ec8e1e3b661f0ecc4
Merged-In: I0b6f50dee05a58db8c043b4d01fb58c9acbeede9
(cherry picked from commit 1c6662b6263298b97122ab308d8dde1d5ed66ef7)

7 years agoSDP: Add logic to downgrade PBAP version for blacklisted device
siminy [Tue, 25 Apr 2017 07:03:10 +0000 (15:03 +0800)]
SDP: Add logic to downgrade PBAP version for blacklisted device

As some remote devices go in bad state on parsing PBAP 1.2 SDP record.
Add them to PBAP version downgrade blacklist.Upgrade PBAP version
downgrade logic from to include name based blacklist and also remove
SDP attributes not suppported in PBAP 1.1 specifications like
GoepL2capPsm, SupportedFeatures.

CRs-Fixed: 2038030
Change-Id: I7fdb0433353ba5793470313d205a68e8eb3fb5ac

7 years agoFix time consuming doing Bluetooth OFF/ON while a2dp steaming.
juncao [Fri, 10 Mar 2017 08:19:15 +0000 (16:19 +0800)]
Fix time consuming doing Bluetooth OFF/ON while a2dp steaming.

When BT off, DUT send the avdtp suspend cmd to remote, at the same time
BT also do BREDR cleanup work, it shall make av state machine goes
into closing state. It will not repsonde to suspend response from remote,
hence the A2DP COMMND form audio HAL doesn't got ACK. The fix shall
ACK the pending command before clear the UIPC channel.

Change-Id: I04ec116773bd8bfd033c76e9645acc06138b52e0
CRs-Fixed: 2017829

7 years agoMerge "Fix timestamp error in btsnoop log"
Linux Build Service Account [Fri, 5 May 2017 11:19:49 +0000 (04:19 -0700)]
Merge "Fix timestamp error in btsnoop log"

7 years agoMerge "Configure correct remote MTU"
Linux Build Service Account [Fri, 5 May 2017 11:19:48 +0000 (04:19 -0700)]
Merge "Configure correct remote MTU"

7 years agoFix timestamp error in btsnoop log
zhenchao [Thu, 1 Dec 2016 09:43:43 +0000 (17:43 +0800)]
Fix timestamp error in btsnoop log

Overflow occurs while caculate the time of packet arrival.
Type convert timestamp to 64-bit unsigned integer to avoid
overflow issue.

CRs-Fixed: 1095999
Change-Id: I7bcff61d36249fd1a2d2101ec4745b7f7426fe0f

7 years agoMerge "Fix HOGP report handling with HOGP devices"
Linux Build Service Account [Wed, 26 Apr 2017 16:49:12 +0000 (09:49 -0700)]
Merge "Fix HOGP report handling with HOGP devices"

7 years agoMerge "uipc: retry to create srv chan if EADDRINUSE error" into bt.lnx.2.1.c1-dev
CNSS_WLAN Service [Wed, 26 Apr 2017 13:01:25 +0000 (06:01 -0700)]
Merge "uipc: retry to create srv chan if EADDRINUSE error" into bt.lnx.2.1.c1-dev

7 years agocheck controller state before handling gatt client request.
Pradeep Panigrahi [Thu, 16 Mar 2017 05:35:28 +0000 (11:05 +0530)]
check controller state before handling gatt client request.

Add change to ensure that controller interface is ready before
trying to handle client request for cleaning up the client
interface . This will fix stability issues,where assert is
happening while we try to access controller module before its ready.

CRs-fixed: 2019822
Change-Id: I227659b7e6973589c72c50af46a54878bdab5b32

7 years agoMerge "Fix BLE stability issues when BT is being turned off" into bt.lnx.2.1.c1-dev
CNSS_WLAN Service [Tue, 25 Apr 2017 10:22:30 +0000 (03:22 -0700)]
Merge "Fix BLE stability issues when BT is being turned off" into bt.lnx.2.1.c1-dev

7 years agoSDP: Dont start SDP search with invalid BD Addr
Venkata Jagadeesh Garaga [Fri, 14 Apr 2017 09:35:01 +0000 (15:05 +0530)]
SDP: Dont start SDP search with invalid BD Addr

When any profile initiates SDP search with null bd addr
connection fails with page time out and SDP state machine
will stuck in search active state until bt reset.

Hence dont allow any service search with NULL bd addr

Change-Id: I43f47e61a31cf917a4ddc1a9e6c5c13a25f8730d

7 years agoConfigure correct remote MTU
juncao [Tue, 25 Apr 2017 09:44:16 +0000 (17:44 +0800)]
Configure correct remote MTU

Remote MTU shall be configured to L2CAP_DEFAULT_MTU if
there is no MTU in configuration request

Change-Id: Ic7f0bb53dce9fe1b72bf34c61c0b6ea3daf1e025
CRs-Fixed: 2031104

7 years agoFix BLE stability issues when BT is being turned off
Pradeep Panigrahi [Thu, 30 Mar 2017 19:15:22 +0000 (00:45 +0530)]
Fix BLE stability issues when BT is being turned off

Incorporates the following changes to take care of BLE
stability issues:

1) Third party apps are not in sync with bluetooth adapter and
sometimes call gatt client/server calls while bluetooth is
turning off, causing assert. Add change to not process the
application request at btif, if the bluetooth adapter is not
ready or is turning off.

2) return max adv instance count as 0 if controller interface is
not ready.

Change-Id: Ie052c7ecafe4816a8c2fbc212a3b52a25b08543c

7 years agoDouble Audio stream output buffer size.
Satheesh Kumar Pallemoni [Fri, 24 Mar 2017 11:37:15 +0000 (17:07 +0530)]
Double Audio stream output buffer size.

To align with the frame size, double Audio
stream output buffer size.

CRs-Fixed: 2019703
Change-Id: I89720e636acf645a6cd9288a45ac543d7cd3da21

7 years agoN-MR2 N2G47H merge '5a9925784a4a34811ae29608b67dee4a580c226b' - conflicts
Bharat Pawar [Wed, 5 Apr 2017 09:49:40 +0000 (15:19 +0530)]
N-MR2 N2G47H merge '5a9925784a4a34811ae29608b67dee4a580c226b' - conflicts

Change-Id: Icc1ccd435f30b32723d218078bfedbca647c210d

7 years agouipc: retry to create srv chan if EADDRINUSE error
Mingbo Zhang [Tue, 28 Mar 2017 05:40:31 +0000 (13:40 +0800)]
uipc: retry to create srv chan if EADDRINUSE error

In very rare cases, socket cannot be closed in time.
Then we will fail to create the same socket immediately.
So need to retry after EADDRINUSE error happens

Change-Id: I1e54ded102d38cd42b3df40d405205a79b08928b
CRs-Fixed: 2029248

7 years agoMerge "Open acceptor channel for RC on cleanup" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Tue, 4 Apr 2017 07:29:09 +0000 (00:29 -0700)]
Merge "Open acceptor channel for RC on cleanup" into bt.lnx.2.1.c1-dev

7 years agoMerge "BT_BOND: Report repeated_attempts failure to application" into bt.lnx.2.1...
Service qcabuildsw [Fri, 31 Mar 2017 09:44:25 +0000 (02:44 -0700)]
Merge "BT_BOND: Report repeated_attempts failure to application" into bt.lnx.2.1.c1-dev

7 years agoMerge "A2dp connection failing with connection timeout" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Fri, 31 Mar 2017 09:43:49 +0000 (02:43 -0700)]
Merge "A2dp connection failing with connection timeout" into bt.lnx.2.1.c1-dev

7 years agoOpen acceptor channel for RC on cleanup
Ayan Ghosh [Mon, 20 Feb 2017 14:20:57 +0000 (19:50 +0530)]
Open acceptor channel for RC on cleanup

Open acceptor channel for RC on cleanup
as if there will be no listening acceptor
then some Remotes unable to connect AVRC
connection upon remote restart.

CRs-Fixed: 2009617
Change-Id: I65a477a2976e863ef38b9ff85ecdc72303a46654

7 years agoFix HOGP report handling with HOGP devices
Pradeep Panigrahi [Thu, 16 Mar 2017 10:50:51 +0000 (16:20 +0530)]
Fix HOGP report handling with HOGP devices

This fixes com.android.bluetooth crash when receiving HOGP reports
for unknown characteristic.

CRs-fixed: 2020549

Change-Id: I29cf2824d12a26aaedde31e156f1b7bf69af65e6

7 years agoCancel the link idle timer during gatt_connect
Pradeep Panigrahi [Wed, 22 Mar 2017 06:02:40 +0000 (11:32 +0530)]
Cancel the link idle timer during gatt_connect

When app use link count becomes zero, we start an link idle
timeout of 1 sec, post which we send disconnection. Meanwhile
if we get connect request from app to hold the link before
the 1 sec timer expiration, we should cancel the link idle
timer, other wise the link will get disconnected irrespective
of app use link count being greater than zero. Add change to
cancel the link idle timer while updating app's link hold count

CRs-Fixed: 2018001

Change-Id: I41682be1476d4c1c4ee58061407b94cfd2a2657a

7 years agoBT_BOND: Report repeated_attempts failure to application
juncao [Wed, 15 Mar 2017 10:53:24 +0000 (18:53 +0800)]
BT_BOND: Report repeated_attempts failure to application

This change will ensure BT stack to  send repeated attempts
failure reason code to upper application.

Change-Id: Id0d5a323daabcd0a50193bb7bc6fde18fde3c5ad
CRs-Fixed: 2020250

7 years agoMerge "Enable authentication for a2dp" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Tue, 14 Mar 2017 06:50:00 +0000 (23:50 -0700)]
Merge "Enable authentication for a2dp" into bt.lnx.2.1.c1-dev

7 years agoHandle LE enhanced conn complete for rpa resolve
siminy [Tue, 28 Feb 2017 10:12:18 +0000 (18:12 +0800)]
Handle LE enhanced conn complete for rpa resolve

Handle LE Enhanced Connection Complete Event when
handling random address complete on connection
complete event.

CRs-Fixed: 2012478
Change-Id: Ice128c5595f6e7a53958db2e388d25fc25733fc0

7 years agoMerge "BT: Pairing fails when it coincides with role switch with 3rd device" into...
Service qcabuildsw [Mon, 27 Feb 2017 10:23:48 +0000 (02:23 -0800)]
Merge "BT: Pairing fails when it coincides with role switch with 3rd device" into bt.lnx.2.1.c1-dev

7 years agoMerge "HID: Correct Max latency used for SSR" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Thu, 23 Feb 2017 07:42:16 +0000 (23:42 -0800)]
Merge "HID: Correct Max latency  used for SSR" into bt.lnx.2.1.c1-dev

7 years agoBT: Pairing fails when it coincides with role switch with 3rd device
Nitin Arora [Fri, 19 Aug 2016 00:54:22 +0000 (17:54 -0700)]
BT: Pairing fails when it coincides with role switch with 3rd device

Authentication complete after role switch with a device after
role switch caused initialization of sdp and finally change
in bond state machine. This becomes a problem a bonding activity
is also in progress.

Added condition to ensure initialization of sdp only when
authentication complete has arrived from the same device for
which bonding was initialized.

Change-Id: I7b213ac73ba5107f5da7d11305cd349e4d310062
CRs-Fixed: 1105371

7 years agoPAN: decrease number of PAN connection while BNEP connect fail
zhenchao [Fri, 30 Dec 2016 05:45:12 +0000 (13:45 +0800)]
PAN: decrease number of PAN connection while BNEP connect fail

While BNEP connect request and BNEP connect indication occur at
the same time. BNEP connect would fail, but PAN connection number
is not decreased by one after return failure. So that subsequent
PAN connection always fail.

CRs-Fixed: 1106396
Change-Id: I7b612323891eb4205b2dd6dcd8df7a527d875f09

7 years agoMerge "BT: Resetting BTA dm state while sending disable event" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Wed, 8 Feb 2017 03:24:49 +0000 (19:24 -0800)]
Merge "BT: Resetting BTA dm state while sending disable event" into bt.lnx.2.1.c1-dev

7 years agoMerge "Do not use remote device's preferred connection params." into bt.lnx.2.1.c1-dev
Service qcabuildsw [Wed, 8 Feb 2017 03:24:09 +0000 (19:24 -0800)]
Merge "Do not use remote device's preferred connection params." into bt.lnx.2.1.c1-dev

7 years agoBT: Disable outgoing profile connection in collision
Venkata Jagadeesh Garaga [Mon, 30 Jan 2017 09:59:13 +0000 (15:29 +0530)]
BT: Disable outgoing profile connection in collision

Disable outgoing profile connection in collision case
for Honda HFT Remote Device.

Change-Id: I48e4b5117bec9cb26fc22a2b3c83a7254b7b03de
CRs-fixed: 2001484

7 years agoMerge "Fix for the issues reported by static analysis tool." into bt.lnx.2.1.c1-dev
Service qcabuildsw [Thu, 2 Feb 2017 17:07:56 +0000 (09:07 -0800)]
Merge "Fix for the issues reported by static analysis tool." into bt.lnx.2.1.c1-dev

7 years agoMerge "Prevents rejection of valid max connection interval parameter update requests...
Service qcabuildsw [Wed, 1 Feb 2017 06:31:44 +0000 (22:31 -0800)]
Merge "Prevents rejection of valid max connection interval parameter update requests" into bt.lnx.2.1.c1-dev

7 years agoMerge "Bluetooth: fix fd leak during add/remove gatt service" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Mon, 30 Jan 2017 09:01:40 +0000 (01:01 -0800)]
Merge "Bluetooth: fix fd leak during add/remove gatt service" into bt.lnx.2.1.c1-dev

7 years agoBT: Resetting BTA dm state while sending disable event
Gurpreet Ghai [Thu, 29 Dec 2016 14:42:16 +0000 (20:12 +0530)]
BT: Resetting BTA dm state while sending disable event

Problem: When disable timer fires after waiting for closure
of ACL connections, bta dm disable event is sent. However,
the bta dm state is not reset. This causes, next enable
sequence to return without starting modules.

Error: When controller module is not initialized during enable
sequence and controller module functions are accessed, assert
occurs causing Bluetooth process to crash.

Fix: The disable event must be sent from proper channel by
calling the appropriate callback even in the case of timeout.

CRs-Fixed: 1105610
Change-Id: I866617f1f443c90a0a9ee16a90bafea709e262cd

7 years agoMerge "RFCOMM: Incoming connection from car radio failing" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Fri, 27 Jan 2017 04:57:08 +0000 (20:57 -0800)]
Merge "RFCOMM: Incoming connection from car radio failing" into bt.lnx.2.1.c1-dev

7 years agoPrevents rejection of valid max connection interval parameter update requests
Pradeep Panigrahi [Tue, 3 Nov 2015 07:59:55 +0000 (13:29 +0530)]
Prevents rejection of valid max connection interval parameter update requests

Min connection interval is updated to BTM_BLE_CONN_INT_LIMIT(11.25 ms)
if the requested min is < 11.25 ms. The L2CAP connection update request
is rejected if max connection interval requested is < 11.25 ms since
max connection interval becomes less than the min connection interval
(11.25 ms) in the host logic in l2cble_process_sig_cmd fucntion. Hence,
max connection interval parameter requests with 7.5 ms are rejected
currently.

CRs-fixed: 934966

Change-Id: I59afb07c9f8c1eb4cb1fc4c938710ec24761debb

7 years agoRFCOMM: Incoming connection from car radio failing
venkata Jagadeesh Garaga [Thu, 12 Jan 2017 10:51:49 +0000 (16:21 +0530)]
RFCOMM: Incoming connection from car radio failing

When incoming rfcomm connection(multiplexer channel)
established,trigger port start cnf if at least one
opening port is pending from DUT side,otherwise
DUT starts 2 sec mcb inactivity timer and
initiates rfcomm disc after 2 sec which causes
incoming connection failures.

Change-Id: Ia8671d83523c368fbf1441fe42a66067fb99d1fd
CRs-Fixed: 1113361

7 years agoCorrected default value assignments in Bluetooth A2DP Metrics
Jack He [Fri, 20 Jan 2017 19:17:44 +0000 (11:17 -0800)]
Corrected default value assignments in Bluetooth A2DP Metrics

* In certain cases btif_media_task_stop_aa_req() could be called before
  btif_media_task_start_aa_req() is called, resulting in session_start_us
  to be 0. In this case, audio_duration_ms = time_now_us() - 0 will be a
  very large number that is not the actual audio duration.This CL marks
  audio_duration_ms as -1 in the above situation so that we can
  differentiate between valid and invalid audio durations
* Set default timer and counter values to 0 when
  tx_queue_dequeue_stats.total_updates > 1
* Move update_scheduling_stats for tx_queue_enqueue_stats to
  btif_media_task_aa_handle_timer as we intend to capture the time
  intervals for enqueue scheduling instead of time intervals between
  frame enqueue (i.e. one scheduling event can enqueue multiple frames)
* Use tx_queue_enqueue_stats instead of *dequeue* since only enqueue is
  triggered by timer event

Bug: 33694310
Test: Code compilation, BtFunhausMetricsTest
Change-Id: I10984920afd4d77f07a5ac75736f8dcd69b13af8

7 years agoA2dp connection failing with connection timeout
Venkata Jagadeesh Garaga [Thu, 8 Dec 2016 11:56:01 +0000 (17:26 +0530)]
A2dp connection failing with connection timeout

Steps:
1. Pair and connect carkit from DUT
2. Disconnect the carkit from DUT
3. Unpair DUT from carkit menu and initiate pair from carkit
   Pairing and a2dp connection should be successful
Failure: Paring and a2dp connection failing

Root Cause: As stack posting authentication failure to upper layers
when SOC gives key missing error code remote removed from
DUT paired list, but same time lower layers keep retrying
for missing key and leading to connection failure.

Fix: Don't post authentication complete to upper layers when stack
re trying for security in key missing or transaction collision cases

Change-Id: I970c8679bf27801fe46f8dd757d6435ed500f77f
CRs-fixed: 1106139

7 years agoBluetooth: fix fd leak during add/remove gatt service
Pradeep Panigrahi [Thu, 5 Jan 2017 19:00:03 +0000 (00:30 +0530)]
Bluetooth: fix fd leak during add/remove gatt service

Fix a crash issue which is caused due to FD leak, while we
are adding service from a gattServer.

Use Case:
Add service/Remove service from LE application

Failure: Bluetooth crash because FD leak is causing
the limit of open file descriptors to be exhausted.

Fix: While adding service we were allocating memory for same service
buffer twice causing fd leak. Add change to avoid redundant memory
allocation during service addition.

CRs-fixed: 1113473

Change-Id: I5676534a0c05a81e508e7ed9495b739ca3be0493

7 years agoPut a check to avoid buffer overflow.
Satheesh Kumar Pallemoni [Mon, 16 Jan 2017 09:20:18 +0000 (14:50 +0530)]
Put a check to avoid buffer overflow.

Possible buffer overflow due to unvalidated user supplied length
in a2dp_ctrl_receive(). To avoid this keep a check on the length
of the received data.

CRs-Fixed: 1108527
Change-Id: I96a23f49075b825b5d33327980a420e52d624372

7 years agoFix for the issues reported by static analysis tool.
Satheesh Kumar Pallemoni [Fri, 20 Jan 2017 09:50:54 +0000 (15:20 +0530)]
Fix for the issues reported by static analysis tool.

Fix for the issues reported by static analysis tool.

CRs-Fixed: 1113999
Change-Id: I5a8c9e76fca4f80c1f2a3513344f79042cc5728b

7 years agoMerge "Bluetooth: Fix gatt disconnection issue from GattServer" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Fri, 20 Jan 2017 06:02:45 +0000 (22:02 -0800)]
Merge "Bluetooth: Fix gatt disconnection issue from GattServer" into bt.lnx.2.1.c1-dev

7 years agoHID: Correct Max latency used for SSR
juncao [Wed, 18 Jan 2017 06:25:06 +0000 (14:25 +0800)]
HID: Correct Max latency  used for SSR

This change ensure BT HID host will use correct Max latency when
host initates sniff subrating

CRs-Fixed: 1109370

Change-Id: I6514825ab7880099188c2360cdf7eab00f23442f

7 years agoFix A2DP Metrics Logging Capacity
Jack He [Tue, 17 Jan 2017 23:41:30 +0000 (15:41 -0800)]
Fix A2DP Metrics Logging Capacity

* Set the maximum number of wake events logged to 1000
* Stop logging wake log name as it takes too much memory
* Add counters for each of the repeated values in BluetoothLog so that
  the true number of events can be determined while oldest event get
  dropped
* Log Bluetooth session disconnect reasons using enum instead of string
  in order to save memory usage
* Apply changes to bluetooth.proto in ag/1460462 on system/bt

Bug: 33694310
Test: Code compilation and unit tests
Change-Id: I2cc6f9304725938b63b211d615eb1941eac60edf

7 years agoFix NPE when discovering invalid GATT datatbase
Jakub Pawlowski [Mon, 16 Jan 2017 12:05:57 +0000 (04:05 -0800)]
Fix NPE when discovering invalid GATT datatbase

When doing a discovery of invalid GATT database, where two services are
added with same start handle, characteristics are added to the first
one, where descriptors are added to the later. This cause NPE when
adding descriptor.

Bug: 34280184
Test: manual test
Change-Id: I27619098df33a641cb089b82cf4d4ffd3c6e6aea
(cherry picked from commit 8957fdca4f6a1ba963b81983e8a40a82c3b1122d)

7 years agoBluetooth: Fix cannot show music information correctlly
juncao [Fri, 2 Dec 2016 07:37:59 +0000 (15:37 +0800)]
Bluetooth: Fix cannot show music information correctlly

Some customer want to remove the avrcp browsing feature, as they
donnot have valid media player that support avrcp browsing. Though
AVCT_BROWSE_INCLUDED is defined as false, DUT shall still set the
browsing supported bit according to blacklist, thus only reset the
browsing bit when the AVCT_BROWSE_INCLUDED equals to true.

Change-Id: Iee3b796342f53148d0722b5aad00f1e9267199fe
CRs-Fixed: 1095997

7 years agoBluetooth: Fix gatt disconnection issue from GattServer
Pradeep Panigrahi [Tue, 10 Jan 2017 04:54:58 +0000 (10:24 +0530)]
Bluetooth: Fix gatt disconnection issue from GattServer

Fix disconnection logic for gatt server case, to ensure connection
is cancelled for pending connections and disconnect is sent only for
established connection.

CRs-fixed: 1108916

Change-Id: I1ce373960a88e489eb9a707e996052ba248387e7

7 years agoMerge "Serialize stack shutdown, state change callback and cleanup" into cw-f-dev
Jacky Cheung [Tue, 10 Jan 2017 18:12:20 +0000 (18:12 +0000)]
Merge "Serialize stack shutdown, state change callback and cleanup" into cw-f-dev
am: 718b632f2b

Change-Id: I1ce4066cb7598d38cd2963ff2a9800a8f9f5debe

7 years agoSerialize stack shutdown, state change callback and cleanup
Gurpreet Ghai [Tue, 10 Jan 2017 18:12:19 +0000 (18:12 +0000)]
Serialize stack shutdown, state change callback and cleanup
am: 352b8e89ea

Change-Id: Icace606e4c596074c4a120678d65511c78f683c4

7 years agoMerge "Serialize stack shutdown, state change callback and cleanup" into cw-f-dev
Jacky Cheung [Tue, 10 Jan 2017 18:02:33 +0000 (18:02 +0000)]
Merge "Serialize stack shutdown, state change callback and cleanup" into cw-f-dev

7 years agoresolve merge conflicts of 316589aa to nyc-mr2-dev
Andre Eisenbach [Tue, 10 Jan 2017 02:21:38 +0000 (18:21 -0800)]
resolve merge conflicts of 316589aa to nyc-mr2-dev

Change-Id: I1a5e1b3d09b5bc5d13eda31fd633146536dbd7ee

7 years agoRemove position dependent lookup tables in AT command parser
Andre Eisenbach [Mon, 9 Jan 2017 23:05:41 +0000 (23:05 +0000)]
Remove position dependent lookup tables in AT command parser
am: 8d3cf5988a

Change-Id: I0a690f1538c49fbed743ccf324d240dbb8c927c8

7 years agoFix A2DP metrics session duration
Jack He [Fri, 9 Dec 2016 03:29:00 +0000 (19:29 -0800)]
Fix A2DP metrics session duration

* Fixed A2DP duration counting. It is now counting from music play start
  to music play end.
* Start logging a2dp connection as Bluetooth sessions. Currently, only
  A2DP connections are logged. Thus the bluetooth session length will be
  the total connection length and the length within A2DP session message
  will be the audio connection length.
* Add a audio_duration_millis field in A2DPSession to record audio duration
* Add bonded memory constraint for metrics entries
* Use a builder mechanism to only build metrics upon dumping
* Refactor metrics module into BluetoothMetricsLogger class
* Created unit test for BluetoothMetricsLogger

Bug: 33694310
Test: Code compilation, Unit test, BtFunhausMetricsTest
Merged-In: Iea2a997c4ea074687a5d50860e9229f0e1b82659
Change-Id: Iea2a997c4ea074687a5d50860e9229f0e1b82659
(cherry picked from commit f3175629208a64b190dde4dcf5f92cacef70d3e9)

7 years agoAdd LeakyBondedQueue to libosi
Jack He [Tue, 20 Dec 2016 19:57:17 +0000 (11:57 -0800)]
Add LeakyBondedQueue to libosi

* LeakyBondedQueue is a fixed size queue that leaks oldest item when
  reaching its capacity. This is useful in creating memory bonded data
  structure where freshness is more important than full coverage.
* The queue is protected by a simple mutex and is thread-safe, although
  improvements could be made to lock enqueue and dequeue separately, it
  is not implemented at this moment due to lack of demand
* The queue uses unique_ptr to automatically free its content when it is
  destructed
* Add several tests to verify its API and memory management
* This data structure will be firstly used in the metrics module

Bug: 33781460
Test: Code compilation, unit tests
Merged-In: I51cb73666ac58e4792d9cba0d6f16dad30a0ff39
Change-Id: I51cb73666ac58e4792d9cba0d6f16dad30a0ff39
(cherry picked from commit a22dd221033bb6b4052544c4489934a4ba2a3416)

7 years agoEnable authentication for a2dp
Mingbo Zhang [Thu, 29 Sep 2016 10:16:24 +0000 (18:16 +0800)]
Enable authentication for a2dp

enable authentication for a2dp to avoid a2dp connected
when device unbonded.

Change-Id: Id942389cb44b048061a7457372d642e39bf75767
CRs-Fixed: 1082873

7 years agoSerialize stack shutdown, state change callback and cleanup
Gurpreet Ghai [Mon, 12 Sep 2016 12:06:53 +0000 (17:36 +0530)]
Serialize stack shutdown, state change callback and cleanup

Use Case: Bluetooth On/Off scenario, User switch

Steps:
1. Turn ON Bluetooth
2. Switch user
Also observed on occurrence of enable/disable timeout during On/Off testing.

Failure: Crash while sending state change HAL callback.

Root Cause: In the event when stack cleanup is queued to stack manager
thread when stack shutdown is being processed, stack cleanup starts
execution as soon as stack shutdown is finished.
If the function event_signal_stack_down posted to btif thread at the
end of stack shutdown is executed after stack cleanup crash occurs.

Fix: Serialized the execution of stack shutdown, state change callback
execution and stack cleanup to happen in same order.

Test: code compilation.

Change-Id: Ic96205b5c304acb44eab53f4e2cb150726643bda
(cherry picked from commit 16e112b1861d8f1147325372608c905627e00e88)

7 years agoRemove position dependent lookup tables in AT command parser
Andre Eisenbach [Sat, 23 Jul 2016 06:15:11 +0000 (23:15 -0700)]
Remove position dependent lookup tables in AT command parser

The various position dependent lookup tables in the AT command parser
were out of sync, causing invalid responses to the AT+CBPS command for
example.

This patch gets rid of positionally dependent enums for simple lookup
tables that correlate all the values for easier, less error prone
maintenance of the related tables.

This re-instates a previously reverted patch after fixing incorrect
field order in tBTA_AG_INDICATOR_MAP.

Change-Id: I7f8a052e78706c8c72c5102b38cfe9ce200ae0d9
Fixes: 29978908

7 years agoMerge "Bluetooth: Reset the pairing_cb for bredr/cross key pairing address"
Linux Build Service Account [Sat, 31 Dec 2016 02:00:00 +0000 (18:00 -0800)]
Merge "Bluetooth: Reset the pairing_cb for bredr/cross key pairing address"

7 years agoMerge "Proper handling of AV Discover and GetCaps commands" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Sat, 31 Dec 2016 01:15:44 +0000 (17:15 -0800)]
Merge "Proper handling of AV Discover and GetCaps commands" into bt.lnx.2.1.c1-dev

7 years agoProper handling of AV Discover and GetCaps commands
Ayan Ghosh [Mon, 12 Dec 2016 13:03:05 +0000 (18:33 +0530)]
Proper handling of AV Discover and GetCaps commands

Proper handling of collision scenarios encountered in handling
of AV Discover and GetCaps commands.
When collision is detected in GetCaps command execution because
of remote doing setconfig in between, instead of ignoring the
failure, disconnect AV link to avoid other dicrepancies seen
during codec selection during stream start.

CRs-Fixed: 1106146
Change-Id: I629fac228369e1aadd1aa509eb03c59dc840a252

7 years agoDo not use remote device's preferred connection params.
Pradeep Panigrahi [Wed, 16 Nov 2016 07:35:39 +0000 (13:05 +0530)]
Do not use remote device's preferred connection params.

Add change to not use remote's preferred connection params
and let remote request for required params. This prevents
IOT issues with remote devices which does not handle the same
parameters properly when requested by master device.

Revert "Fix sluggish HID devices"

This reverts commit 3165425aff5744bf682a2887e9704e66f8d34a87.

CRs-fixed: 1090716

Change-Id: I7fb52edbd304c48358eb8269001de2b18d36029f

7 years agoSynchronise the apt-x media worker thread for start and cleanup
Sagar Verma [Wed, 30 Nov 2016 19:11:51 +0000 (00:41 +0530)]
Synchronise the apt-x media worker thread for start and cleanup

- Synchronise the start and stop of Apt-x media thread as during
stress testing the libraries were unloaded or worker threads got
freed before invoking the media start/stop functions.

CRs-Fixed: 1100764
Change-Id: I5474f15f6d9fa02c853dfd1a34d09603c709f5e5

7 years agoMerge "Fixes for Issues reported by static analysis tool."
Linux Build Service Account [Tue, 27 Dec 2016 19:15:25 +0000 (11:15 -0800)]
Merge "Fixes for Issues reported by static analysis tool."

7 years agoFixes for Issues reported by static analysis tool.
Satheesh Kumar Pallemoni [Wed, 30 Nov 2016 15:34:22 +0000 (21:04 +0530)]
Fixes for Issues reported by static analysis tool.

Fix uninitialized variable, Arrya out of bound etc. in the
fludroid code space.

CRs-Fixed: 1105261
Change-Id: I3c95af9defffa6763b069149943baabef1c6fdc3

7 years agoMerge "GAP: Host initiates sniff during OPP file transfer" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Fri, 23 Dec 2016 14:24:12 +0000 (06:24 -0800)]
Merge "GAP: Host initiates sniff during OPP file transfer" into bt.lnx.2.1.c1-dev

7 years agoMerge "Bluetooth: Prevent LE connection request after SMP over BR" into bt.lnx.2...
Service qcabuildsw [Fri, 23 Dec 2016 14:22:55 +0000 (06:22 -0800)]
Merge "Bluetooth: Prevent LE connection request after SMP over BR" into bt.lnx.2.1.c1-dev

7 years agoMerge "Start the Tx idle timer if wake_state is LPM_WAKE_ASSERTED" into bt.lnx.2...
Service qcabuildsw [Tue, 20 Dec 2016 12:00:53 +0000 (04:00 -0800)]
Merge "Start the Tx idle timer if  wake_state is LPM_WAKE_ASSERTED" into bt.lnx.2.1.c1-dev

7 years agoMerge "Bluetooth: Improve HOGP input report error handling" into bt.lnx.2.1.c1-dev
Service qcabuildsw [Tue, 20 Dec 2016 11:58:52 +0000 (03:58 -0800)]
Merge "Bluetooth: Improve HOGP input report error handling" into bt.lnx.2.1.c1-dev

7 years agoBluetooth: Reset the pairing_cb for bredr/cross key pairing address
Matadeen Mishra [Thu, 24 Dec 2015 15:33:52 +0000 (21:03 +0530)]
Bluetooth: Reset the pairing_cb for bredr/cross key pairing address

In between SDP if pairing and unpairing happen,device will get stuck
in pairing pairing_cb sturcture is not getting reset.
Reset the pairing_cb structure for bredr or cross key pairing address
only

Change-Id: I50ac058acc2703b1ecc1c0cfb604fd67aff63c67
CRs-Fixed: 1101231

7 years agoStart the Tx idle timer if wake_state is LPM_WAKE_ASSERTED
Luke Zhang [Mon, 5 Dec 2016 21:53:42 +0000 (13:53 -0800)]
Start the Tx idle timer if  wake_state is LPM_WAKE_ASSERTED

Previously our intenal code was changed to start Tx idle timer only
if the wake_state is LPM_WAKE_W4_TX_DONE. Changed it back to start Tx
idle timer if the wake_state is LPM_WAKE_ASSERTED as well

CRs-fixed: 1097891
Change-Id: I90c9191c07330e0eef4ff910c2350c0e2ec209c0

7 years agoDO NOT MERGE ANYWHERE Fix the timestamp in btsnoop format
Ben YoungTae Kim [Thu, 15 Dec 2016 21:08:23 +0000 (21:08 +0000)]
DO NOT MERGE ANYWHERE Fix the timestamp in btsnoop format
am: aa40aa18bc  -s ours

Change-Id: I4fc659fbacd28f726d336d04600289ed891e00f6

7 years agoBluetooth: Prevent LE connection request after SMP over BR
Pradeep Panigrahi [Fri, 24 Jul 2015 19:30:39 +0000 (12:30 -0700)]
Bluetooth: Prevent LE connection request after SMP over BR

This change performs LE specific discovery from LE auth cmpl
event, only if the SMP has been performed over CID = 6. In
case of cross key transport, discovery occurs in default way,
over BR transport because the LE remote might not be available
to connect back

CRs-fixed: 1090693

Change-Id: Ib6e94b77a72f643308ca0c8f60ee1417a7e6caec

7 years agoMove btsnoop_hci.log to /data/misc/bluetooth/logs
Ajay Panicker [Wed, 14 Sep 2016 18:46:23 +0000 (11:46 -0700)]
Move btsnoop_hci.log to /data/misc/bluetooth/logs

Bug: 31466840
Change-Id: Ibd8f8b85eb59be8bfbb8a7c83b5935802624a748
(cherry picked from commit 12aeda148b39f82d07733ad5c3eafcc9264707a1)

7 years agoMerge "Handle AG enable and disable events properly"
Linux Build Service Account [Wed, 14 Dec 2016 19:04:50 +0000 (11:04 -0800)]
Merge "Handle AG enable and disable events properly"

7 years agoMerge "BT: Modify implementation for command timeout crashdump collection"
Linux Build Service Account [Wed, 14 Dec 2016 05:45:47 +0000 (21:45 -0800)]
Merge "BT: Modify implementation for command timeout crashdump collection"

7 years agoDO NOT MERGE ANYWHERE Fix the timestamp in btsnoop format
Ben YoungTae Kim [Mon, 23 May 2016 23:15:07 +0000 (16:15 -0700)]
DO NOT MERGE ANYWHERE Fix the timestamp in btsnoop format

Due to overflow, timestamp does not have correct value.
Make sure it should be saved in long long type as 64bit.

Change-Id: Iaf1b1dd746dd52ab7e50b870efacde2b8dd0bed6
Signed-off-by: Ben YoungTae Kim <ytkim@qca.qualcomm.com>
7 years agoDO NOT MERGE btif: check overflow on create_pbuf size
Marie Janssen [Thu, 12 May 2016 22:30:16 +0000 (15:30 -0700)]
DO NOT MERGE btif: check overflow on create_pbuf size

Bug: 27930580
Change-Id: Ieb1f23f9a8a937b21f7c5eca92da3b0b821400e6
(cherry picked from commit 514139f4b40cbb035bb92f3e24d5a389d75db9e6)

7 years agoBluetooth: Improve HOGP input report error handling
Pradeep Panigrahi [Wed, 9 Nov 2016 10:09:43 +0000 (15:39 +0530)]
Bluetooth: Improve HOGP input report error handling

This fixes com.android.bluetooth crash when receiving HOGP input report
for unknown characteristic.

CRs-fixed: 1089413

Change-Id: I58ff55ad5a243995ff2ac46b3ab10708b4f14a9d

7 years agoDO NOT MERGE ANYWHERE Do not update sco_state when no matching peer_addr is found
Zheng Zhang [Mon, 12 Dec 2016 19:10:59 +0000 (19:10 +0000)]
DO NOT MERGE ANYWHERE Do not update sco_state when no matching peer_addr is found
am: 3e1402c31c  -s ours

Change-Id: I235c9562890483bcba881a59c718c14b2f6ce2a2

7 years agoDO NOT MERGE ANYWHERE Do not update sco_state when no matching peer_addr is found
Zheng Zhang [Wed, 23 Mar 2016 03:03:19 +0000 (11:03 +0800)]
DO NOT MERGE ANYWHERE Do not update sco_state when no matching peer_addr is found

In the bta_hf_client_sco_conn_cback function, sco_state should not be set to
BTA_HF_CLIENT_SCO_SHUTDOWN_ST when no matched peer_addr found, so that it
can handle BTA_HF_CLIENT_SCO_OPEN_E event later.

Bug: 26416310
Change-Id: I4540230c792490f79e4cca24cb4b34a1c383422f
(cherry-picked from 2dfcbda49f694fcf1355955c334926e8641b4dc5)

7 years agoMerge "Fix for issues reported by Static analysis tool."
Linux Build Service Account [Sat, 10 Dec 2016 13:18:41 +0000 (05:18 -0800)]
Merge "Fix for issues reported by Static analysis tool."

7 years agoTo Backport the N-Mr1 Changes
AnjaneeDevi Kapparapu [Fri, 9 Dec 2016 07:25:31 +0000 (12:55 +0530)]
To Backport the N-Mr1 Changes

To  Backport the N-Mr1 Changes

Merge remote-tracking branch 'origin/bt.lnx.2.1.c1-rel' into bt.lnx.2.1.c1-dev
Change-Id: Ia2fed80d1d171b2430f1cbec414cd6e156a39545
CRs-Fixed: 1099415

7 years agoHandle AG enable and disable events properly
Satish Kodishala [Thu, 1 Dec 2016 10:32:00 +0000 (16:02 +0530)]
Handle AG enable and disable events properly

For AG enable and disable events, NULL pointer is
passed as argument from bta to btif. Handle NULL pointer
for the events received in btif.

CRs-Fixed: 1098783
Change-Id: Id90118bc5e049dc0befa086d113995854c9ca6d5

7 years agoMerge "Promotion of bt.lnx.2.1.c1-00012."
Linux Build Service Account [Thu, 8 Dec 2016 13:14:33 +0000 (05:14 -0800)]
Merge "Promotion of bt.lnx.2.1.c1-00012."

7 years agoCompilation fix: N-MR1 merge
Lalit Kansara [Tue, 6 Dec 2016 12:22:45 +0000 (17:52 +0530)]
Compilation fix: N-MR1 merge

Change-Id: I345c84222923f4497297178f14a649496623a5fc

7 years agoMerge commit '699c01a12eec65e768fc6d41f4913ad6f1529b34' into remote
Vara Prasad A V S G [Wed, 7 Dec 2016 15:04:10 +0000 (20:34 +0530)]
Merge commit '699c01a12eec65e768fc6d41f4913ad6f1529b34' into remote

Conflicts:
stack/gatt/gatt_attr.c

Change-Id: I1879008ac9714512cf1ed1081062bf824b82a83d

7 years agoFix for issues reported by Static analysis tool.
Satheesh Kumar Pallemoni [Wed, 7 Dec 2016 05:52:24 +0000 (11:22 +0530)]
Fix for issues reported by Static analysis tool.

Fix for issues reported by Static analysis tool.

Change-Id: Iacc558f34fb9ed0d970fc034e865d964da98609a
CRs-Fixed: 1095995

7 years agoGAP: Host initiates sniff during OPP file transfer
Venkata Jagadeesh Garaga [Thu, 27 Oct 2016 10:55:45 +0000 (16:25 +0530)]
GAP: Host initiates sniff during OPP file transfer

As sys idle triggered on l2cap tx empty link may go
to sniff during large file transfers which takes more
than 5 sec transmission time.

This fix trigger sys idle for each sdu transmitted
and keeps the link active until file transfer complete

Change-Id: I1a4efd61323c75d7a5f4b0b483e1230b3a160aa7
CRs-Fixed: 1090082

7 years agoPromotion of bt.lnx.2.1.c1-00012.
Linux Build Service Account [Tue, 6 Dec 2016 16:38:32 +0000 (09:38 -0700)]
Promotion of bt.lnx.2.1.c1-00012.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1087262   I97c7076840d45700739f56c01585aaec4aa5ca9d   Start the Tx idle timer before sending out HCI command

Change-Id: I812659f93d55bb4c3316b50b8bb1689b676b8c14
CRs-Fixed: 1087262