OSDN Git Service

android-x86/system-bt.git
7 years agoMerge "Reject LE COC if cid is duplicated" into oc-dev
TreeHugger Robot [Mon, 22 May 2017 18:17:41 +0000 (18:17 +0000)]
Merge "Reject LE COC if cid is duplicated" into oc-dev

7 years agoProtect concurrent access to local state used during BLE scanning
Jakub Pawlowski [Wed, 17 May 2017 22:23:22 +0000 (15:23 -0700)]
Protect concurrent access to local state used during BLE scanning

Make sure that all access happens on jni thread

Bug: 38298938
Test: Code compilation
Change-Id: I38246626d2c6390586b314b27889dd9ba905f406
(cherry picked from commit eb43e9cf12139aeb227e26a8201a80974129c553)

7 years agoProtect the message loop from accesses after HCI shutdown
Pavlin Radoslavov [Wed, 17 May 2017 01:50:43 +0000 (18:50 -0700)]
Protect the message loop from accesses after HCI shutdown

Bug: 38330724
Test: Manual: enable/disable Bluetooth
Change-Id: Iaece4cd608c67b28b436ded9fcc51c0bf28f4098
(cherry picked from commit 7277f39540fefe551dc2120fc4db787a9ed57646)

7 years agoBlacklist Kinivo BTC350 for Absolute Volume
Marie Janssen [Wed, 17 May 2017 01:40:45 +0000 (18:40 -0700)]
Blacklist Kinivo BTC350 for Absolute Volume

The volume is erratic on the speakers when the speaker is reporting
linear increase, with decreases for higher volumes.

Test: check that absolute volume not used for Kinivo Speakers
Bug: 37872586
Change-Id: Ic5f409e8631bece66a75372b916faa9c104e2024
(cherry picked from commit e1fca1bacd76bd4e2c6c00ea3e292633e0eae0ec)

7 years agoDisable MONO channel mode for LDAC
Pavlin Radoslavov [Tue, 16 May 2017 23:20:23 +0000 (16:20 -0700)]
Disable MONO channel mode for LDAC

Bug: 38351937
Test: A2DP streaming to LDAC headset and switching MONO/STEREO in Settings
Change-Id: I20c5069fd5d104b9ebe767ae2728af7d7b2ae1d9
(cherry picked from commit f7e48dff99ffbce639c37379976b8cd9519e1d06)

7 years agoDiscover primary service by UUID for PTS tests (1/4)
Jakub Pawlowski [Tue, 16 May 2017 17:47:54 +0000 (10:47 -0700)]
Discover primary service by UUID for PTS tests (1/4)

Bug: 38123054
Test: manual
Change-Id: Ic97a964ca2a25a84c6abcf41acb0f3fb583488a2
(cherry picked from commit 45aebe75f75c1f93c396118bc39748fc0f4054c7)

7 years agoFix crash on GATT service unregistration
Jakub Pawlowski [Mon, 15 May 2017 07:58:07 +0000 (00:58 -0700)]
Fix crash on GATT service unregistration

When SDP_MAX_RECORDS were reached in SDP db, which usually happen by
registering big number of GATT services, unregistration of a service was
causing a crash. This was because we moved from memory after the array
into last element.

Bug: 38265174
Test: manual
Change-Id: I7b0235213fb07c85dcc1245f1c840b41267521d5
(cherry picked from commit 0d892120359af4cd1af7f9c13897c1002eac59f3)

7 years agoDon't ignore the A2DP Sink preferred SBC codec config
Pavlin Radoslavov [Fri, 12 May 2017 10:02:08 +0000 (03:02 -0700)]
Don't ignore the A2DP Sink preferred SBC codec config

If the A2DP Sink device sends "Set Configuration" with its preferred
SBC configuration, try using that configuration when selecting
the codec parameters instead of the A2DP Sink SBC capability.

Test: A2DP streaming, PTS AVDTP Tests: TC_ACP_SRC_SIG_SMG_BV_18_C,
      TC_ACP_SRC_SIG_SMG_BV_20_C, TC_ACP_SRC_SIG_SMG_BV_22_C
      PTS A2DP Tests: A2DP/SRC/SET/BV-04-I, A2DP/SRC/SET/BV-06-I
Bug: 37723311
Bug: 35664023
Change-Id: I48e2aa664b899c1cda5df4d1f86f9cfa3a9a67f6
(cherry picked from commit d62e522131e8646830f846fdcb292870d7fb9d7b)

7 years agoSet the RTP Header Marker bit selectively per A2DP codec
Pavlin Radoslavov [Fri, 12 May 2017 08:16:10 +0000 (01:16 -0700)]
Set the RTP Header Marker bit selectively per A2DP codec

Add a mechanism to set the RTP Header Marker bit per codec.
Currently, the Marker bit is set only for AAC.

Test: A2DP streaming, PTS AVDTP tests: TC_ACP_SRC_TRA_BTR_BV_01_C,
      TC_INT_SRC_SIG_SMG_BV_17_C, TC_INT_SRC_TRA_BTR_BV_01_C
Bug: 37723283
Change-Id: I9b8e77d44c750746c169df9628d5539ad2406b92
(cherry picked from commit 3b8391cd47dd0ea3e399f99a888f029de8c7d8c8)

7 years agoMerge changes I1620be68,Ide2c2110 into oc-dev
TreeHugger Robot [Fri, 12 May 2017 20:03:14 +0000 (20:03 +0000)]
Merge changes I1620be68,Ide2c2110 into oc-dev

* changes:
  Improve GATT Server database handling.
  GATT Server: check UUID

7 years agoMerge "Disable output_sample.pcm" into oc-dev
TreeHugger Robot [Fri, 12 May 2017 18:50:35 +0000 (18:50 +0000)]
Merge "Disable output_sample.pcm" into oc-dev

7 years agoImprove GATT Server database handling.
Jakub Pawlowski [Tue, 9 May 2017 12:02:38 +0000 (05:02 -0700)]
Improve GATT Server database handling.

- use references instead of pointers where possible. Thanks to it we can
  remove some reduntant null checks and simplify the code.
- use directly allocated memory instead of own buffers. Thanks to it the
  stack uses around 12kb less of memory after startup.
