OSDN Git Service

android-x86/system-bt.git
9 years agoam 197ee685: Fix a crash for a race condition during Bluetooth shutdown
Pavlin Radoslavov [Wed, 22 Jul 2015 20:19:17 +0000 (20:19 +0000)]
am 197ee685: Fix a crash for a race condition during Bluetooth shutdown

* commit '197ee6856b43d8eea137a7f37798ee2a012ce518':
  Fix a crash for a race condition during Bluetooth shutdown

9 years agoam ac72840a: Update device type correctly in the NVRAM at inquiry result
Nitin Arora [Wed, 22 Jul 2015 20:18:04 +0000 (20:18 +0000)]
am ac72840a: Update device type correctly in the NVRAM at inquiry result

* commit 'ac72840a3d7409adbb3ee4904ab1ed5de2d66586':
  Update device type correctly in the NVRAM at inquiry result

9 years agoFix a crash for a race condition during Bluetooth shutdown
Pavlin Radoslavov [Wed, 22 Jul 2015 01:09:19 +0000 (18:09 -0700)]
Fix a crash for a race condition during Bluetooth shutdown

This race condition is triggered when A2DP audio is streaming on shutdown:
"btif_a2dp_on_stopped() -> btif_media_task_aa_tx_flush_req()" is called
to stop the particular audio stream, and this happens right after
the "cleanup() -> btif_a2dp_stop_media_task()" processing during
the shutdown of the Bluetooth stack.

Bug: 22602117
Change-Id: I5de6a8f15b6a2771dde2e299a5b60554063696a2

9 years agoUpdate device type correctly in the NVRAM at inquiry result
Nitin Arora [Sat, 27 Jun 2015 01:09:37 +0000 (18:09 -0700)]
Update device type correctly in the NVRAM at inquiry result

This patch checks for the NVRAM data when inquiry result
is received from the remote device. In case the device is
marked as LE only or BR/EDR only, and inquiry result is
received from the alternate transport, the device type is
marked as Dual mode in the NVRAM

Bug: 22604450
Change-Id: Id925e8bad152a33c2bd3c371ca42a6f9c694e3b0

9 years agoam 1da48a36: Use pseudo address while re-pairing peripheral
Nitin Arora [Tue, 21 Jul 2015 21:15:40 +0000 (21:15 +0000)]
am 1da48a36: Use pseudo address while re-pairing peripheral

* commit '1da48a3600c980fe4ba825d287ff0ac5038be3ff':
  Use pseudo address while re-pairing peripheral

9 years agoam b4365c55: Adding transport type while initiating remote discovery
Nitin Arora [Tue, 21 Jul 2015 21:08:18 +0000 (21:08 +0000)]
am b4365c55: Adding transport type while initiating remote discovery

* commit 'b4365c55ccb2e985d00619c30dc14d5c156771b7':
  Adding transport type while initiating remote discovery

9 years agoUse pseudo address while re-pairing peripheral
Nitin Arora [Sat, 18 Jul 2015 01:38:01 +0000 (18:38 -0700)]
Use pseudo address while re-pairing peripheral

In case of pairing to an already paired device (in an instance
where the central remote has removed the keys), the change
makes sure that the correct address is used when LTK key
request occurs at the peripheral.

Bug: 22605510
Change-Id: I959003f39f70281ff1e6af8d4c4549138bc1682c

9 years agoam 280368c7: Fix potential crash when transcoding legacy config files
Andre Eisenbach [Tue, 21 Jul 2015 21:01:36 +0000 (21:01 +0000)]
am 280368c7: Fix potential crash when transcoding legacy config files

* commit '280368c7aa3b3e1dc5236a824f1f6c765967e253':
  Fix potential crash when transcoding legacy config files

9 years agoAdding transport type while initiating remote discovery
Nitin Arora [Fri, 26 Jun 2015 01:30:09 +0000 (18:30 -0700)]
Adding transport type while initiating remote discovery

This change ensures that the completion of SMP pairing for LE
devices specifically requests remote device discovery based on
transport type set to LE to prevent initiation of BR/EDR
connection due to incorrect transport type info

Bug: 22515456
Change-Id: Id1e5603d3cc53ca3dff427b93059a00f8d9150a7

9 years agoam ccd37fa0: Enable enhanced connection complete event
Nitin Arora [Tue, 21 Jul 2015 20:52:39 +0000 (20:52 +0000)]
am ccd37fa0: Enable enhanced connection complete event

* commit 'ccd37fa0fed142dae2491212ec72e20d74560b59':
  Enable enhanced connection complete event

9 years agoFix potential crash when transcoding legacy config files
Andre Eisenbach [Tue, 21 Jul 2015 20:02:57 +0000 (13:02 -0700)]
Fix potential crash when transcoding legacy config files

Bug: 22634292
Change-Id: I64745671f3b69fc7e6913213aeec55267e9bc49b

9 years agoEnable enhanced connection complete event
Nitin Arora [Thu, 2 Jul 2015 21:13:45 +0000 (14:13 -0700)]
Enable enhanced connection complete event

This change enables the enhanced connection complete event in order
to receive the local rpa address while connection is completed
with a paired peripheral. This is required if central tries to
repair or key upgrade an already paired device so that the confirm
or the DHKey Check values match during the pairing process

Bug: 22515703
Change-Id: If27f3b22bc568df6f081f8ad13dfc6783a83ae47

9 years agoresolved conflicts for merge of 65f9c04a to mnc-dev-plus-aosp
Pavlin Radoslavov [Tue, 21 Jul 2015 04:14:46 +0000 (21:14 -0700)]
resolved conflicts for merge of 65f9c04a to mnc-dev-plus-aosp

Change-Id: I4d7f657175347b2625f222b3cf6ab60fd37fb238

9 years agoam fb229d8b: Exclude Polar HR Monitor from secure conn
tturney [Tue, 21 Jul 2015 03:39:09 +0000 (03:39 +0000)]
am fb229d8b: Exclude Polar HR Monitor from secure conn

