OSDN Git Service
Nitin Arora [Sat, 22 Feb 2014 02:20:37 +0000 (18:20 -0800)]
DO NOT MERGE Allow simultaneous LE Observe and BTM Inquiry/Scan
This patch allows BTM inquiry and LE observe to be launched
and overlap each others' occurance by redirecting results
and handling states accordingly.
CRs-Fixed: 579505
Conflicts:
stack/btm/btm_ble_gap.c
bug
12939764
Change-Id: Ifde73f17f8d40e9ebfff3b49e409591189574ee0
Andre Eisenbach [Wed, 5 Mar 2014 23:41:53 +0000 (15:41 -0800)]
DO NOT MERGE: cherrypick from master to fix b/
13289050
LE: Add status callback function for LE broadcasts
Change-Id: If4342050ce1141a9c2111286e7b3cccdc012a91e
Zhihai Xu [Wed, 12 Mar 2014 23:04:46 +0000 (23:04 +0000)]
Merge "DO NOT MERGE use bluetooth HID remote device name as input device name." into klp-dev
Zhihai Xu [Fri, 6 Dec 2013 22:29:29 +0000 (14:29 -0800)]
DO NOT MERGE use bluetooth HID remote device name as input device name.
bug:
12003067
Change-Id: I74e4921047a27ee79fa1e3cd58056fde2958e60f
Matthew Xie [Mon, 10 Mar 2014 18:04:56 +0000 (18:04 +0000)]
Merge "DO NOT MERGE Bluetooth: Cleanup bt_config.xml during BLE Scan" into klp-dev
Zhihai Xu [Mon, 10 Mar 2014 01:08:14 +0000 (01:08 +0000)]
Merge changes I6673d478,I953b9ca6 into klp-dev
* changes:
DO NOT MERGE BLE stack doesn't handle multiple l2cap_conn_update requests
DO NOT MERGE sometime the BLE connection parameter isnot updated for the first time
Zhihai Xu [Sun, 9 Mar 2014 19:08:59 +0000 (19:08 +0000)]
Merge "DO NOT MERGE BLE HID device connection failure due to security error." into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:08:35 +0000 (19:08 +0000)]
Merge "DO NOT MERGE Remove the device from le backgrond connection whitelist when it's unpaired" into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:08:05 +0000 (19:08 +0000)]
Merge "DO NOT MERGE BLE Secuity manager state machine generate wrong pairing success event." into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:07:33 +0000 (19:07 +0000)]
Merge "DO NOT MERGE fix a potential native crash during bluetooth sutdown" into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:07:17 +0000 (19:07 +0000)]
Merge "DO NOT MERGE the HID device state is out of sync after upair." into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:06:38 +0000 (19:06 +0000)]
Merge "DO NOT MERGE Can only support two HID report instance for BLE HID." into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:05:49 +0000 (19:05 +0000)]
Merge "DO NOT MERGE read report array out of boundary for BLE HID device." into klp-dev
Zhihai Xu [Sun, 9 Mar 2014 19:05:37 +0000 (19:05 +0000)]
Merge "DO NOT MERGE need to increase maximum number HID report for HOGP" into klp-dev
Zhihai Xu [Wed, 15 Jan 2014 01:46:26 +0000 (17:46 -0800)]
DO NOT MERGE trouble syncing with fitbit and can't turn off bluetooth.
this is to work around broadcom firmware problem to handle
unsolicited command complete event for HCI_LE_Create_Connection_Cancel
and LE connection complete event with status error code (0x2)
unknown connection identifier from bluetooth controller
the workaround is to release the HCI connection to avoid out of sync
with bluetooth controller, which cause BT can't be turned off.
bug:
11614046
Change-Id: Ia5c5ad0c6c9b1a4f03253cac8a7caaf21341c88c
Zhihai Xu [Wed, 18 Dec 2013 04:33:09 +0000 (20:33 -0800)]
DO NOT MERGE BLE stack doesn't handle multiple l2cap_conn_update requests
we can define 4 bits as flags:
1. L2C_BLE_CONN_UPDATE_DISABLE:
if set it means disable update connection parameter. otherwise enable
2.L2C_BLE_NEW_CONN_PARAM:
if set, it means we have new connection parameter which is needed to be configured
if possible(after update done or enable).
3.L2C_BLE_UPDATE_PENDING:
if set, it means waiting for connection parameter update finished.
this flag will be cleared in btu_ble_ll_conn_param_upd_evt.
will be set when we call btsnd_hcic_ble_upd_ll_conn_params
4.L2C_BLE_NOT_DEFAULT_PARAM:
if set, it means we don't use the default connection parameter.
so when we disable update,
we need to configure default connection parameter.
with these 4 flags, we can replace all these states:
UPD_ENABLED, UPD_DISABLED, UPD_PENDING and UPD_UPDATED.
so we can cover all the corner cases which aren't handled
by original code.
bug:
11450715
Change-Id: I6673d4783a8063bf9e8a213c6669800f86e67945
Zhihai Xu [Sun, 17 Nov 2013 01:07:38 +0000 (17:07 -0800)]
DO NOT MERGE sometime the BLE connection parameter isnot updated for the first time
When we receive the BLE connection parameter update
from remote device after smp_send_pair_req before
start BLE service discovery(bta_gattc_set_discover_st).
We will miss update this BLE connection parameter.
The reason is we call
L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE);
in smp_send_pair_req ,We change the state to UPD_DISABLED.
When we receive the new BLE connection parameter from
remote device, we will update the state to UPD_PENDING,
which will update the new connection parameter
when enable the connection parameter update.
when we start BLE service discovery
we call L2CA_EnableUpdateBleConnParams(p_srcb->server_bda, FALSE);
in bta_gattc_set_discover_st, We will update the state back to
UPD_DISABLED, which will cause we miss updating
the new connection parameter when enable the connection parameter update.
The fix is don't change the state to UPD_DISABLED
when the state is UPD_PENDING for disabling.
bug:
11727252
Change-Id: I953b9ca669e3460e18b340e7779cc54e03d6305b
Zhihai Xu [Wed, 13 Nov 2013 04:18:37 +0000 (20:18 -0800)]
DO NOT MERGE BLE HID device connection failure due to security error.
When HID BLE device start encryption, if some other GATT application
already start encryption(but not finished yet) by calling
gatt_security_check_start. The HID BLE device will be failed to start
encryption, which will cause it to disconnect the BLE HID connection.
The solution is to check whether we already started the encryption
, If the encryption is already started, wait until the encryption
finished, then continue to start security check for BLE HID device.
add encrytion complete event to notify all GATT client encryption done.
filter the event just for BTA HH LE GATT client.
bug:
11636246
Change-Id: If58e57c623cc8cfa05208587b010bec68c71306c
Zhihai Xu [Sat, 16 Nov 2013 01:55:46 +0000 (17:55 -0800)]
DO NOT MERGE Remove the device from le backgrond connection whitelist when it's unpaired
this is due to we didn't remove the device from the white list before unpair
Which cause a fake pair request from remote device triggered
right after the acl is disconnected.
The fix is to remove the BLE device from whitelist before unpair.
Also fix a problem return wrong device handle from bta_hh_le_add_device.
if bta_hh_le_add_device is called right after reboot, before we connect HID device.
This is normally true for a previous paired device, which we saved in the nvram.
The wrong device handle will cause the removing HID device from while list failed
after unpair the HID device.
bug:
11676338
Change-Id: Id5b45b2829da9a990dfd1dbae0c15764b16c2bfb
Zhihai Xu [Sat, 16 Nov 2013 02:57:28 +0000 (18:57 -0800)]
DO NOT MERGE BLE Secuity manager state machine generate wrong pairing success event.
we call smp_proc_release_delay to setup a timer.
We will send a pair failure message to uplayer after the time expired.
Right before the time expire, the l2cap connection is disconnected
from remote device, we receive L2C_DISC, which will call smp_delay_terminate,
smp_delay_terminate will send a pair success message to uplayer.
The fix is not to change the status if the remote device disconnect the link
bug:
11716967
Change-Id: I8ca63599a170ec86913785aafea552301cec37df
Zhihai Xu [Tue, 26 Nov 2013 01:30:59 +0000 (17:30 -0800)]
DO NOT MERGE fix a potential native crash during bluetooth sutdown
When bluetooth is initialized which call gki_buffer_init,
the buffer pool is allocated by GKI_os_malloc which is
to call libc malloc function.
When bluetooth is cleanup which call GKI_shutdown,
the buffer pool will be freed by GKI_os_free
which is to call libc free function.
So if we access the buffer, after the whole buffer pool is freed,
we will get this native crash.
if we call cleanup during bluetooth disabling:
the state is still BTIF_CORE_STATE_DISABLING,
then GKI_shutdown will call before bte_main_disable
( bt_hc_if->cleanup();), which is before userial thread exit.
Then we may trigger this native crash.
bug:
11793775
Change-Id: Ic8ced12848d25f918a28f4d5ba29b803d6ac5bd7
Zhihai Xu [Sat, 16 Nov 2013 05:18:25 +0000 (21:18 -0800)]
DO NOT MERGE the HID device state is out of sync after upair.
the HID device state is out of sync between java layer and bluedroid stack after upair.
This will cause the HID device can't be connected after repair.
YOu can find the following error message
E/HidService( 1452): Hid Device not disconnected: 00:15:9E:20:29:41
bug:
11718702
Change-Id: I271bb77a2cc205c5a0ef396db86b87902d29966b
Zhihai Xu [Wed, 18 Dec 2013 22:51:52 +0000 (14:51 -0800)]
DO NOT MERGE Can only support two HID report instance for BLE HID.
The follwoing code cause this problem:
BTA_HH_LE_RPT_INST_ID_MAP(s,c)=(UINT8)(((s)<<4)||(c))
The code use || instead of |, this cause we can only generate
two instance HID report 0 and 1(false and true).
bug:
12213520
Change-Id: If6b7cfd9633255401aef12aafd918ee147f256b6
Zhihai Xu [Wed, 18 Dec 2013 18:06:13 +0000 (10:06 -0800)]
DO NOT MERGE read report array out of boundary for BLE HID device.
report array out of boundary when read HID report reference
descriptor for BLE HID device.
bug:
12208657
Change-Id: Ic60fd7555045f367b4fcd606510f52f60e36995e
Zhihai Xu [Thu, 19 Dec 2013 02:10:26 +0000 (18:10 -0800)]
DO NOT MERGE need to increase maximum number HID report for HOGP
The Mat mouse have more than 10 report (11),
which exceed our limitation
bug:
12214036
Change-Id: Id578bf7959f73dc3bd57664eccf49ab5580ec76b
Sunny Kapdi [Wed, 20 Nov 2013 22:41:41 +0000 (14:41 -0800)]
DO NOT MERGE Bluetooth: Cleanup bt_config.xml during BLE Scan
BLE Scan needs to clean up the bt_config.xml periodically so that
new entries could be added to bt_config.xml. Also, there is no
need to add BLE Random bd_addr to the bt_config.xml
Change-Id: I00ba2e50dd39a021099052cb569786f6cb2cc8b9
b/
12912008
(cherry picked from commit
377cb1407ee6ee1ff91b15bfa7052abed1023d18)
Change-Id: I3fa0286c96782822a8fdac14b05bbb6f98636e50
Andre Eisenbach [Fri, 8 Nov 2013 18:23:52 +0000 (10:23 -0800)]
DO NOT MERGE LE: Add service UUIDs and data to advertising data
Add support for UUIDs and custom service data in the advertising and
scan response records.
Cherry picking ble advertising changes from master to KLP MR2.
b/
13137996
Change-Id: I6470427ad194871488cc90f3ab384b9ecf326b15
Matthew Xie [Tue, 12 Nov 2013 02:56:19 +0000 (02:56 +0000)]
Merge "LE: Increase number of simultaneous connections" into klp-dev
Andre Eisenbach [Fri, 1 Nov 2013 21:47:52 +0000 (14:47 -0700)]
LE: Increase number of simultaneous connections
Currently the maximum number of parallel connections is 4. This patch
increases the limit to allow for more devices.
bug
11571899
Change-Id: I42b77e6b67f59d7d430d879a5fb0eb80982160b5
Zhihai Xu [Mon, 11 Nov 2013 01:25:45 +0000 (17:25 -0800)]
BLE is disconnected due to BLE service record discovery failure.
the root cause of the problem is:
In BLE GATT client state machine, When It is in discovery state,
any command to access the service, characteristic and descriptor
will be queued, these commands will be executed after BLE service
discovery complete. When we queue the command, we will copy these
message. The problem is we didn't copy these message correctly.
We didn't deep copy these messages. There are pointers inside
these messages. These pointers are still point to the old message
which are already freed. When the messages are reused, the original
content will lost. The queued commands will be corrupted.
This is very serious issue, which can cause a lot of stability problem.
bug:
11620252
Change-Id: I93082a9dbcc3a676f5f791c2b1ea98e49b165813
Matthew Xie [Fri, 8 Nov 2013 18:13:21 +0000 (10:13 -0800)]
Replace Broadcom proprietary license header with apache 2 header
bug
11591406
Change-Id: Ibb9c6b3865e6d757236f1c5896775bb6f28e47be
Matthew Xie [Thu, 7 Nov 2013 19:06:39 +0000 (19:06 +0000)]
Merge "LE: Add devices to the inquiry db before connecting" into klp-dev
Zhihai Xu [Thu, 7 Nov 2013 19:00:17 +0000 (19:00 +0000)]
Merge "fix a memory leakage when Queue search or discovery event." into klp-dev
Andre Eisenbach [Thu, 7 Nov 2013 07:35:48 +0000 (23:35 -0800)]
LE: Add devices to the inquiry db before connecting
Ensure that the remote device type is set correctly by reading the
device information from non-volatile storage and (re-)adding it to
the inquiry database before connecting to a remote GATT device.
bug
11573208
Change-Id: Ifa69da3d5871aed5293ea5e611144874b67afe72
Zhihai Xu [Thu, 7 Nov 2013 03:23:13 +0000 (19:23 -0800)]
fix a memory leakage when Queue search or discovery event.
bug:
11562902
Change-Id: I16ba8cfb727d05e5d324c6301ba0ab23e729232b
Zhihai Xu [Thu, 7 Nov 2013 03:06:33 +0000 (03:06 +0000)]
Merge "Fixes random host disconnection after establishing connection" into klp-dev
Sunny Kapdi [Wed, 7 Aug 2013 19:30:20 +0000 (12:30 -0700)]
Fixes random host disconnection after establishing connection
Host starts encryption twice when the remote device is
already paired. The host sends disconnect when the
second encryption attempt returns failure. This fix
avoids duplicate encryption attempt.
bug:
11450719
Change-Id: I8ec5c4a953180ec17585aece757810421bc44aae
Matthew Xie [Thu, 7 Nov 2013 00:05:25 +0000 (00:05 +0000)]
Merge "whitelist well tested devices for absolute volume feature" into klp-dev
Matthew Xie [Wed, 6 Nov 2013 01:19:39 +0000 (17:19 -0800)]
whitelist well tested devices for absolute volume feature
We are blacklisting all the devices that are not in whitelist
instead of blacklisting known bad devices.
bug
11124170
Change-Id: I044970df611d2a800d7698d4a63331644ab107ce
Zhihai Xu [Wed, 6 Nov 2013 06:54:58 +0000 (06:54 +0000)]
Merge "need to save the BLE HID UUID to NVRAM" into klp-dev
Zhihai Xu [Wed, 6 Nov 2013 02:06:54 +0000 (18:06 -0800)]
need to save the BLE HID UUID to NVRAM
need to save the BLE HID UUID to NVRAM.
otherwise we will miss the HID profile setting
in device profile list of the BLE HID device after reboot.
bug:
11541617
Change-Id: I11e1c871768e999ec1f48396018c3be379cc1b7d
Matthew Xie [Wed, 6 Nov 2013 01:25:24 +0000 (01:25 +0000)]
Merge "Add toyota venza to the auto pair blacklist" into klp-dev
Matthew Xie [Mon, 4 Nov 2013 22:11:14 +0000 (22:11 +0000)]
Merge "Bluetooth: Send Error for Invalid AT Command." into klp-dev
Zhihai Xu [Sun, 3 Nov 2013 03:42:28 +0000 (03:42 +0000)]
Merge "A typo to set wrong max connection interval value when we create a BLE connection." into klp-dev
Sunny Kapdi [Mon, 29 Jul 2013 05:29:37 +0000 (10:59 +0530)]
Bluetooth: Send Error for Invalid AT Command.
Some Headsets send HFP 1.6 cmds even when it is not
supported by DUT.Send error response in those cases.
bug
11450717
Change-Id: If7745959c00fd49bd737b41a49adba9e726aa5c7
Zhihai Xu [Sat, 2 Nov 2013 00:09:49 +0000 (00:09 +0000)]
Merge "Unable to connect to a Motorola s705 until Bluetooth was toggled of and back on" into klp-dev
Zhihai Xu [Fri, 25 Oct 2013 23:47:49 +0000 (16:47 -0700)]
A typo to set wrong max connection interval value when we create a BLE connection.
when we set the max connection interval value,
we should use BTM_BLE_CONN_INT_MAX_DEF instead of BTM_BLE_CONN_INT_MIN
bug:
11390678
Change-Id: Ia3f6d5e9cb91b2e998d014ed4849eff8455af770
Sunny Kapdi [Wed, 14 Aug 2013 02:43:49 +0000 (19:43 -0700)]
Fixes BLE HCI commands concurrency issue
Removes HCI LE Read Remote features command call
to prevent the concurrency between this command and
HCI LE start encryption command.
CRs-fixed: 517330
bug:
11450568
Change-Id: I6445ab8095a4261c2a3f84acea1c546e6924f50d
Signed-off-by: Sunny Kapdi <sunnyk@codeaurora.org>
Matthew Xie [Tue, 29 Oct 2013 22:51:35 +0000 (22:51 +0000)]
Merge "Treat devices advertising random addr. as LE only" into klp-dev
Andre Eisenbach [Fri, 25 Oct 2013 23:17:45 +0000 (16:17 -0700)]
Treat devices advertising random addr. as LE only
Some remote devices use random addresses, but are not setting the
"BR/EDR not supported" flag. Thus we try to connect to the device using
BR/EDR.
This patch ignores the ADV flags if the device is using a random
address and always makes the connection over the LE transport.
bug
11418071
Change-Id: I628775b819abd8f17745aaf98db4bb3c59166955
Matthew Xie [Thu, 24 Oct 2013 23:05:57 +0000 (23:05 +0000)]
Merge "Blacklist Devices that donot handle absolute volume well" into klp-dev
Matthew Xie [Thu, 24 Oct 2013 08:09:52 +0000 (01:09 -0700)]
Blacklist Devices that donot handle absolute volume well
Use vendor prefix address, include hbs730 headset, passat carkit
bug
11124170
Change-Id: I80f634366ce332c55581d7b1e36641e5ce3ad346
Zhihai Xu [Thu, 24 Oct 2013 01:25:32 +0000 (01:25 +0000)]
Merge "Do not deregister HH GATT IF in bta_gattc_disable for hid over GATT" into klp-dev
Zhihai Xu [Wed, 23 Oct 2013 23:33:31 +0000 (23:33 +0000)]
Merge "LE: Only prepend valid HID report IDs" into klp-dev
Zhihai Xu [Tue, 22 Oct 2013 22:26:33 +0000 (15:26 -0700)]
Do not deregister HH GATT IF in bta_gattc_disable for hid over GATT
The root cause is bta_gattc_disable de-register the HH GATT IF
which cause bta_hh_cleanup_disable called
before we receive BTA_HH_INT_CLOSE_EVT.
The fix is "don't deregister HH GATT IF in bta_gattc_disable and
let HH module to de-register the HH GATT IF by bta_hh_le_deregister".
because HH GATT IF is a special GATT IF
which won't be exposed to uplayer and
HH GATT IF belong to BTA HH module, it should be managed by BTA HH.
bug:
11284861
Change-Id: Ia14cd2be3f3548a4d1e2dcfbc89fa3a75d9651db
Andre Eisenbach [Tue, 22 Oct 2013 14:49:45 +0000 (07:49 -0700)]
LE: Only prepend valid HID report IDs
If a remote HOGP device does not supply a valid report ID, do not
prepend it to the HID report.
This fixes interop issues with various LE mice, where the cursor would
not move on screen as expected.
BLTH02618447
Bug:
11342157
Change-Id: I7832bb091654a5625f37b1531bd80fad9bbe6a51
Matthew Xie [Sun, 20 Oct 2013 18:32:32 +0000 (18:32 +0000)]
Merge "Handle CL opening state in bta_jv_free_rfc_cb" into klp-dev
Matthew Xie [Sun, 20 Oct 2013 08:04:06 +0000 (01:04 -0700)]
Handle CL opening state in bta_jv_free_rfc_cb
When the local device is openning an rfc channel and is being closed
before it's opened, we should close the channel instead of ignoring.
bug
11299049
Change-Id: I702500d489c8b3d3764e36340106433232a127c0
Zhihai Xu [Thu, 17 Oct 2013 03:00:38 +0000 (20:00 -0700)]
BTU SIGSEGV on RFCOMM connect to Linux bluetooth dongle
fix a typo which cause the crash.
bug:
11260131
Change-Id: I1cbe9f4d20be39f3ca13577687ac92b88b06e366
zzy [Tue, 8 Oct 2013 23:54:08 +0000 (16:54 -0700)]
When rfcomm incoming queue is not empty, waiting for app ready to drain the data
Fixed the issue that rfcomm inbound packets could be out of order when host
flow control is activating.
bug
11031800
Change-Id: Idc1eb6633bb070f1ab2b33a9751fd7d714764d45
Zhihai Xu [Mon, 7 Oct 2013 22:11:22 +0000 (15:11 -0700)]
Unable to connect to a Motorola s705 until Bluetooth was toggled of and back on
we should use the same role as the previous connection, if phone walk out of range,
and reconnect back from remote device.
bug:
10648781
Change-Id: I6abd77067d26769067ba2fbd45d9e8f75cf7c764
Matthew Xie [Thu, 10 Oct 2013 00:46:15 +0000 (00:46 +0000)]
Merge "Remove MMS support from MAP SDP" into klp-dev
Matthew Xie [Wed, 9 Oct 2013 23:40:09 +0000 (23:40 +0000)]
Merge "Interleave br/edr device discovery with BLE device scan for some targets" into klp-dev
Matthew Xie [Mon, 30 Sep 2013 19:44:10 +0000 (12:44 -0700)]
Interleave br/edr device discovery with BLE device scan for some targets
This change only applies to targets which do not support interleaved scan
in controller.
bug
8508849
Change-Id: Ia99faf92c942b4b33abfde2708eff25ec9cd5468
zzy [Sat, 28 Sep 2013 00:05:37 +0000 (17:05 -0700)]
added filter remove api to control the # of child node for bt_config.xml
Bug
10949832
Change-Id: I10589b9d0a0b4b8d7cbf66122c66bb2e99be04a1
Matthew Xie [Wed, 9 Oct 2013 21:20:56 +0000 (14:20 -0700)]
Remove MMS support from MAP SDP
When we support MMS in the future. Revert this patch.
bug
10296324
Change-Id: I9d65895d6cb55b3967efcddc2c37b3f95ba3ce38
Andre Eisenbach [Wed, 2 Oct 2013 22:37:21 +0000 (15:37 -0700)]
LE: Improved handling of illegal GATT PDUs
Do additional length checks when handling malformed messages. These
messages are never valid, and should be dropped if seen.
Before starting to parse out PDU content, it is verified that the
buffer contains sufficient bytes and error condition is returned
if this is not the case.
Bug:
11045073
Change-Id: Ifb792d1575e0514f33e75ed73247ea638807901e
Matthew Xie [Wed, 2 Oct 2013 07:40:27 +0000 (00:40 -0700)]
Add toyota venza to the auto pair blacklist
bug
10904063
Change-Id: Ia14f00eb45ff8ba1d7df73db575aff552af7677a
Zhihai Xu [Fri, 4 Oct 2013 23:25:06 +0000 (23:25 +0000)]
Merge "Crash after unpairing BT keyboard" into klp-dev
Zhihai Xu [Sun, 29 Sep 2013 22:12:55 +0000 (15:12 -0700)]
Crash after unpairing BT keyboard
The crash is caused to access an array use invalid index value.
The solution is to check the index before access the array.
bug:
10992001
Change-Id: Iad83764de9545fb2348105cf9cd9d32a85f1d654
Zhihai Xu [Sun, 29 Sep 2013 20:42:13 +0000 (13:42 -0700)]
Failure to start playback on A2DP sink after connection
This is what happen:
after Headset is connected, we call start_audio_datapath which will send AVDTP_Start command to Headset,
Headset reject it with bad state. Bluedroid stack will ack failure to start_audio_datapath.
The next time we write audio data to bluetooth, we will call start_audio_datapath again to send AVDTP_Start command to Headset
Headset reject it with bad state again. Bluedroid stack will ack failure to start_audio_datapath.
When the third time we call start_audio_datapath, right at that time we receive AVDTP_Start command from Headset.
Handle AVDTP_Start command and Handle start_audio_datapath are in two different threads.
Handle AVDTP_Start command is in btu_task thread.
Handle start_audio_datapath() is in btif_task thread.
We have race condition in this case
Because when btif_task processed BTIF_AV_START_STREAM_REQ_EVT(triggered by start_audio_datapath),
it don't know we receive AVDTP_Start command which is processed in btu_task.
btif_task will send a message BTA_AV_API_START_EVT to btu_task, which will be handled by bta_av_do_start.
AVDTP_start command from headset is handled by bta_av_start_ok.
bta_av_start_ok will send BTA_AV_START_EVT with suspending true to btif_task and send AVDTP_Suspend command
to headset to suspend the AVDTP for reconfiguration purpose.
in bta_av_do_start, we will check whether the AVDTP is already started, we will know the AVDTP is already start at this time because
bta_av_do_start is also running in btu_task. We will send BTA_AV_START_EVT with success to btif_task.
In the btif_task, BTA_AV_START_EVT will be processed by btif_av_state_opened_handler:
For the first BTA_AV_START_EVT with suspending true sent by bta_av_start_ok, it will ignore it:
if ((p_av->start.status == BTA_SUCCESS) && (p_av->start.suspending == TRUE))
return TRUE;
For the second BTA_AV_START_EVT with success sent by bta_av_do_start , it will ack success to start_audio_datapath, and change to
BTIF_AV_STATE_STARTED/BTAV_AUDIO_STATE_STARTED, after receive success ack from bluedroid stack, we will start send Audio data to bluetooth.
At last we received AVDTP_Suspend response accept from Headset, we will send BTA_AV_SUSPEND_EVT to btif_task, which will be
handled by btif_av_state_started_handler. It will call btif_a2dp_on_suspended and call audio_state_cb with new audio state
BTAV_AUDIO_STATE_STOPPED.
so The state between bluedroid stack and audio data path is out of sync.
The fix is to send failure message if we know we suspend AVDTP in bta_av_do_start,
also make sure we won't miss acknowledgement for pending start if we exit opened state,
to avoid audio data path dead lock.
bug:
10953908
Change-Id: I1704839977324b7c4e234eb843cddf3719e10d2c
Matthew Xie [Wed, 18 Sep 2013 19:30:36 +0000 (12:30 -0700)]
Increase default bluetooth name from 15 to 31.
bug
7441329
Change-Id: I79d64e77f206268ace06ce0f7b16119f63655bec
Zhihai Xu [Tue, 17 Sep 2013 01:16:47 +0000 (18:16 -0700)]
native crash while skipping songs with A2DP connected
this is caused by out of bound(invalid) index, pass to AVRC_MsgReq
bug:
10787111
Change-Id: I5b06c646342d0d4e9202c6e22e1c1d67275efb43
Mattias Agren [Fri, 5 Apr 2013 15:27:27 +0000 (17:27 +0200)]
Set default a2dp sbc encoding quality to high
* Increased bitpool to high quality setting (53). * Added rate quality
reduction to medium quality for basic rate connections * Enhanced
a2dp frame calculation ratio to smooth out frame distrubution * Removed
iop scaling patch.
Bug
8252054
Change-Id: I20725d0decfe5f820e1c03407889b6272e830aca
Zhihai Xu [Sat, 14 Sep 2013 03:59:15 +0000 (03:59 +0000)]
Merge "fix wrong PBAP profile SDP record which may cause some carkit interop problem." into klp-dev
Zhihai Xu [Sat, 14 Sep 2013 03:56:22 +0000 (03:56 +0000)]
Merge "a2dp media packet sent too slow, which cause packet overflow." into klp-dev
Zhihai Xu [Sat, 14 Sep 2013 02:31:18 +0000 (19:31 -0700)]
a2dp media packet sent too slow, which cause packet overflow.
the error message: btif_media_aa_prep_2_send congestion buf count 24
The reason is we increase all bluedroid thread related TX data path priority:
media, timer, BTU and HCI_WORKER, but we didn't increase the RX data path
priority: userial_read_thread. If the RX thread is blocked, it will also
affect TX, because the HCI have flow control, we need receive HCI Number of
Completed Packets Events to continue send packet to the controller.
If we HCI complete Packets Event packets is blocked, the HCI flow control
will block the HCI packet trnasmission until we get HCI complete packets
event to know how many buffer is available in the controller.
I tested with a chrysler CIP/VP4 carkit which show this error message,
After I apply this fix, I can't reproduce this problem any more.
This look like good fix for this issue.
bug:
8252054
Change-Id: Ic78b9abb69648c50aa63e2b3c8b90038018fb6b5
Zhihai Xu [Sat, 14 Sep 2013 00:38:49 +0000 (17:38 -0700)]
fix wrong PBAP profile SDP record which may cause some carkit interop problem.
bug:
10488422
Change-Id: I8fb4a73a631c84dc812f44593743905f2d2ad108
Matthew Xie [Sat, 14 Sep 2013 00:24:03 +0000 (00:24 +0000)]
Merge "Added lock in btu_xxx_timer api" into klp-dev
Zhihai Xu [Fri, 13 Sep 2013 22:42:47 +0000 (22:42 +0000)]
Merge "Changed MAP version from 1.0 to 1.1, since this is what was actually implemented" into klp-dev
zzy [Fri, 6 Sep 2013 23:47:29 +0000 (16:47 -0700)]
Added lock in btu_xxx_timer api
Bug
10539101: Native crash in com.android.bluetooth while running monkey
Zhihai Xu [Fri, 13 Sep 2013 19:14:46 +0000 (19:14 +0000)]
Merge "change AVRCP profile version from 1.4 to 1.3 in SDP record." into klp-dev
Zhihai Xu [Fri, 13 Sep 2013 17:56:59 +0000 (10:56 -0700)]
change AVRCP profile version from 1.4 to 1.3 in SDP record.
bug:
10728403
Change-Id: I741c8741173088bc91f43fbbcda8c0bd13a7d84d
Matthew Xie [Sat, 10 Nov 2012 02:26:26 +0000 (18:26 -0800)]
Use product model as default bluetooth name if not defined
bug
7441329
Change-Id: I6afe54a8a0c4d1120e96eb808cf9fc4bf5b37fdb
Kim Schulz [Thu, 22 Aug 2013 08:57:29 +0000 (10:57 +0200)]
Changed MAP version from 1.0 to 1.1, since this is what was actually implemented
Change-Id: If391121ca92f1025bff3a99941afa12da69c3b69
Bug:
10434562
Zhihai Xu [Fri, 6 Sep 2013 21:19:10 +0000 (21:19 +0000)]
Merge "Configure BTA DM to not force master role upon inquiry" into klp-dev
Mattias Agren [Mon, 8 Apr 2013 10:23:42 +0000 (12:23 +0200)]
Configure BTA DM to not force master role upon inquiry
* Some headsets will request master role upon connection. When inquiry
is attempted during streaming this results in a small audio glitch
while attempting to switch back to master.
Bug:
8266826
Bug:
8569352
Change-Id: Iaca0bc0f8847e32bc2d40e33100f26ce19d79a28
Matthew Xie [Fri, 6 Sep 2013 05:23:35 +0000 (05:23 +0000)]
Merge "Hid Host: Ensure Hid module is accepting events before processing" into klp-dev
Harish Paryani [Tue, 27 Aug 2013 21:52:03 +0000 (14:52 -0700)]
Hid Host: Ensure Hid module is accepting events before processing
During shutdown sequence, Hid host module state machine was crashing
trying to process events in NULL state. Added the appropriate check.
bug
10429484
Change-Id: Ic8b8f61f2fa63027d3e473787cca6d4d221ec075
Priti Aghera [Wed, 22 May 2013 20:25:58 +0000 (13:25 -0700)]
Incremented buffer size to accomodate default MTU
L2CAP Config request was not sent from Bluedroid as the MTU size was
higher than the max buffer size for default apdu tx/rx sizes.
Incremented the buffer size to accomodate this default MTU size. Also
included new datatypes and corresponding tx/rx apdus. This will set the
MTU size to that defined in datatype config rather than selecting
default value.
b/
10565872
Change-Id: Id469c836581fb3d020bcb88c381421e0ef965073
Satya Calloji [Thu, 1 Aug 2013 09:14:43 +0000 (02:14 -0700)]
Add support for AbsoluteVolume
Add support for AbsoluteVolume in BTIF
bug
9595622
Change-Id: I11b707f6ab50d31bd11e879b0ebe5ad5bac54ad9
Conflicts:
btif/src/btif_rc.c
Matthew Xie [Fri, 16 Aug 2013 02:30:48 +0000 (19:30 -0700)]
Place handling of BTA_DM_DISC_BLE_RES_EVT in BLE feature ifdef
Without this fix, bluetooth fail to compile for non-BLE platform
Change-Id: Ida10c54ab841e0a2bcaeb389a9813dd846db8200
Zhihai Xu [Fri, 16 Aug 2013 00:22:43 +0000 (00:22 +0000)]
Merge "LE: Add support for the HID-over-GATT profile (1/3)" into klp-dev
Andre Eisenbach [Thu, 8 Aug 2013 22:42:48 +0000 (15:42 -0700)]
LE: Add support for the HID-over-GATT profile (1/3)
bug:
8330048
Change-Id: I5727161b0a87700487bee96cdffa8fd169034204
John Du [Tue, 25 Jun 2013 02:18:56 +0000 (19:18 -0700)]
Add support for ff/rew
Change-Id: I017a7ddc9f7255d84ad8bf3284fefc1b7040900f
(cherry picked from commit
342bdf540d8c183d14ec5fb436b73cd979df3a8f)
Matthew Xie [Wed, 14 Aug 2013 08:15:36 +0000 (08:15 +0000)]
Merge "LE: Add peripheral role support (2/4)" into klp-dev
Andre Eisenbach [Wed, 7 Aug 2013 01:19:37 +0000 (18:19 -0700)]
LE: Add peripheral role support (2/4)
Initial stack support for the LE peripheral role.
Change-Id: I261d751b43b7020760bff345b472b6f60caa60be
Matthew Xie [Wed, 14 Aug 2013 07:33:46 +0000 (07:33 +0000)]
Merge "LE: Do not generate an error if a device is already whitelisted" into klp-dev
Matthew Xie [Wed, 14 Aug 2013 07:33:20 +0000 (07:33 +0000)]
Merge "LE: Fix for back-to-back GATT connection request issues" into klp-dev
Matthew Xie [Wed, 14 Aug 2013 07:32:50 +0000 (07:32 +0000)]
Merge "LE: Memory leak when caching GATT service change" into klp-dev