- use list and vector from std library, instead of some hand-written
  implementations.

This patch is a prerequisite for further server refactoring, that will
further reduce the space used, make unit-testing possible, and enable
proper handling of PTS GATT tests.

Test: sl4a GattReadTest
Bug: 38225928
Change-Id: I1620be682259ccb8f0c02754806e355e3f1ad0c1
(cherry picked from commit 6395f1547ed6179dcdeed392bd9909d18772fb25)

7 years agoGATT Server: check UUID
Jakub Pawlowski [Wed, 10 May 2017 11:39:26 +0000 (04:39 -0700)]
GATT Server: check UUID

Characteristic and descriptor can't use UUID equal to GATT Attribute
Types. Using such UUID would result in invalid GATT database, and
crashes during service discovery.

Test: manual
Bug: 38134693
Change-Id: Ide2c21109f885cbc79287452b1dabd3f532de385
(cherry picked from commit 671ad6679ce4b8edcdb7eaaee96bc5c66b557441)

7 years agoDisable output_sample.pcm
Joseph Pirozzo [Thu, 11 May 2017 16:36:47 +0000 (09:36 -0700)]
Disable output_sample.pcm

Update include files to include bt_target.h as it has the necessary
defines to correctly allow bdroid_buildcfg.h to enable and disable
dumping to output_sample.pcm.

Bug: 38180732
Test: Stream Bluetooth audio to device and observe that
output_sample.pcm does not get written or appended to.

Change-Id: Ia7926f93a47489686d315e3c9abd1618cb8adda3

7 years agoDO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation am...
Jacky Cheung [Thu, 11 May 2017 23:24:02 +0000 (23:24 +0000)]
DO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation am: 0ce25115e9  -s ours
am: 6ba79a8618  -s ours

Change-Id: Ibc77d01e1b480d60b04da5355242ba4071a9b064

7 years agoDO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation
Jacky Cheung [Thu, 11 May 2017 23:19:01 +0000 (23:19 +0000)]
DO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation
am: 0ce25115e9  -s ours

Change-Id: I105198593ba9994002205567038778162dc9e6d0

7 years agoDO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation
Jacky Cheung [Wed, 10 May 2017 21:23:06 +0000 (14:23 -0700)]
DO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation

At the time of connection, the idle timeout could have been set to a fixed
value, which is likely to be related to the completion of service discovery
after bonding.  A check on ACL link allows the idle timeout to be reset to no
timeout, which would eliminate local host disconnections observed due to
idle timeouts.

Bug: 37352720
Test: manual
Change-Id: Ie0b24b83020d502cf7c55421a27659215253b4d2

7 years agoMerge "btif: GetItemAttributes can return no attributes" into oc-dev
TreeHugger Robot [Thu, 11 May 2017 01:03:30 +0000 (01:03 +0000)]
Merge "btif: GetItemAttributes can return no attributes" into oc-dev

7 years agoReject LE COC if cid is duplicated
Jaganath Kanakkassery [Tue, 2 May 2017 10:54:16 +0000 (16:24 +0530)]
Reject LE COC if cid is duplicated

This is for PTS test TP/LE/CFC/BV-20-C.

The scenario is there is already one COC between DUT and PTS.
Then PTS tries to establish one more COC with same cid which
should be rejected.

Test: PTS test TP/LE/CFC/BV-20-C done by Intel (originator
of this change).

Change-Id: I094a4058ac0e7bb9d7344e66d9feafee17bc3d53
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
(cherry picked from commit a252e78152f27ed07285ecf187ace83a12bca06b)

7 years agoFix broken linux build
Jack He [Thu, 4 May 2017 20:27:25 +0000 (13:27 -0700)]
Fix broken linux build

* Generic linux does not have property_get_int32. Instead,
  osi_property_get_int32() is created to handle OS_GENERIC cases
* Some linux header have sigevent.sigev_notify_attributes typed as
  (pthread_attr_t *) whereas others typed it as (void *), as any pointer
  can be implicitly casted to (void *), the current casting to (void *)
  is unncessary and will break build on systems using (pthread_attr_t *)

Test: make, unit test, no user visible effect
Change-Id: I24b33da453dc9d40656168a3bcd900d9c99219ce
(cherry picked from commit 2b59c4a0843c9f2782cf4163f921eddb31dd6ff9)

7 years agobtif: GetItemAttributes can return no attributes
Marie Janssen [Fri, 14 Apr 2017 21:07:19 +0000 (14:07 -0700)]
btif: GetItemAttributes can return no attributes

If there are no attributes available, it's possible to return zero
attributes from a GetItemAttributes request.