* commit 'fb229d8bb57070f708b0018578ca2cf94b33b2a1':
  Exclude Polar HR Monitor from secure conn

9 years agoFix the logic for removing bonded devices
Pavlin Radoslavov [Fri, 17 Jul 2015 00:40:28 +0000 (17:40 -0700)]
Fix the logic for removing bonded devices

* Removed btif_storage_is_device_bonded(), because it is not needed,
  and it was giving the wrong answer in use cases like Smart Setup
  with BR/EDR connections.

* Added a call to btif_storage_remove_ble_bonding_keys()
  within btif_storage_remove_bonded_device() so the bonded device
  state is properly removed.

* Don't save the BLE bonding keys if it is temporary bonding

Bug: 22233299
Change-Id: I33d9f76a124acc60173f0acaa517bc29ee6603e8

9 years agoExclude Polar HR Monitor from secure conn
tturney [Tue, 21 Jul 2015 02:28:40 +0000 (19:28 -0700)]
Exclude Polar HR Monitor from secure conn

Bug: 22473630
Change-Id: I1168444a6969532377e1bbcb2b1058d768099c20

9 years agoam 6670e315: Fix multi-advertising when LE Privacy is not available
Arman Uguray [Mon, 20 Jul 2015 21:17:25 +0000 (21:17 +0000)]
am 6670e315: Fix multi-advertising when LE Privacy is not available

* commit '6670e3157c8510bc4b944c6a16d92db56adbb76c':
  Fix multi-advertising when LE Privacy is not available

9 years agoFix multi-advertising when LE Privacy is not available
Arman Uguray [Sat, 18 Jul 2015 07:00:50 +0000 (00:00 -0700)]
Fix multi-advertising when LE Privacy is not available

This patch fixes a bug that caused all multi-advertising instances to be
initialized with Instance ID 0 (which is not allowed by the stack), if LE
privacy is not available. The problem was that the internal data structures that
represent advertising instances were not getting their |inst_id| field
initialized where it's supposed to.

Although far from clean, this code worked before. The culprit for the regression
is "f9fdf890 Random address does not get written properly", which moved the
initialization of instance IDs from the loop in BTM_BleEnableAdvInstance to
btm_ble_multi_adv_enb_privacy. The latter never gets called if privacy is not
available, which leads to partially initialized structures.

Obviously both of these places were wrong to begin with. I saw the word
"init" in a function called btm_ble_multi_adv_init. I figured this might have
something to do with initializing, so I moved the logic there.

Bug: 21267281

Change-Id: I38b9a2a71cd3f45feb267a13bf29f93564ee6075

9 years agoam f0e9c466: Add Moto Key Link to blacklist for LE secure connections
Nitin Arora [Fri, 17 Jul 2015 00:33:53 +0000 (00:33 +0000)]
am f0e9c466: Add Moto Key Link to blacklist for LE secure connections

* commit 'f0e9c46646bf49db05a1dcbecdc0bd64d086f623':
  Add Moto Key Link to blacklist for LE secure connections

9 years agoAdd Moto Key Link to blacklist for LE secure connections
Nitin Arora [Fri, 10 Jul 2015 18:24:47 +0000 (11:24 -0700)]
Add Moto Key Link to blacklist for LE secure connections

This change allows the host to mask the Cross key bit in
the key distribution fields of the pairing request and
response while pairing with the Moto key link. This is
needed since this specific remote device performs
calculations of the pairing confirm after masking the
cross key bit in the key distribtuin field which results
in a mismatch of the pairing confirm calcualted by the host
DUT and the remote.

Bug: 22539807
Change-Id: I7d758b05023cf346c97939883edda9d3adb08e1a

9 years agoam 50333a25: Properly disconnect GATT connection during noisy scans
Arman Uguray [Thu, 16 Jul 2015 18:28:14 +0000 (18:28 +0000)]
am 50333a25: Properly disconnect GATT connection during noisy scans

* commit '50333a25ba3dac54033738d1e2a2688e2977ff2e':
  Properly disconnect GATT connection during noisy scans

9 years agoProperly disconnect GATT connection during noisy scans
Arman Uguray [Wed, 15 Jul 2015 23:05:32 +0000 (16:05 -0700)]
Properly disconnect GATT connection during noisy scans

This patch fixes an issue that is reproducible in highly noisy environments
(massive deployment of BLE beacons), through repeated connect/disconnect
attempts on a remote peripheral while scanning for beacons in the background.
The state machine in bta/gatt has a special control flow for handling disconnect
requests during discovery, which in this case failed to resolve the original
request by issuing an HCI_Disconnect command. This is now fixed by always
explicitly triggering the connection close sequence once the discovery state has
been cleaned up.

This patch also includes a fix for a crash that occurred as a side-effect of the
scenario described above.

Bug: 22350508
Change-Id: Ie9cbd3c8f54239b142bfb8dde80d9581ae70ed43

9 years agoam 165332bc: Cleanup alarm_get_remaining_ms
Andre Eisenbach [Wed, 15 Jul 2015 22:01:54 +0000 (22:01 +0000)]
am 165332bc: Cleanup alarm_get_remaining_ms

* commit '165332bc6795049754fafe35024c2c605796c96a':
  Cleanup alarm_get_remaining_ms

9 years agoCleanup alarm_get_remaining_ms
Andre Eisenbach [Wed, 15 Jul 2015 19:35:15 +0000 (12:35 -0700)]
Cleanup alarm_get_remaining_ms

This function is used for PM sniff mode timers - at least until we can
re-factor those not to rely on this function.

Bug: 22040710
Change-Id: Ibe6f49440228732b2bd8242db4a44e481b00b62e

9 years agoam ac1399a7: Use correct own address type for batch scan
Nitin Arora [Wed, 15 Jul 2015 19:30:53 +0000 (19:30 +0000)]
am ac1399a7: Use correct own address type for batch scan