This is triggered by some carkits who are unhappy when they only get
titles back (the only required item) and ask for the rest of the
attributes (which we don't have).

Test: connect to honda carkit and get snoop logs to confirm
Bug: 36055995
Bug: 35956792
Change-Id: I5a31e206565d212e456111d8c6b542c7a1569e5a
(cherry picked from commit 840f4f3de98c7d6c83abae89f0b41990bc56fef4)

7 years agoRemove include for log/log.h in l2c_main.cc
Jack He [Wed, 10 May 2017 19:05:25 +0000 (12:05 -0700)]
Remove include for log/log.h in l2c_main.cc

* log/log.h is not supported by linux build and is handled by
  osi/include/log.h
* Thus, it shouldn't be included in l2c_main.cc, which breaks the linux
  build

Test: make on both linux and Android, no functional effect
Change-Id: I0c974b754b43d7b73adea2a91078b85e22b3b14e

7 years agoLE advertise data parsing refactor
Jakub Pawlowski [Fri, 28 Apr 2017 21:59:46 +0000 (14:59 -0700)]
LE advertise data parsing refactor

* merge BTM_CheckAdvData and BTM_CheckEirData into GetFieldByType
* check wether AD data is properly formatted when the packet is
  received. Some controllers were returning malformed data that
  resulted in stack crashes for BT5 packets.
* add tests to verify the helpers work as expected

Test: added net_test_stack_ad_parser
Bug: 37671082
Change-Id: I49e43d7cf7d0a8ace1ee45d9b14b2b8440096b05
(cherry picked from commit 103b2c44d3db6172a2dc9319e215eeece504316e)

7 years agoCheck device name length
Jakub Pawlowski [Fri, 28 Apr 2017 12:15:16 +0000 (05:15 -0700)]
Check device name length

BT spec limits the length of device name to 248 bytes. With the new
LE advertising packets, that can go up to 1650 bytes long, we must check
the length of device name received.

Bug: 37671082
Test: manual
Change-Id: Iad309d638003c2391014c9764605d84ed5717cb1
(cherry picked from commit 3a4e7622ff07772a512052c23cada59f5830941f)

7 years agoMerge "Revert "Revert "Make Bluetooth audio threads use RT scheduling""" into oc-dev
TreeHugger Robot [Fri, 5 May 2017 22:17:39 +0000 (22:17 +0000)]
Merge "Revert "Revert "Make Bluetooth audio threads use RT scheduling""" into oc-dev

7 years agoMove hci_thread to a message loop and prevent thread from spinning
Ajay Panicker [Fri, 28 Apr 2017 22:26:38 +0000 (15:26 -0700)]
Move hci_thread to a message loop and prevent thread from spinning

Before this patch, if there was a message on the command queue and
there were no command credits, the thread reactor would spin trying
to process the message on the command queue and would continue until
a credit was received. This led to a bug where upon switching users,
hci_thread would spin and try to use 100% of the CPU. This is fixed
by moving over to a message loop and queue system. The message loop
processes all the messages. If there aren't enough command credits,
command messages are deferred to the command queue and popped off
whenever more credits are aquired. The deferred queue has priority
to credits over recently posted messages.

Bug: 37733903
Test: Swap users with the real time scheduling patch applied, and
      general Bluetooth usage.
      TestTracker: 86249
Change-Id: Ib775e47f6d4810d3d7d8af5b3ba84adc4ada3da5

7 years agoDO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links. am: 7d3de37da0 ...
Sridhar Vashist [Fri, 5 May 2017 01:21:52 +0000 (01:21 +0000)]
DO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links. am: 7d3de37da0  -s ours
am: 6c0de854a3  -s ours

Change-Id: I1461d75a0cdf2fb5a209b094df02830092c05141

7 years agoDO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links.
Sridhar Vashist [Fri, 5 May 2017 01:17:20 +0000 (01:17 +0000)]
DO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links.
am: 7d3de37da0  -s ours

Change-Id: I90f535c99d45ebf0def0b2b08031a21f998c1c2e

7 years agoDO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links.
Sridhar Vashist [Fri, 28 Oct 2016 18:37:49 +0000 (13:37 -0500)]
DO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links.

3DH packets have a lower tolerance to background noise. A2DP requiring higher
bandwidth & realtime playback is especially suscepitble in this scenario.

Bug: 37515006
Test: oem manual
Change-Id: Id4d7452a86fe864eceb88a9fb16a40dc921a1e13

7 years agoMerge "Limit btsnoop file size (5/9)" into oc-dev
Ajay Panicker [Thu, 4 May 2017 22:56:16 +0000 (22:56 +0000)]
Merge "Limit btsnoop file size (5/9)" into oc-dev

7 years agoMerge "Add supervision timeout workaround for Nexus Remote" into oc-dev
Jakub Pawlowski [Thu, 4 May 2017 20:22:57 +0000 (20:22 +0000)]
Merge "Add supervision timeout workaround for Nexus Remote" into oc-dev

7 years agoAdd supervision timeout workaround for Nexus Remote
Jakub Pawlowski [Tue, 28 Mar 2017 19:58:34 +0000 (12:58 -0700)]
Add supervision timeout workaround for Nexus Remote

The Nexus Remote would report 100ms supervision timeout in its preferred
connection parameters. In some noisy environments, this might cause
connection to be dropped. As a workaround, set the timeout to 3s for the
remote.

Test: manual
Bug: 36645397
Bug: 37717216
Change-Id: I665a854e9d55067ec1aca273c31d06c6114c48be
(cherry picked from commit 9e6747537a4a2c0143c26ab31e4597a017372e5f)

7 years agoRemove 96.0 and 88.2 kHz sample rate from A2DP AAC capability
Pavlin Radoslavov [Thu, 4 May 2017 05:48:28 +0000 (22:48 -0700)]
Remove 96.0 and 88.2 kHz sample rate from A2DP AAC capability

The A2DP AAC Source capabilty should not include 96.0 and 88.2 kHz
sample rate - those were included unintentionally without being tested.

Bug: 37968743
Test: A2DP AAC streaming
Change-Id: Ia3228d4d14d3288acfda42fbaf8ab248ae530b48
(cherry picked from commit 4b93aeb450c4e42a80d8519528dc8fcfacc1d964)

7 years agoRevert "Revert "Make Bluetooth audio threads use RT scheduling""
Philip Cuadra [Wed, 3 May 2017 04:00:02 +0000 (21:00 -0700)]
Revert "Revert "Make Bluetooth audio threads use RT scheduling""

This reverts commit feb2d84f4b69392b5f37ae1ec9d53ac728514275.

Bluetooth threads that are used in audio have deadline
requirements for glitchless playback.  Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load.

Bug 37518404

Test:  play Bluetooth audio, check for RT with systrace
(cherry picked from commit 96c42e70f5c6a74a737739aa9c297cd93540f43e)

7 years agoaudio_a2dp_hw: fix fd leak on open
Andy Hung [Mon, 1 May 2017 22:04:57 +0000 (15:04 -0700)]
audio_a2dp_hw: fix fd leak on open

Open hal fds can be checked by

adb shell lsof | grep audio@2. | grep socket | wc

Test: connect and disconnect BT, check open fd.
Bug: 37726871

Change-Id: Id446c43515eceb0828cfb33807a4c0b4c6145a6d

7 years agoDo not GATT_ERROR on MTU change
Jacky Cheung [Mon, 17 Apr 2017 20:38:39 +0000 (13:38 -0700)]
Do not GATT_ERROR on MTU change

Bug: 37305498
Test: manual on MSM8909
Change-Id: I07389620efc914d0ece52262edc2c35b498d5564
(cherry picked from commit f271c9109e5608acb393c9bef0bca9d2b0177f5d)

7 years agoMerge "Move ad2p back to system." into oc-dev
TreeHugger Robot [Sat, 29 Apr 2017 21:06:54 +0000 (21:06 +0000)]
Merge "Move ad2p back to system." into oc-dev

7 years agoMerge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f...
Jacky Cheung [Sat, 29 Apr 2017 03:55:00 +0000 (03:55 +0000)]
Merge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev am: b055f8b68a  -s ours
am: f67b6bfa1b  -s ours

Change-Id: I94a81ea270037bd5fc7420a52819421125fc5b5b

7 years agoMerge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev
Jacky Cheung [Sat, 29 Apr 2017 03:52:59 +0000 (03:52 +0000)]
Merge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev
am: b055f8b68a  -s ours

Change-Id: I7b31a9bb0a09d3e7bbb2b666331f4ac47a93efff

7 years agoMerge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev
Jacky Cheung [Sat, 29 Apr 2017 03:48:18 +0000 (03:48 +0000)]
Merge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev

7 years agoDO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing
Jakub Pawlowski [Thu, 27 Apr 2017 11:52:34 +0000 (04:52 -0700)]
DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing

When a device connect to android over LE, the default policy is to keep
this connection. If any app "claims" this connnection, and then stop
using it, we'll disconnect from the device after a short timeout.

If pairing is triggered to such device, that is connected but not used
by any app, it will cause disconnect after the pairing is finished. This
is because using SMP over fixed LE L2CAP channel is conseidered as
connecting, using, and disconnecting a channel by the stack. This is
obvious logic error - using fixed channels should not require
"connecting" to them.

As a temporary workaround, do not trigger a timeout when a fixed SMP
channel is closed over LE.

For LE only devices, this means they will stay connected after the
pairing until some app starts using them or they disconnect. For dual
mode devices, Classic connection will be established and SDP will be
performed. The classic connection will be disconnected if no app will
use it, and the LE connection to the device will stay up.

Bug: 37352720
Test: manual
Change-Id: Ic9d688aacf84e0267277b12b28dfa7cc57fdcea6
(cherry picked from commit 7c8bab231328956d3b7569280cb162be4e345422)

7 years agoMove ad2p back to system.
Steven Moreland [Thu, 27 Apr 2017 21:14:35 +0000 (14:14 -0700)]
Move ad2p back to system.

Test: built to vendor
Fixes: 37681782
Change-Id: I08542090d6b371e3c6de2e65d5c68d0f14c76737

7 years agoMerge "Revert "Make Bluetooth audio threads use RT scheduling"" into oc-dev
Philip Cuadra [Fri, 28 Apr 2017 01:31:47 +0000 (01:31 +0000)]
Merge "Revert "Make Bluetooth audio threads use RT scheduling"" into oc-dev

7 years agoRevert "Make Bluetooth audio threads use RT scheduling"
Philip Cuadra [Fri, 28 Apr 2017 01:27:09 +0000 (01:27 +0000)]
Revert "Make Bluetooth audio threads use RT scheduling"

This reverts commit eaa42774f393eb3ccaee91a958e8df6a8fb09b91.

http://b/37733903
Test:  confirmed switching users does not hang.

Change-Id: Ic54e4ed2dda057e681df225a37a574c221cd8fc3

7 years agoMerge changes from topic 'bt5-cherry-pickerry-3' into oc-dev
Jakub Pawlowski [Thu, 27 Apr 2017 22:20:37 +0000 (22:20 +0000)]
Merge changes from topic 'bt5-cherry-pickerry-3' into oc-dev

* changes:
  Fix LE disconnecting right after pairing
  Handle remote not supporting LL_SLAVE_FEATURE_REQ
  Expose LE advertiser address for easier PTS tests (4/6)
  Read by UUID for PTS tests (4/5)

7 years agoLimit btsnoop file size (5/9)
Ajay Panicker [Tue, 18 Apr 2017 03:53:24 +0000 (20:53 -0700)]
Limit btsnoop file size (5/9)

Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Merged-In: Ia8741223cb31b2c20d9ef5607e9204cc3946b165
Change-Id: Ia8741223cb31b2c20d9ef5607e9204cc3946b165

7 years agoFix issue with BLE advertising not started when local privacy is not enabled
Jacky Cheung [Wed, 26 Apr 2017 17:27:41 +0000 (10:27 -0700)]
Fix issue with BLE advertising not started when local privacy is not enabled

Bug: 37282500
Test: manual
Change-Id: I44657d0b3315bc241373c8cbaf6a2b6a6e49f31d

7 years agoFix LE disconnecting right after pairing
Jakub Pawlowski [Thu, 27 Apr 2017 11:52:34 +0000 (04:52 -0700)]
Fix LE disconnecting right after pairing

When a device connect to android over LE, the default policy is to keep
this connection. If any app "claims" this connnection, and then stop
using it, we'll disconnect from the device after a short timeout.

If pairing is triggered to such device, that is connected but not used
by any app, it will cause disconnect after the pairing is finished. This
is because using SMP over fixed LE L2CAP channel is conseidered as
connecting, using, and disconnecting a channel by the stack. This is
obvious logic error - using fixed channels should not require
"connecting" to them.

As a temporary workaround, do not trigger a timeout when a fixed SMP
channel is closed over LE.

For LE only devices, this means they will stay connected after the
pairing until some app starts using them or they disconnect. For dual
mode devices, Classic connection will be established and SDP will be
performed. The classic connection will be disconnected if no app will
use it, and the LE connection to the device will stay up.

Bug: 37352720
Test: manual
Change-Id: Ic9d688aacf84e0267277b12b28dfa7cc57fdcea6
(cherry picked from commit 7c8bab231328956d3b7569280cb162be4e345422)

7 years agoHandle remote not supporting LL_SLAVE_FEATURE_REQ
Jakub Pawlowski [Mon, 24 Apr 2017 13:34:11 +0000 (06:34 -0700)]
Handle remote not supporting LL_SLAVE_FEATURE_REQ

Test: for PTS
Change-Id: I3030a068c1c4980fa7cbb23b478afbe441584869
(cherry picked from commit 341b6db90d67e76ea9262c5e9f3ba5063cb93598)

7 years agoExpose LE advertiser address for easier PTS tests (4/6)
Jakub Pawlowski [Wed, 19 Apr 2017 14:05:00 +0000 (07:05 -0700)]
Expose LE advertiser address for easier PTS tests (4/6)

This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.

Bug: 35147497
Test: manual
Change-Id: I5ad554d872f2b772f2bf91642a9648c4018d935c
(cherry picked from commit 779b4fd786c571cb8013f4d94ddacfe7116fb05f)

7 years agoRead by UUID for PTS tests (4/5)
Jakub Pawlowski [Fri, 14 Apr 2017 14:27:49 +0000 (07:27 -0700)]
Read by UUID for PTS tests (4/5)

Add a hidden api for reading characteristic by UUID for PTS.

Bug: 35150313
Test: sl4a GattReadTest.byUuid
Change-Id: I072473c5f7b761707774efd89f8a22bfdf012135
(cherry picked from commit 7dd34f52bc950bae2fb1b30b17da0ff34ee016aa)

7 years agoMake Bluetooth audio threads use RT scheduling
Philip Cuadra [Thu, 23 Mar 2017 17:10:34 +0000 (10:10 -0700)]
Make Bluetooth audio threads use RT scheduling

Bluetooth threads that are used in audio have deadline
requirements for glitchless playback.  Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load.

Bug 37518404

Test:  play Bluetooth audio, check for RT with systrace
Merged-In: I4505fbce55e5a4fe18d00dbda23646a60e482efd
Change-Id: I4505fbce55e5a4fe18d00dbda23646a60e482efd
(cherry picked from commit 96c42e70f5c6a74a737739aa9c297cd93540f43e)

7 years agoMerge "Add missing library dependency when compiling the unit tests" into oc-dev
TreeHugger Robot [Tue, 25 Apr 2017 17:39:47 +0000 (17:39 +0000)]
Merge "Add missing library dependency when compiling the unit tests" into oc-dev

7 years agoAdd missing library dependency when compiling the unit tests
Pavlin Radoslavov [Tue, 25 Apr 2017 00:37:20 +0000 (17:37 -0700)]
Add missing library dependency when compiling the unit tests

This fixes a compilation issue when compiling with ASAN enabled.

Bug: 37624756
Test: make -j 40  SANITIZE_TARGET='address coverage' tests
Change-Id: I9caa3d404e60ee105435539744ed2b8ccf353700
(cherry picked from commit 044921b223868595a6f96709020b46349b05fa45)

7 years agoAVRCP 1.6: Limit GetFolderItemResponse
Hemant Gupta [Wed, 12 Apr 2017 18:26:15 +0000 (23:56 +0530)]
AVRCP 1.6: Limit GetFolderItemResponse

Usecase:
1) Connect from AVRCP Controller supporting browsing
   having low L2CAP MTU eg 672.
2) Request for get folder items with large request items,
   response for which will exceed MTU size.

Expected Result:
As per AVRCP 1.6 Spec, section 29.20 pg 178, response should be
limited to number of completed get folder items that can fit in
single AVCTP Browsing channel MTU even if the completed items
are less than actually requested by AVRCP Controller.

Observation:
DUT responding with Internal Error.

Root Cause:
When there is no space to fill complete Get Folder Item response
within MTU size, DUT was returning error.

Fix:
Send max completed items which can fit in single MTU packet.

Test: Checked if the remote device can receive the truncated
response and get folder items succeeds when remote device
reissues get folder item request with updated start list count.

Frequency: 5/5

Bug: 37304477
Change-Id: I1963f97075382fc8333038e3efffaf61a9d84a28
(cherry picked from commit a7c7437bbffe133f9192b9ca82b5b4e1f6d9835a)

7 years agoAllow the Bluetooth MAC address to be updated asynchronously (3/3)
Stanley Tng [Tue, 18 Apr 2017 05:38:38 +0000 (22:38 -0700)]
Allow the Bluetooth MAC address to be updated asynchronously (3/3)

There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.

Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug: 36709382

Change-Id: I7b1c526ee227897c003ac921078f317f96b92604
(cherry picked from commit 7dc0525365025e17e289869288b1b7d5146306cc)