* commit 'ac1399a7aab6051f984235971573d62ddf76891d':
  Use correct own address type for batch scan

9 years agoUse correct own address type for batch scan
Nitin Arora [Fri, 19 Jun 2015 02:09:01 +0000 (19:09 -0700)]
Use correct own address type for batch scan

This patch ignores the input parameter and used the own
address type from address management block while setting
the batch scan parameters.

Bug: 22227689
Change-Id: I23fc80b68cfbd91d718c1094ef2483eaccda3ae1

9 years agoam 76356aee: Bug fix PM changes and LE connectivity mode fixes
VenkatRaghavan VijayaRaghavan [Wed, 15 Jul 2015 06:10:35 +0000 (06:10 +0000)]
am 76356aee: Bug fix PM changes and LE connectivity mode fixes

* commit '76356aee883af67898ddc1aa3b628195f396d42a':
  Bug fix PM changes and LE connectivity mode fixes

9 years agoBug fix PM changes and LE connectivity mode fixes
VenkatRaghavan VijayaRaghavan [Tue, 21 Apr 2015 18:32:29 +0000 (11:32 -0700)]
Bug fix PM changes and LE connectivity mode fixes

Allow PM to support multiple delay timer for different profiles and
power mode requests. And set correct connectivity mode.

Bug: 22040710
Change-Id: Idabd9ea944f0c5a89ce542d85db9f103fa7d1816

9 years agoam 21331c62: Store the link key derived from cross tranport link key
Srinu Jella [Wed, 15 Jul 2015 05:03:10 +0000 (05:03 +0000)]
am 21331c62: Store the link key derived from cross tranport link key

* commit '21331c62310dda2f523712c536da3e65afce0f38':
  Store the link key derived from cross tranport link key

9 years agoStore the link key derived from cross tranport link key
Srinu Jella [Tue, 16 Jun 2015 14:08:45 +0000 (19:38 +0530)]
Store the link key derived from cross tranport link key

Use case: PTS test case for cross transport link key
derivation

Steps to reproduce:
1. Start Test case GAP TP/LEP/DM/BV-15 in PTSv6.0

Failure: PTS test case TP/LEP/DM/BV-15 fails as the link
key is not stored when the key is derived from other
transport key. So it will again go for pairing even though
it has link key but not stored.

Root cause: Link key is stored only when bond type is
presistent, but it sets the bond type to persistent only
when it receives SSP request but not link key is derived.

Fix: So making the solution generic to store always when the
link key type is authenticated combination key with P-256.

Bug: 22486860
Change-Id: I3eb201262f72c86a9438351cad14a6698065fa90

9 years agoam fd4745ec: service: Some fixes from end-to-end/user testing.
Ian Coolidge [Tue, 14 Jul 2015 22:52:52 +0000 (22:52 +0000)]
am fd4745ec: service: Some fixes from end-to-end/user testing.

* commit 'fd4745ec554a95ea98230fcede779421ad89e363':
  service: Some fixes from end-to-end/user testing.

9 years agoam 115c6b1d: service: Remove local copies of base and modp_b64
Arman Uguray [Tue, 14 Jul 2015 22:28:04 +0000 (22:28 +0000)]
am 115c6b1d: service: Remove local copies of base and modp_b64

* commit '115c6b1dbd43e8c390483f537dfb0c477d449269':
  service: Remove local copies of base and modp_b64

9 years agoam 0ca99052: gn-build: Add BUILD files for libchrome
Arman Uguray [Tue, 14 Jul 2015 22:28:03 +0000 (22:28 +0000)]
am 0ca99052: gn-build: Add BUILD files for libchrome

* commit '0ca99052be04bfd85c9c1ae2601214bedf90b238':
  gn-build: Add BUILD files for libchrome

9 years agoam 9f0fa1b6: Add additional BDA ranges for Nexus Remote workaround
Andre Eisenbach [Tue, 14 Jul 2015 18:45:05 +0000 (18:45 +0000)]
am 9f0fa1b6: Add additional BDA ranges for Nexus Remote workaround

* commit '9f0fa1b60e20a1fa3f0845d72dac740e06b245d7':
  Add additional BDA ranges for Nexus Remote workaround

9 years agoAdd additional BDA ranges for Nexus Remote workaround
Andre Eisenbach [Tue, 14 Jul 2015 16:49:37 +0000 (09:49 -0700)]
Add additional BDA ranges for Nexus Remote workaround

As per feedback from manufacturer.

Bug: 21817410
Change-Id: I4b5b3d8d99f9299754221968a5e1ca5f21cb9478

9 years agoservice: Some fixes from end-to-end/user testing.
Ian Coolidge [Tue, 14 Jul 2015 01:22:46 +0000 (18:22 -0700)]
service: Some fixes from end-to-end/user testing.

* Send responses to ExecWrite requests.
* Provide valid data on write responses.
* Properly destruct Gatt::Server objects.
* Synchronize CoreStack 'enable' calls properly.

Change-Id: I4e9eed1979b10abccc7ae487e2c7d90d491e38d9

9 years agoservice: Remove local copies of base and modp_b64
Arman Uguray [Wed, 8 Jul 2015 22:33:05 +0000 (15:33 -0700)]
service: Remove local copies of base and modp_b64

Since libbase is now available on AOSP (under libchrome) Bluetooth code can
depend on it rather than maintain its own copy a subset of base sources (and
modp_b64 dependencies).

Dependent CL: http://r.android.com/158335

Bug: 22175181
Change-Id: I3a301e49353598633ad857ac4345d0361c273beb

9 years agogn-build: Add BUILD files for libchrome
Arman Uguray [Wed, 8 Jul 2015 00:00:09 +0000 (17:00 -0700)]
gn-build: Add BUILD files for libchrome

This CL adds GN build files for libchrome, which is the ChromeOS/Brillo library
for many C++ tools, include libbase. I added a new GN build target for "base"
under secondary sources with a GN build file for libchrome which currently lives
in platform/external/libchrome in AOSP.