7 years agoMerge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f...
Zach Johnson [Fri, 21 Apr 2017 21:07:06 +0000 (21:07 +0000)]
Merge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev am: b53535d61b  -s ours
am: 1238329f28  -s ours

Change-Id: I5995614654f92977a6118ea365f1575e97acfbc1

7 years agoDO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy am: c61ef79a79 -s...
Zach Johnson [Fri, 21 Apr 2017 21:06:23 +0000 (21:06 +0000)]
DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy am: c61ef79a79  -s ours
am: 31dfa53ba0  -s ours

Change-Id: Ic94d0bb3152b25c3d4c4b4d033c9a80a358727f3

7 years agoMerge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev
Zach Johnson [Fri, 21 Apr 2017 21:04:06 +0000 (21:04 +0000)]
Merge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev
am: b53535d61b  -s ours

Change-Id: I2399d1832fe643ef0057c2c4d0b0fa4bf860e760

7 years agoDO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy
Zach Johnson [Fri, 21 Apr 2017 21:03:23 +0000 (21:03 +0000)]
DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy
am: c61ef79a79  -s ours

Change-Id: I9704dd064ab5f37ca0ecb310be1cf73826737665

7 years agoMerge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev
Zach Johnson [Fri, 21 Apr 2017 20:58:11 +0000 (20:58 +0000)]
Merge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev

7 years agoDO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy
Zach Johnson [Wed, 19 Apr 2017 04:03:07 +0000 (21:03 -0700)]
DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy

Needed for devices that support both HFP AG and HFP HF.

btsnoop logs show the sequence of events leading to failure:
(corroborated by bt logcat)

1. ACL connection with remote phone established on handle 0x01
2. ACL connection with remote headset established on handle 0x02
3. Incoming call in HF role from phone
4. Phone call locally published to telecom
5. Answer incoming call
6. SCO connection established with phone in HF role
7. AG role with headset picks up on call state change to answered
   via BTA_AG_IN_CALL_CONN_RES