To build, clone libchrome into third_party/libchrome and remove
third_party/libchrome/base/BUILD.gn. Also clone external/modp_b64 into
third_party/modp_b64. Eventually I will have scripts set up to do
this automatically.

This means that we can start developing against libbase while running GN builds
on Goobuntu but this would break the tree until libchrome is buildable within
the Android build system (http://r.android.com/158392). So Brillo/Android builds
will depend on libchrome using the conventional Android.mk means.

Bug: 22175181
Change-Id: I9a737aa785488e5bc0ca1adc087d1d5dfcdf3bea

9 years agoam e53454f7: Additional BDA range for Nexus Remote secure connections blacklist
Andre Eisenbach [Mon, 13 Jul 2015 17:30:29 +0000 (17:30 +0000)]
am e53454f7: Additional BDA range for Nexus Remote secure connections blacklist

* commit 'e53454f71c1c894fa3976cfe5f5a22d50b2ff28b':
  Additional BDA range for Nexus Remote secure connections blacklist

9 years agoresolved conflicts for merge of 27c4e634 to mnc-dev-plus-aosp
Andre Eisenbach [Mon, 13 Jul 2015 17:06:52 +0000 (10:06 -0700)]
resolved conflicts for merge of 27c4e634 to mnc-dev-plus-aosp

Change-Id: Id6d78e484d58042e93e4d4ea34522d15a6e1ba59

9 years agoAdditional BDA range for Nexus Remote secure connections blacklist
Andre Eisenbach [Mon, 13 Jul 2015 16:36:03 +0000 (09:36 -0700)]
Additional BDA range for Nexus Remote secure connections blacklist

Bug: 21817410
Change-Id: I5c5f6da9e8326e4c9424907337331b39fb67b444

9 years agoMove pairing auto-retry workaround to new interop db
Andre Eisenbach [Mon, 6 Jul 2015 22:43:15 +0000 (15:43 -0700)]
Move pairing auto-retry workaround to new interop db

Change-Id: I7177aaa0e2d0c3b0fa79ae655c0171f0703c54f3

9 years agoam 71334dcd: Do not reject valid connection parameter updates
Andre Eisenbach [Fri, 10 Jul 2015 17:35:03 +0000 (17:35 +0000)]
am 71334dcd: Do not reject valid connection parameter updates

* commit '71334dcd2c58564a195dade1f862f052ecd07b50':
  Do not reject valid connection parameter updates

9 years agoam 08c08fc0: Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO
Pavlin Radoslavov [Fri, 10 Jul 2015 17:33:18 +0000 (17:33 +0000)]
am 08c08fc0: Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO

* commit '08c08fc0015c3c5e864da080dba0712ee89a6712':
  Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO

9 years agoDo not reject valid connection parameter updates
Andre Eisenbach [Fri, 10 Jul 2015 07:37:45 +0000 (00:37 -0700)]
Do not reject valid connection parameter updates

As a side-effect to increasing BTM_BLE_CONN_INT_MIN, valid connection
parameter updates can be rejected if the requested minimum is < 11.25ms,
but the requested maximum is >= 11.25ms.

This patch introduces a new parameter "BTM_BLE_CONN_INT_LIMIT" and
resets BTM_BLE_CONN_INT_MIN to the HCI spec defined minimum.

Bug: 22245224
Change-Id: I6a2e4d18488b63570f7d0070413d00f16a7fdba1

9 years agoam 26c3dd41: Fail LE secure pairing for secure only peripherals
Nitin Arora [Fri, 10 Jul 2015 17:00:32 +0000 (17:00 +0000)]
am 26c3dd41: Fail LE secure pairing for secure only peripherals

* commit '26c3dd41b294b7f6d0ca7198b00ed1e1ef32dfb9':
  Fail LE secure pairing for secure only peripherals

9 years agoam 8f766350: Reset the ACL connection data on ACL disconnection
Srinu Jella [Fri, 10 Jul 2015 17:00:31 +0000 (17:00 +0000)]
am 8f766350: Reset the ACL connection data on ACL disconnection

* commit '8f766350bbb7026ddf34b73c9d87967decff792b':
  Reset the ACL connection data on ACL disconnection

9 years agoam 549c64d1: Fix security vulnerabilities in string operations
Miao Chou [Fri, 10 Jul 2015 16:59:45 +0000 (16:59 +0000)]
am 549c64d1: Fix security vulnerabilities in string operations

* commit '549c64d1eb96f8096915a39c2a3447190c851bce':
  Fix security vulnerabilities in string operations

9 years agoFix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO
Pavlin Radoslavov [Fri, 10 Jul 2015 00:57:20 +0000 (17:57 -0700)]
Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO

Assign appropriately the p_rsp_data pointer to point in the
buffer with the response.

Bug: 22307858
Change-Id: I2f77f290ff2c62c09b3be18ff047167a48c7c9d4

9 years agoFail LE secure pairing for secure only peripherals
Nitin Arora [Thu, 25 Jun 2015 17:48:56 +0000 (10:48 -0700)]
Fail LE secure pairing for secure only peripherals

This change allows the host peripheral which initiates the pairing
to reject the pairing in case the remote does not support
secure LE connections and the host DUT is in secure connections
only mode.

Bug: 22203134
Change-Id: If58f791cb575d6b66c361f58e574b613d5686047

9 years agoReset the ACL connection data on ACL disconnection
Srinu Jella [Fri, 3 Jul 2015 10:01:11 +0000 (15:31 +0530)]
Reset the ACL connection data on ACL disconnection

Use case: Reconnection of legacy mouse.

Failure: Not able to reconnect with mouse if the previous
connection rejected was with SC enabled device.

Test Steps:
1. Pair and connect remote devices.
2. Start streaming music over headset and Disconnect HID
   mouse.
3. Inquire and try to pair with any DUT which supports
   secure connection.
4. Cancel pairing and Turn OFF remote headset.
5. Now try reconnection from HID mouse.

Root Cause: When the secure connection is established, it will
have the 3 pages filled, and when the same acl entry is reused
for next mouse reconnection, only one page is getting over
written because legacy HID will have only one page supported
and remaining 2 pages still holds the previous device's data.

Fix: Fixed it by resetting the ACL entry when the ACL is
disconnected so that even though one page is copied and
remaining pages will not contain valid data.

Bug: 22249108
Change-Id: Icd96f22fe0787ef5845ee02940c2b0eacf7a2bbd

9 years agoFix security vulnerabilities in string operations
Miao Chou [Thu, 9 Jul 2015 19:21:27 +0000 (12:21 -0700)]
Fix security vulnerabilities in string operations

This CL prevents functions, bta_ag_hfp_result and bta_hf_client_send_atd, from
the potential strings overflowing.

Bug: 20674686,20677309
Change-Id: Iaef720fc784e020f237feb86e17857bddf57bbfc

9 years agoam 680959b0: Add missing data initialization
Pavlin Radoslavov [Thu, 9 Jul 2015 19:32:54 +0000 (19:32 +0000)]
am 680959b0: Add missing data initialization

* commit '680959b0914cc32a4f30dbef2fcc95dd980dd96b':
  Add missing data initialization

9 years agoAdd missing data initialization
Pavlin Radoslavov [Thu, 9 Jul 2015 06:17:44 +0000 (23:17 -0700)]
Add missing data initialization

A local struct variable is not initialized (memset to 0)
when sending GET_REPORT_EVT to an application.
As a result, field hs_data.rsp_data.p_rpt_data might be used
uninitialized.

Bug: 22352578
Change-Id: I72141117187c392bc0502a17bf71859e67c8da54

9 years agobuild: fixes for LOG_* message build errors.
Marie Janssen [Wed, 8 Jul 2015 02:37:14 +0000 (19:37 -0700)]
build: fixes for LOG_* message build errors.

Differences in aosp and master mean these were missed before.

Change-Id: Ieedffa62ca0c175637947eb190ead579eb55ff58
(cherry picked from commit fcd814a35c862e46f82332ca203d17f280b33d2f)

9 years agoam 49120dc8: build: Fix LOG_TAG define breakage, macro usage
Marie Janssen [Wed, 8 Jul 2015 01:44:36 +0000 (01:44 +0000)]
am 49120dc8: build: Fix LOG_TAG define breakage, macro usage

* commit '49120dc867c7818511b5afec461dfc97d17eef58':
  build: Fix LOG_TAG define breakage, macro usage

9 years agobuild: Fix LOG_TAG define breakage, macro usage
Marie Janssen [Tue, 7 Jul 2015 23:47:20 +0000 (16:47 -0700)]
build: Fix LOG_TAG define breakage, macro usage

Fixes build breakages related to r.android.com/156982

Change-Id: Ib1143c41fe05a17c296226998afdb41a8cb6294a

9 years agoam db554581: build: Update osi log functions, use consistently
Marie Janssen [Tue, 7 Jul 2015 18:57:01 +0000 (18:57 +0000)]
am db554581: build: Update osi log functions, use consistently

* commit 'db554581079863974af8e1289646f5deea6fc044':
  build: Update osi log functions, use consistently

9 years agoam fd0e9f19: Properly handle outgoing connection requests in opening/opened state
Anubhav Gupta [Tue, 7 Jul 2015 16:17:42 +0000 (16:17 +0000)]
am fd0e9f19: Properly handle outgoing connection requests in opening/opened state

* commit 'fd0e9f1915dab624282c9d11ac6a1c7228c18c75':
  Properly handle outgoing connection requests in opening/opened state

9 years agoam 905c72de: Incorrect address type in ADV end on reconnection
Satya Calloji [Tue, 7 Jul 2015 16:17:41 +0000 (16:17 +0000)]
am 905c72de: Incorrect address type in ADV end on reconnection

* commit '905c72de29add7963b48e016b87e5ebe1a5f8503':
  Incorrect address type in ADV end on reconnection

9 years agoam 9c5d0727: Override remote suspend flag on local play state changes
Anubhav Gupta [Tue, 7 Jul 2015 16:17:40 +0000 (16:17 +0000)]
am 9c5d0727: Override remote suspend flag on local play state changes

* commit '9c5d0727dd4cd09e44c032506c28ab4120ad3b88':
  Override remote suspend flag on local play state changes

9 years agoam 42f37840: SDP: Validate input UUID\'s length
Srinu Jella [Tue, 7 Jul 2015 16:17:02 +0000 (16:17 +0000)]
am 42f37840: SDP: Validate input UUID\'s length

* commit '42f37840a891eddfee0943fbdf84c2e4f0d765c5':
  SDP: Validate input UUID's length

9 years agoam 97269982: Remove extraneous patch from secure connections workaround
Andre Eisenbach [Tue, 7 Jul 2015 16:17:02 +0000 (16:17 +0000)]
am 97269982: Remove extraneous patch from secure connections workaround

* commit '97269982095f2da252d667542688d98e5fee128f':
  Remove extraneous patch from secure connections workaround

9 years agoam f1029c7a: Remove stored link key for temporarily paired devices
Srinu Jella [Tue, 7 Jul 2015 16:17:01 +0000 (16:17 +0000)]
am f1029c7a: Remove stored link key for temporarily paired devices

* commit 'f1029c7afb9b4c9fcf95b3f98ce9c68b10d5a02c':
  Remove stored link key for temporarily paired devices

9 years agoProperly handle outgoing connection requests in opening/opened state
Anubhav Gupta [Wed, 4 Sep 2013 10:20:39 +0000 (15:50 +0530)]
Properly handle outgoing connection requests in opening/opened state

This happens in race conditions when we try to connect to a remote
A2DP device from Bluetooth Settings UI and simultaneously there is incoming
connection request from previously connected remote. This fix addresses
the scenario where because of first A2DP connection btif moves to opening/
opened state and then the second connect request is received.
This scenario is handled by gracefully rejecting the second connect request
from btif layer if it is already connected or about to be connected by the
first connect request.

Bug: 22028876
Change-Id: I53be400d1d7c9a84ca9d9a75b6b6f010975cf0cf

9 years agoIncorrect address type in ADV end on reconnection
Satya Calloji [Tue, 23 Jun 2015 22:21:19 +0000 (15:21 -0700)]
Incorrect address type in ADV end on reconnection

Handled the issue of incorrect address type and value
(on Privacy 1.1 chipsets) on reconnection by setting
the correct device type and address value on advertiser end

Original author: Chaojing Sun <cjsun@broadcom.com>

Bug: 22100659
Change-Id: I009888cc9ebd0b631543027d6e34b6c7ecbd0ce8

9 years agoOverride remote suspend flag on local play state changes
Anubhav Gupta [Sat, 27 Jul 2013 09:16:29 +0000 (14:46 +0530)]
Override remote suspend flag on local play state changes

- Remote device may initiate AVDTP Suspend within 3s of AVRCP pause,
  which sets remote suspend flag. Later on resumption of local playback
  A2DP packets can not be processed further as Remote suspend flag
  remains set. current change overrides remote suspend flag if local
  suspend is triggered later.
- This change covers the usecase where play is pressed from DUT UI
  before local suspend triggers in such scenarios current change takes
  care of resetitng remote suspend flag on AVRCP play state change event.
- Moreover this change will drop A2DP packets when the setparameter
  is called with A2dpSuspended=true and resumes when the mentioned parameter
  is reset.

This change along with corresponding app change helps mitigating
issues reported due to A2Dp, HFP synchronizations and local and remote
device initiated AVDTP suspend handling.

Bug: 22028876
Change-Id:  I3bb334373414170254744d9233cbd2e66219bfa0

9 years agoSDP: Validate input UUID's length
Srinu Jella [Thu, 24 Jul 2014 14:24:32 +0000 (19:54 +0530)]
SDP: Validate input UUID's length

Use case: Crash observed during BT IOT testing

1. Try to pair to the remote device.
2. Connect  to the remote device's audio profiles.
3. Remote device has given the wrong UUID's length.This will leads to crash.

Failure: crash observed during profile connection

Root cause: Remote sent invalid UUID length,which is causing crash
in comparison logic.

Fix: Validate input UUID's length before going for actual comparison.

Bug: 19417758
Change-Id: I8216d17e3f6cc22dfbeca4b31972b5b5584a73ea

9 years agoRemove extraneous patch from secure connections workaround
Andre Eisenbach [Tue, 7 Jul 2015 05:27:00 +0000 (22:27 -0700)]
Remove extraneous patch from secure connections workaround

Bug: 21817410
Change-Id: I55b3753b0ae9f389f1531bb588c4868e96842aeb

9 years agoRemove stored link key for temporarily paired devices
Srinu Jella [Tue, 2 Sep 2014 10:12:11 +0000 (15:42 +0530)]
Remove stored link key for temporarily paired devices

Problem: Device shows up in paired list during just work pairing

1. Create a connection from DUT to remote.
2. Remove the link key in remote.
3. Send a file from remote to DUT.
4. Turn OFF BT. Turn ON.

Failure: Device should not move to paired list after BT on/off
as device removed from UI during just work pairing

Root cause: remote device is not removed from btif but
its removed from UI during justworks pairing

Fix: remote device is removed from btif during justworks
pairing to sync up UI and btif paired list

Bug: 19417758
Change-Id: I73de0a94c4f7ada644d258790a9e3e4bf11fc4e5

9 years agoam 1192df9f: Save all snoop logs when BtSnoopSaveLog=true
Tucker Sylvestro [Tue, 7 Jul 2015 00:40:41 +0000 (00:40 +0000)]
am 1192df9f: Save all snoop logs when BtSnoopSaveLog=true

* commit '1192df9f7e709b9d9508ac86cbf5099a3a7ffa0e':
  Save all snoop logs when BtSnoopSaveLog=true

9 years agoSave all snoop logs when BtSnoopSaveLog=true
Tucker Sylvestro [Mon, 6 Jul 2015 23:29:06 +0000 (19:29 -0400)]
Save all snoop logs when BtSnoopSaveLog=true

Previously, only the last snoop log was saved, which was often not
enough if the bluetooth stack was in a crash loop or an app was
resetting it frequently.

Bug: 22202788
Change-Id: I74622ceabe9ce12d5ba03c640c37f697d5a5bb01

9 years agoam 7927f68b: Blacklist Nexus Remote for LE secure connections
Andre Eisenbach [Mon, 6 Jul 2015 23:01:25 +0000 (23:01 +0000)]
am 7927f68b: Blacklist Nexus Remote for LE secure connections

* commit '7927f68bb2d9b963288261e1e858463b43c52a2d':
  Blacklist Nexus Remote for LE secure connections

9 years agoam 4f6c9b4f: Use correct transport type while encrypting link
Nitin Arora [Mon, 6 Jul 2015 23:01:25 +0000 (23:01 +0000)]
am 4f6c9b4f: Use correct transport type while encrypting link

* commit '4f6c9b4f68d152baf7aa029cbe9b570994584101':
  Use correct transport type while encrypting link

9 years agobuild: Update osi log functions, use consistently
Marie Janssen [Fri, 26 Jun 2015 21:53:46 +0000 (14:53 -0700)]
build: Update osi log functions, use consistently

Update the LOG_* functions to take a tag argument which makes them more
consistent with the Android Log.*(TAG, s) common syntax and removes
some #define-dependency with osi/include/log.h.

Also update to never use Android log functions directly.

Also contains minor cleanup of some header includes.

Bug: 21569831
Change-Id: If07385cafbea062232ecdbc7c673f908d5ef8921

9 years agoBlacklist Nexus Remote for LE secure connections
Andre Eisenbach [Thu, 2 Jul 2015 23:14:28 +0000 (16:14 -0700)]
Blacklist Nexus Remote for LE secure connections

The Nexus remote will disconnect during encryption when paired with the
secure connections feature enabled. This patch will blacklist the remote
and mask out the feature during pairing.

This patch introduces a new interop database with the aim of
consolodating various blacklists and interop workarounds into a single
database for code readability and maintainability of the list.

Bug: 21817410
Change-Id: I6f510e1c8c6050ab4e313209122d028e12e5f54f

9 years agoUse correct transport type while encrypting link
Nitin Arora [Tue, 9 Jun 2015 22:30:18 +0000 (15:30 -0700)]
Use correct transport type while encrypting link

This patch uses the transport type from the GATT event instead
of using the device type stored in NVRAM, to determine the
transport type while encrypting the link. The issue is seen
with dual mode devices, when the connection on LE transport
causes encryption request on the BR/EDR transport

Bug: 21652097
Change-Id: I895756f9c0048b5a559ea00f633b1100109e52b8

9 years agoam d69bef4e: Merge "Prevent LE remote name request during inquiry" into mnc-dev
Andre Eisenbach [Mon, 6 Jul 2015 16:56:19 +0000 (16:56 +0000)]
am d69bef4e: Merge "Prevent LE remote name request during inquiry" into mnc-dev

* commit 'd69bef4e26accb3ed85db244c442a4e028927ea8':
  Prevent LE remote name request during inquiry

9 years agoMerge "Prevent LE remote name request during inquiry" into mnc-dev
Andre Eisenbach [Mon, 6 Jul 2015 16:45:30 +0000 (16:45 +0000)]
Merge "Prevent LE remote name request during inquiry" into mnc-dev

9 years agoPrevent LE remote name request during inquiry
Nitin Arora [Fri, 11 Jul 2014 21:33:05 +0000 (14:33 -0700)]
Prevent LE remote name request during inquiry

This change prevents the LE RNR at the end of inquiry. This prevents
extra LE connections created during BT scan, to fetch remote name,
which will be performed later during connections.

Bug: 22228981
Change-Id: Ied61bc192cec611e7b2f41e474c5f032ed9f0981

9 years agoam 8e928b4a: Set random identity only if enhanced privacy is supported
Priti Aghera [Mon, 6 Jul 2015 16:01:39 +0000 (16:01 +0000)]
am 8e928b4a: Set random identity only if enhanced privacy is supported

* commit '8e928b4ad152c6b2713147067e02327f3bbedde6':
  Set random identity only if enhanced privacy is supported

9 years agoSet random identity only if enhanced privacy is supported
Priti Aghera [Wed, 1 Jul 2015 20:27:57 +0000 (13:27 -0700)]
Set random identity only if enhanced privacy is supported

Change Own address type to Random identity only if controller supports enhanced
privacy. Check if controller supports enhanced privacy before changing own adress type
and peer address type to 0x02 or 0x03 in auto connection.
Privacy 4.1 only supports Public and Random address.

Bug: 20817308
Change-Id: I9f5531e4e41c824426cd64de517b44355ac2655d

9 years agoam 9345c8fd: Use the correct memory free function within HCI layer shutdown
Pavlin Radoslavov [Thu, 2 Jul 2015 00:46:54 +0000 (00:46 +0000)]
am 9345c8fd: Use the correct memory free function within HCI layer shutdown

* commit '9345c8fd0dae6d1c1954c9d2e29ad57fcf5015ad':
  Use the correct memory free function within HCI layer shutdown

9 years agoUse the correct memory free function within HCI layer shutdown
Pavlin Radoslavov [Wed, 1 Jul 2015 04:39:11 +0000 (21:39 -0700)]
Use the correct memory free function within HCI layer shutdown

The  entries on the "command_queue" are allocated by osi_calloc()
hence they should be deallocated by osi_free()

Bug: 21784321
Change-Id: Ic6e13dbafef2c6ac79ce74ebfc4db702c9ef04c5

9 years agoam df81c3aa: Add missing library dependency.
Evgenii Stepanov [Tue, 30 Jun 2015 01:53:30 +0000 (01:53 +0000)]
am df81c3aa: Add missing library dependency.

* commit 'df81c3aaadee7a5f91e5d993cc823d4e65db25db':
  Add missing library dependency.

9 years agoAdd missing library dependency.
Evgenii Stepanov [Mon, 29 Jun 2015 20:59:44 +0000 (13:59 -0700)]
Add missing library dependency.

Fixes the following link error in SANITIZE_TARGET=address build for
hammerhead:
system/bt/audio_a2dp_hw/audio_a2dp_hw.c:208: error: undefined reference
to 'osi_socket_local_client_connect'

Bug: 21785137
Change-Id: Ie29a2772e7f1a4f697d895eb29b01d39d6f9c651

9 years agoam fa3c1214: Fix possible null-pointer de-reference in bta_gattc_util
Andre Eisenbach [Sun, 28 Jun 2015 17:30:12 +0000 (17:30 +0000)]
am fa3c1214: Fix possible null-pointer de-reference in bta_gattc_util

* commit 'fa3c1214f5b006edced961a66c758b8b47b0f482':
  Fix possible null-pointer de-reference in bta_gattc_util

9 years agoFix possible null-pointer de-reference in bta_gattc_util
Andre Eisenbach [Sat, 27 Jun 2015 05:30:33 +0000 (22:30 -0700)]
Fix possible null-pointer de-reference in bta_gattc_util

Bug: 21756298
Change-Id: I4bd38f6fa594ccb4dd9f23f3887484743a3bc451

9 years agoam 3a2fa83d: Copy an AVRC packet before sending a response back
Pavlin Radoslavov [Sat, 27 Jun 2015 03:22:35 +0000 (03:22 +0000)]
am 3a2fa83d: Copy an AVRC packet before sending a response back

* commit '3a2fa83dac1b07b661a20e2412aad9bf81492106':
  Copy an AVRC packet before sending a response back

9 years agoCopy an AVRC packet before sending a response back
Pavlin Radoslavov [Fri, 26 Jun 2015 21:44:12 +0000 (14:44 -0700)]
Copy an AVRC packet before sending a response back

Don't reuse AVRC buffers for responding back. Apparently,
in the AVRC packets we transmit the offset with the payload must
be at least 15 octets. If the original buffer is not large enough,
this results in memory corruption.

Also, use an explicit check for 'bt_rc_ctrl_callbacks' as a workaround
until the upper layer does the right thing with the callbacks registration.

Bug: 22006014

Change-Id: I28c248d1580bdddbda76298d19faadf8985187fc

9 years agoam dd2021c6: Always ACK indications in the event of an error
Tucker Sylvestro [Thu, 25 Jun 2015 21:26:52 +0000 (21:26 +0000)]
am dd2021c6: Always ACK indications in the event of an error

* commit 'dd2021c65b8a1a14e67e4f23628b3e15faf9fdcc':
  Always ACK indications in the event of an error

9 years agoAlways ACK indications in the event of an error
Tucker Sylvestro [Thu, 18 Jun 2015 22:14:25 +0000 (18:14 -0400)]
Always ACK indications in the event of an error

This works around a race condition in which the just-connected remote
device sends the local device an indication before the appropriate
handle/device/etc. has been added to the cache.  Previously we were
dropping that indication, which led to the remote device timing out
and disconnecting some time after the connection had been successfully
established.

Bug: 21026847

Change-Id: Iea43e7c93e48b5e7a7e78a1c3fb591d6fe972fc3

9 years agoam d9663b2d: Set idle timeout to zero when removing fixed channel
Pradeep Panigrahi [Thu, 25 Jun 2015 17:42:19 +0000 (17:42 +0000)]
am d9663b2d: Set idle timeout to zero when removing fixed channel

* commit 'd9663b2d7ab5457cb9ab6fe39dcadb191e8f1012':
  Set idle timeout to zero when removing fixed channel

9 years agoam 8bc9ca59: Resolved incorrect AV startup sequence
Avish Shah [Thu, 25 Jun 2015 17:21:49 +0000 (17:21 +0000)]
am 8bc9ca59: Resolved incorrect AV startup sequence

* commit '8bc9ca592a1c80d50f85b4dafba24ba2394b4ab7':
  Resolved incorrect AV startup sequence

9 years agoSet idle timeout to zero when removing fixed channel
Pradeep Panigrahi [Tue, 16 Jun 2015 04:32:50 +0000 (10:02 +0530)]
Set idle timeout to zero when removing fixed channel

Use Case:
1) pair and Connect to HOGP mouse
2) Disconnect from setting menu.