8. Inside handler for BTA_AG_IN_CALL_CONN_RES, bta_ag_sco_open called
   to establish the SCO connection in the AG role with the headset,
   stomping on the previous (wanted) SCO connection with the phone.

Fix is to publish the SCO audio route policy to fluoride, so we can
stop 8 from happening.

Bug: 32958838
Test: manual:
      received incoming call in HF role, audio worked both ways;
      recieved incoming MT call, headset audio in AG role worked both ways
Change-Id: I12961598e8200bd1d5adb46ee8ec3a802114b80a

7 years agoMerge "AVRC: Configure absolute volume to false if remove device not support it"...
TreeHugger Robot [Thu, 20 Apr 2017 01:47:33 +0000 (01:47 +0000)]
Merge "AVRC: Configure absolute volume to false if remove device not support it" into oc-dev

7 years agoMerge "Add default AVRCP version to prevent confusing log message" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 00:07:09 +0000 (00:07 +0000)]
Merge "Add default AVRCP version to prevent confusing log message" into oc-dev

7 years agoAVRC: Configure absolute volume to false if remove device not support it
Tsuyoshi Kamata [Tue, 7 Mar 2017 06:46:34 +0000 (15:46 +0900)]
AVRC: Configure absolute volume to false if remove device not support it

Some AVRCP(ver>1.4) devices don't support absolute volume, when connected
to such device, volume control doesn't work properly on phone.

This patch fix the problem as bellow:
 - check category of remote device
     when add absolute volume feature flag.
 - remove absolute volume feature flag
     if remote device responses REJECT or NOT_IMPLEMENT.

Bug: 33441894
Test: manual
Change-Id: Icfd6f61699490efd937fa6d2383f333eb0f0144a
(cherry picked from commit a4fcd238aedee87384fa164e9465302aa4b69035)

7 years agoMerge "test_vendor: Remove unused libbt-vendor files" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 22:40:13 +0000 (22:40 +0000)]
Merge "test_vendor: Remove unused libbt-vendor files" into oc-dev

7 years agoAdd default AVRCP version to prevent confusing log message
Ajay Panicker [Fri, 31 Mar 2017 16:53:12 +0000 (09:53 -0700)]
Add default AVRCP version to prevent confusing log message

Bug: 37509042
Test: Log message shows more info
Change-Id: Ic042d1cf1489e391fe6e9cc3d6239acb79917b01

7 years agoDo not GATT_ERROR on MTU change am: a365626943
Jacky Cheung [Wed, 19 Apr 2017 21:40:33 +0000 (21:40 +0000)]
Do not GATT_ERROR on MTU change am: a365626943
am: f21c3dede7  -s ours

Change-Id: I34f636613c211a859da4e2a095e02ca801944b61

7 years agoDo not GATT_ERROR on MTU change
Jacky Cheung [Wed, 19 Apr 2017 21:35:03 +0000 (21:35 +0000)]
Do not GATT_ERROR on MTU change
am: a365626943

Change-Id: I956c4ca2e31d5c98e986738be0890c17e21b1186

7 years agoAVRCP TG: Get Item Attribute command not working
Hemant Gupta [Thu, 13 Apr 2017 14:34:36 +0000 (20:04 +0530)]
AVRCP TG: Get Item Attribute command not working

Usecase:
1) Connect from carkit supporting AVRCP 1.4/1.5 CT to DUT
2) Issue get item attribute command with valid attribute list.

Expected behaviour:
Get item attribute command succeeds and returns the requested
attributes of particular item

Observed result:
Get Item attribute command fails with BAD Param Error

Root Cause:
Wrong structure from tAVRC_COMMAND was being passed to fill_attribute_id_array
which was leading to error being returned.

Fix:
Use get_attrs of type tAVRC_GET_ATTRS_CMD instead of get_elem_attrs of type
tAVRC_GET_ELEM_ATTRS_CMD when remote device requests for get item attributes.

Test: Checked that now bad param error is not returned in response for
get item attribute command from remote device.

Bug: 37302234
Bug: 36055995
Change-Id: I9245f726f37ffd666d143d2232dac868a2cc3268
(cherry picked from commit 6510a471696f24a051b79ca9fd7a210bf7e293bc)

7 years agotest_vendor: Remove unused libbt-vendor files
Myles Watson [Mon, 17 Apr 2017 20:43:05 +0000 (13:43 -0700)]
test_vendor: Remove unused libbt-vendor files

Bug: 36810308
Test: builds
Change-Id: I50b4a3efaac622959dbf25c0f854d455057e6f3e
(cherry picked from commit 10b43d2fa0f408dbe465febb27aace0e111b01ff)

7 years agoRemove libbt-vendor from system/bt/main/Android.bp
Myles Watson [Tue, 7 Mar 2017 12:57:03 +0000 (04:57 -0800)]
Remove libbt-vendor from system/bt/main/Android.bp

Platforms that need libbt-vendor, which is deprecated, should include the
build dependency in device.mk.

Bug: 36810308
Test: Angler Bluetooth starts/stops
Change-Id: I0e37bf48536ca134493aaa3a496bafb3b80cd882

7 years agoPrint the LDAC adaptive bit rate adjustments
Pavlin Radoslavov [Wed, 19 Apr 2017 17:50:16 +0000 (10:50 -0700)]
Print the LDAC adaptive bit rate adjustments

A2DP LDAC State:
  ...
  LDAC quality mode                                       : ABR
  LDAC transmission bitrate (Kbps)                        : 990
  LDAC saved transmit queue length                        : 0
  LDAC adaptive bit rate encode quality mode index        : 0
  LDAC adaptive bit rate adjustments                      : 4

Test: A2DP streaming to headsets that support LDAC
Bug: 37287785
Change-Id: Ife8017ca129fa9b06ea85f6029c553a52a306cc2
(cherry picked from commit a825f565504fa17d5458c57092f4c0ec0e539128)

7 years agoFix/update the computation of the total dropped packets for LDAC and AAC
Pavlin Radoslavov [Wed, 19 Apr 2017 03:05:39 +0000 (20:05 -0700)]
Fix/update the computation of the total dropped packets for LDAC and AAC