Failure:
Disconnect is not sent immediately

Root Cause:
While disconnecting we start lcb's default timeout of 4 seconds before
disconnecting the link. Since we are removing fixed channels associated
to a remote, setting idle timeout to 0 for immediate disconnection.

Bug: 21877809
Change-Id: I39fedb6cac6f952149cb2722d028115fbdc20b70

9 years agoResolved incorrect AV startup sequence
Avish Shah [Thu, 25 Jun 2015 12:31:33 +0000 (18:01 +0530)]
Resolved incorrect AV startup sequence

Issue:
-> In AV start-up sequence, State machine initialization was being
called after enabling Btif A2dp service.
-> In that case, State machine handle will be empty and it will
prevent enable and register events to enter into BTIF.
-> Because of the absence of enable/register events, AV module in
stack will be unaware of upper layer registration and will not
proceed for connection.

Fix:
-> Changed the sequence in AV start-up, initialized State machine
first before dispatching any events to State machine.
-> So, the handle will not be empty and will not block events like
BTA_AV_ENABLE_EVT and BTA_AV_REGISTER_EVT to enter into BTIF.

Bug: 21451237
Change-Id: I5d47e20ed68ea5730a7c149c316446eb8a1d41af

9 years agoam 10969128: build: Eliminate cutils/sockets dependencies from system/bt
Miao Chou [Thu, 25 Jun 2015 01:12:36 +0000 (01:12 +0000)]
am 10969128: build: Eliminate cutils/sockets dependencies from system/bt