Also:
 * Print the "LDAC transmission bitrate (Kbps)"
 * Print the "LDAC adaptive bit rate encode quality mode index"
   when the LDAC quality mode is ABR

A2DP LDAC State:
  ...
  LDAC quality mode                                       : ABR
  LDAC transmission bitrate (Kbps)                        : 990
  LDAC saved transmit queue length                        : 0
  LDAC adaptive bit rate encode quality mode index        : 0

Test: A2DP streaming to headsets that support LDAC
Bug: 37287785
Change-Id: I83b22090b087eb8a1e49d1853468b7dbbf9d9ad3
(cherry picked from commit 648ea508c95ade2d8cb8b2928c70ae123fab8334)

7 years agostack: AVRCP: add missing debug arguments
Hemant Gupta [Fri, 14 Apr 2017 06:37:37 +0000 (12:07 +0530)]
stack: AVRCP: add missing debug arguments

Fixes a crash while sending AVRCP Get Item Attribute response due to missing
function arguments.

Test: test with BMW kit, Crysler kit which trigger this bug

Bug: 37334553
Fixes: 37474772
Change-Id: Ie129e22e427896028a50e6b0ae8c2cdd151b0ea1
(cherry picked from commit 2dc048b0ed2684d8e538f0eaf67cd2b7ea79ce96)

7 years agoMerge "AVRCP CT: Only call handle_rc_features if target registered" into oc-dev
TreeHugger Robot [Tue, 18 Apr 2017 13:42:18 +0000 (13:42 +0000)]
Merge "AVRCP CT: Only call handle_rc_features if target registered" into oc-dev

7 years agoAdd missing NULL pointer assignment after fixed_queue_free and alarm_free
Pavlin Radoslavov [Fri, 14 Apr 2017 10:45:18 +0000 (03:45 -0700)]
Add missing NULL pointer assignment after fixed_queue_free and alarm_free

Bug: 37285767
Test: Code compilation
Change-Id: I53f759ea477079b0b6aed4bcbeefb645886263d6
(cherry picked from commit 86ae6c0200347fb5734491555be4a4d59eaabfea)

7 years agoAVRCP CT: Only call handle_rc_features if target registered
Bailey Forrest [Fri, 31 Mar 2017 04:43:28 +0000 (21:43 -0700)]
AVRCP CT: Only call handle_rc_features if target registered

If target is not registered, handle_rc_features would clear feature
flags before handle_rc_ctrl_features can use them.

Bug: b/35807779
Test: AVRCP controller track info works on iOS.
Change-Id: Iee781f2fc926a053ba9cf30089d3a49e56b94539
(cherry picked from commit 7745e29576703a84f4a6b47f13b3cec068033e28)

7 years agoBTA HF_CLIENT: Always reply to +BCS
Sanket Agarwal [Wed, 22 Feb 2017 19:55:34 +0000 (11:55 -0800)]
BTA HF_CLIENT: Always reply to +BCS

Phones don't like when we don't reply to +BCS codec-negotiation. We were
having this behavior because not always do we want to accept a
connection request over SCO. Instead of not replying to +BCS (which is
essentially a codec negotiation) we rather refuse the SCO request when
it comes in. This creates other issues such as some phones trying to
connect SCO in an infinite loop but it still keeps interoperability with
other devices such as iPhones and Microsoft phones intact

Bug: b/35469963
Bug: b/35431871
Bug: b/35419773

Test: SCO (Phone Audio) test with iPhone, Microsoft and Nexus phones

Change-Id: I5319edcb4da9d66c6d6b3a49742248c90dee98e6
(cherry picked from commit ad372cfa3376f882046284a5655ed9c6fdf24daf)

7 years agoDo not GATT_ERROR on MTU change
Jacky Cheung [Fri, 14 Apr 2017 20:49:23 +0000 (13:49 -0700)]
Do not GATT_ERROR on MTU change

Bug: 37305498
Test: manual on MSM8909
Change-Id: Iabec87375da1e8cd05356a7be490a66205d24e78

7 years agoFix a race condition during HCI module shutdown
Pavlin Radoslavov [Thu, 13 Apr 2017 21:33:30 +0000 (14:33 -0700)]
Fix a race condition during HCI module shutdown

If an HCI event (e.g., incoming event) happens during
HCI module shutdown, and the processing of that event
calls update_command_response_timer() right after
"alarm_free(command_response_timer)" in the beginning
of hci_module_shut_down(), then update_command_response_timer()
will try to schedule an alarm on command_response_timer that is NULL.

Test: Enable/disable Bluetooth, added unit tests
Bug: 37241256
Change-Id: I7fd58446caedc135e906953644201f88b5df32bb
(cherry picked from commit a3292051d9c088769b0f4e46ffaf7c66b1127194)

7 years agoDo not remove device security record on LMP timeout
Andre Eisenbach [Thu, 13 Apr 2017 21:49:36 +0000 (14:49 -0700)]
Do not remove device security record on LMP timeout

If an LMP timeout is encountered in the middle of authentication, the
link key is removed from the controller (but not from NVRAM). This can
result in a follow up connction triggering a LINK_KEY_MISSING reply,
which in turn can cause a remote device to initiate pairing which will
then finally remove the link key stored in NVRAM as well.

This change prevents the link key from being removed from the Bluetooth
controller in case of a timeout during link authentication.

Bug: 36798442
Test: manual
Change-Id: Ic89a16b45756e3d40b2e374c645c8f245f6ce3fc
(cherry picked from commit 1f5ec7304fc4e297f9f9868b5bd9382c2a26c8cc)

7 years agoMerge "Move audio.a2dp.default to vendor" into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 02:45:48 +0000 (02:45 +0000)]
Merge "Move audio.a2dp.default to vendor" into oc-dev

7 years agoMerge "HFP: Disable BTRH feature" into oc-dev
TreeHugger Robot [Thu, 13 Apr 2017 20:05:37 +0000 (20:05 +0000)]
Merge "HFP: Disable BTRH feature" into oc-dev

7 years agoMove audio.a2dp.default to vendor
Po-Chien Hsueh [Tue, 7 Mar 2017 02:27:21 +0000 (10:27 +0800)]
Move audio.a2dp.default to vendor

Default HAL should go to /vendor/.

Bug: 35907904
Bug: 35979581
Test: Compiled and checked install path. Verified on Sailfish with
$ lsof | grep default. MP3 playback over my BT headset.

Change-Id: I93a341cc96b8d991dea52070f633566bf71f0dc0

7 years agoHFP: Disable BTRH feature
Yoshiharu Kurita [Wed, 25 Nov 2015 09:00:30 +0000 (18:00 +0900)]
HFP: Disable BTRH feature

Fluoride does not notify application layer upon AT+BTRH, and always
sends error response (BTRH is not supported) to remote device.
That is, Fluoride does not support BTRH feature.
But BTRH is enabled by default, so OK is sent to remote device by mistake
before the error response is sent. This makes some carkits unstable.

Bug: 29587048
Test: make, PTS test

Change-Id: If1aa32291491982851ecd480c4ba8390f39a27a2
Merged-In: If1aa32291491982851ecd480c4ba8390f39a27a2
(cherry picked from commit a25ef0b60b4ca10385dac02334dc3e4e2ad23edb)

7 years agoAdd support for inband ringing feature
Jack He [Fri, 3 Feb 2017 01:42:40 +0000 (17:42 -0800)]
Add support for inband ringing feature

* Change HFP init API so that the HFP feature bit field depends on
  whether in-band ringing is supported on the device
* Feature disabled by default unless system property enables it

Bug: 19171297
Test: mm -j 40, HFP regression test, testplans/82144
Change-Id: Ib8ba28ac6e70eb23b2a2ad11c5805793911a4e43
(cherry picked from commit 7a9892c63bad8f8d93681fb74d5532a79387b60e)

7 years agoReduce the audio A2DP HAL output audio stream buffer size
Pavlin Radoslavov [Wed, 5 Apr 2017 23:38:42 +0000 (16:38 -0700)]
Reduce the audio A2DP HAL output audio stream buffer size

Reduce the audio A2DP HAL output audio stream buffer size
(per constant AUDIO_STREAM_OUTPUT_BUFFER_PERIODS) from 4 to 2.
After the change, the output buffer size is double the buffer period.

Bug: 35849921
Test: A2DP streaming with various codec settings. Testplans/83305.
Change-Id: I2a15d468e748a03b481bf2117903ab06cddd02a3
(cherry picked from commit 5e9f56940e1865d16892639e4c9144a65547626e)

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:49:06 +0000 (22:49 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5 am: 005eb1d305 am: 7752061901 am: 0ddb124e6e am: 2feb43b5b1 am: 72270d976b
am: e0702cd5b8  -s ours

Change-Id: I3157998e2357ece35235b6636d9ab45bcc60ef60

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:38:39 +0000 (22:38 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5 am: 005eb1d305 am: 7752061901 am: 0ddb124e6e am: 2feb43b5b1
am: 72270d976b

Change-Id: I6dbf93e14a6c31092d2ecce2738b7680b738220c

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:33:09 +0000 (22:33 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5 am: 005eb1d305 am: 7752061901 am: 0ddb124e6e
am: 2feb43b5b1

Change-Id: I3d16a2939976a326ca20056b29818e2df550ee67

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:28:08 +0000 (22:28 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5 am: 005eb1d305 am: 7752061901
am: 0ddb124e6e

Change-Id: I61b9f5741d5fd6035fb7d472b83dc9df54eb3483

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:23:08 +0000 (22:23 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5 am: 005eb1d305
am: 7752061901

Change-Id: I1f821df2a72958ed17ce5bf8baed431a52dfb087

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:18:07 +0000 (22:18 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5
am: 005eb1d305

Change-Id: Ic4f826e4f963f969c360fe39c6e720c3fb013d23

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:13:06 +0000 (22:13 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf
am: 585e0c08f5

Change-Id: If70a5f9b56845e758c2a2a3150936a72cac9f438

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6
Jack He [Tue, 11 Apr 2017 22:08:06 +0000 (22:08 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6
am: e6620d18cf

Change-Id: I412c0dd7854d7f6157e1974e285078909543bb41

7 years agoCheck LE advertising data length before caching advertising records
Jack He [Tue, 11 Apr 2017 22:03:05 +0000 (22:03 +0000)]
Check LE advertising data length before caching advertising records
am: 1bef3546a6

Change-Id: Ibbf6183833d7f00937742fa337a04569c4ef3c2f

7 years agoCheck LE advertising data length before caching advertising records
Jack He [Thu, 6 Apr 2017 00:59:58 +0000 (17:59 -0700)]
Check LE advertising data length before caching advertising records

Bug: 33899337
Test: make, receive LE advertising
Change-Id: I06b249ac5cabdef64528deda07b8bae749e1d2fd
(cherry picked from commit d57adbc350fdee4f27b82c9e39a14bd745d92320)

7 years agoBuild fix for BLE_PRIVACY_SPT == FALSE
Jakub Pawlowski [Mon, 10 Apr 2017 20:00:27 +0000 (13:00 -0700)]
Build fix for BLE_PRIVACY_SPT == FALSE

Bug: 30622771
Test: manual
Change-Id: I9a418b8c0477ac50ec2a81e318895c2788e5ceec
(cherry picked from commit b0aca861fee4f0fbab809b5a1ef75c31d10055bd)

7 years agoAdvertising manager improvements
Jakub Pawlowski [Tue, 4 Apr 2017 11:08:19 +0000 (04:08 -0700)]
Advertising manager improvements

* Keep track wether advertiser is enabled.
* Make sure that random address for connectable advertisers is updated
  when advertising is disabled, as per ESR11-E7716.
* Make sure that the local variable holding the address is properly
  updated after the address is pushed to the controller.
* Use "LE Remove Advertising Set" command to free advertiser after use.

Bug: 35935853
Bug: 30622771
Test: manual
Change-Id: I1415f7272dd99e5e81ce1e2b7ef2bf98f7229cf9
(cherry picked from commit 1f62c122e908573497a8c69ccd7bd829ce02a0b9)