* commit '109691281c0135fd4298debcdec37fdc5855261e':
  build: Eliminate cutils/sockets dependencies from system/bt

9 years agobuild: Eliminate cutils/sockets dependencies from system/bt
Miao Chou [Wed, 10 Jun 2015 00:39:46 +0000 (17:39 -0700)]
build: Eliminate cutils/sockets dependencies from system/bt

Eliminate cutils/sockets dependencies by pulling sources files from
core/libcutils into osi/.
   - Pulled source files from cutils/ into osi/ and modified GN files and
     Android.mk
   - Updated includes to use the headers in osi/ and removed unused/duplicated
     headers.
   - Renamed the functions of osi/sockets and updated wherever they are called
     to avoid usign symbols from cutils/sockets, since other cutils
     dependencies have not been eliminated yet.

Bug: 21667795
Change-Id: I3dd4371d585f120d97ac0433ab1f35edb820dbb9

9 years agoam 641e21a5: HOGP: Clear allocated memory for unmatched HID reports
Subramanian Srinivasan [Wed, 24 Jun 2015 01:00:12 +0000 (01:00 +0000)]
am 641e21a5: HOGP: Clear allocated memory for unmatched HID reports

* commit '641e21a5389dd3765364f52a15a4a302a99fa360':
  HOGP: Clear allocated memory for unmatched HID reports

9 years agoHOGP: Clear allocated memory for unmatched HID reports
Subramanian Srinivasan [Thu, 12 Feb 2015 00:55:12 +0000 (16:55 -0800)]
HOGP: Clear allocated memory for unmatched HID reports

Prevents GKI Exception in BT stack when phone enters suspended state
after performing HOGP device connection by clearing the allocated
memory when write to an unmatched report is done.

Bug: 22028876
Change-Id: Ia6ca9405142410e894c7ebe84d8827ffdc7659ba