OSDN Git Service

android-x86/system-bt.git
5 years agoHFP: Send caller ID in +CLIP command (3/4)
Benson Li [Tue, 17 Jul 2018 10:05:16 +0000 (18:05 +0800)]
HFP: Send caller ID in +CLIP command (3/4)

* Append caller display name in ag_reslut data if there is name in
  CALL_STATE_INCOMING state
* Process all clip data and store the formatted string to ag_result
  data

Bug: 111378831
Test: runtest bluetooth, runtest -x BluetoothPhoneServiceTest.java
Change-Id: Ief48ed9cb5e0b32274624a90799ab9922dbd656e

5 years agoMerge "HFP: Don't use mSBC for HF devices not supporting related feature"
Treehugger Robot [Thu, 8 Nov 2018 08:43:27 +0000 (08:43 +0000)]
Merge "HFP: Don't use mSBC for HF devices not supporting related feature"

5 years agoFix Spurious Hearing Aid Start and Stop Cmds
Stanley Tng [Sun, 14 Oct 2018 04:17:00 +0000 (21:17 -0700)]
Fix Spurious Hearing Aid Start and Stop Cmds

Prevent the spurious Start and Stop Commands that are send to the
Hearing Aids when there is audio suspend and resume, and also connection
and disconnections.
Also, make sure that the callback for the Audio Suspend and Resume are
done in the main thread; previously, it was running in the wrong socket
thread.
Lastly, make sure that the Connection Update callback are processed
correctly; previously, we are not checking that the right connection
interval are set and taking the callbacks done by service discovery.

Test: Manual testing with Hearing Aids
Bug: 117619792
Change-Id: I33a175947b0118f0234ec6338c20ac6e7963a598
Merged-In: I33a175947b0118f0234ec6338c20ac6e7963a598
(cherry picked from commit cac96c646fac463a9c894ad702bd4428863c9400)

5 years agoCleanup LE White List HCI interface
Jakub Pawlowski [Tue, 30 Oct 2018 21:49:30 +0000 (22:49 +0100)]
Cleanup LE White List HCI interface

Replace global functions with callbacks, to reduce interface size.

Test: add/remove at least two devices in whitelist, verify HCI snoop log
Bug: 112827989
Change-Id: Id05c9f4970bbb795309a3a233f83559bcc1c56e2

5 years agoMerge "HFP: support pause character "Comma" in acceptable dial digit string"
Treehugger Robot [Thu, 1 Nov 2018 06:07:45 +0000 (06:07 +0000)]
Merge "HFP: support pause character "Comma" in acceptable dial digit string"

5 years agoHFP: Don't use mSBC for HF devices not supporting related feature
weichinweng [Wed, 17 Oct 2018 07:28:56 +0000 (15:28 +0800)]
HFP: Don't use mSBC for HF devices not supporting related feature

* Some misbehaving HF devices indicate their support some mSBC related
feature but some feature is not support. It will cause some unexpected
behavior.
* This CL adds a workround for checking if HF device indicate which one
is not support on Transparent Synchronous Data, WBS and Codec
Negotiation, Fluoride will assume CVSD codec by default.

Bug: 116082185
Test: make, connect SCO and check voice on carkit and headset.
Change-Id: Ic2209e514999958061bc7db7ab18d6e5b3976758

5 years agoHCI: accept OnceCallback instad of Callback
Jakub Pawlowski [Tue, 30 Oct 2018 17:29:36 +0000 (18:29 +0100)]
HCI: accept OnceCallback instad of Callback

Command complete is guaranteed to happen only once by HCI spec.

Test: run sl4a tests around advertising, which use callback
Change-Id: I3c40ed21c56b41649bbc9519d280339b1cbb285f

5 years agoMerge changes Ie4f783b0,I456a18c6,I8c57dd5a
Treehugger Robot [Tue, 30 Oct 2018 06:41:08 +0000 (06:41 +0000)]
Merge changes Ie4f783b0,I456a18c6,I8c57dd5a

* changes:
  Small cleanup in GATT white list
  Separate GATT white list from global GATT control block.
  Move white list specific code in GATT to separate file

5 years agoHFP: support pause character "Comma" in acceptable dial digit string
jonerlin [Tue, 30 Oct 2018 06:09:41 +0000 (14:09 +0800)]
HFP: support pause character "Comma" in acceptable dial digit string

* To avoid bt stack filter MO call initiated from HF end with by sending dial command with modifier character "," (Comma)

Bug: 118401445
Test: making MO call from carkit/equipment by sending ATD command with phone number plus comma plus DTMF digitals
Change-Id: I5acb913a3c034f10ad704c1b8466634df122b580

5 years agoMerge "Hearing Aid: Combine audio from stereo to mono when only one side connect"
Weichin Weng [Tue, 30 Oct 2018 02:08:44 +0000 (02:08 +0000)]
Merge "Hearing Aid: Combine audio from stereo to mono when only one side connect"

5 years agoSmall cleanup in GATT white list
Jakub Pawlowski [Mon, 29 Oct 2018 14:53:35 +0000 (15:53 +0100)]
Small cleanup in GATT white list

* move local helper functions into local namespace
* reduce dependency on other modules

Bug: 112827989
Test: compilation
Change-Id: Ie4f783b00b5d0b77698412e09e35a5d11ed8f5f6

5 years agoSeparate GATT white list from global GATT control block.
Jakub Pawlowski [Mon, 29 Oct 2018 10:24:32 +0000 (11:24 +0100)]
Separate GATT white list from global GATT control block.

Bug: 112827989
Test: compilation, no functional changes
Change-Id: I456a18c6ce567991c4768afaaa3266085a9d30fb

5 years agoMove white list specific code in GATT to separate file
Jakub Pawlowski [Mon, 29 Oct 2018 09:17:23 +0000 (10:17 +0100)]
Move white list specific code in GATT to separate file

Test: compilation, no functional change
Bug: 112827989
Change-Id: I8c57dd5a3b0d6c088acc1a40d9f3437428a8bd8b

5 years agoBTM_BleClearBgConnDev -> BTM_WhiteListClear
Jakub Pawlowski [Fri, 26 Oct 2018 10:31:41 +0000 (12:31 +0200)]
BTM_BleClearBgConnDev -> BTM_WhiteListClear

BTM_WhiteList* functions are called only from gatt_utils.cc.
BTM_BleClearBgConnDev is currently an exception - instead of being
called from there, it does call gatt_reset_bgdev_list. This patch fixes
that.

Test: compilation, no functional change
Bug: 112827989
Change-Id: I4cd5bfee44c46d2ef37912496cd6cf5298ab1dfc

5 years agoSplit BTM_BleUpdateBgConnDev into BTM_WhiteListAdd and BTM_WhiteListRemove
Jakub Pawlowski [Fri, 26 Oct 2018 09:29:56 +0000 (11:29 +0200)]
Split BTM_BleUpdateBgConnDev into BTM_WhiteListAdd and BTM_WhiteListRemove

There is very little common code between both codepath. Having them
separate makes the code cleaner.

Test: compilation, no functional changes.
Bug: 112827989
Change-Id: I936f69a93366d3230df4435fc4b24962cc0bd4b2

5 years agoLinux build fix
Jakub Pawlowski [Thu, 25 Oct 2018 13:12:43 +0000 (15:12 +0200)]
Linux build fix

Move metrics_linux.cc into common/, where the metrics live now.
Add btif_avrcp_audio_track_linux.cc
Fix BUILD.gn files.
Define FALLTHROUGH_INTENDED for linux, to fix build error.

Test: build with ninja and run on linux
Change-Id: I117d19ed25828389c385f09ad731e8bd61b38030

5 years agoHearing Aid: Combine audio from stereo to mono when only one side connect
weichinweng [Fri, 26 Oct 2018 09:21:13 +0000 (17:21 +0800)]
Hearing Aid: Combine audio from stereo to mono when only one side connect

* On the design of the Hearing Aids, the phone will separate the stereo
audio samples and stream the left audio samples to the left device and
right audio samples to the right device. When only one side connected,
phone will only stream the one side audio sample to one hearing aid
device.
* This CL adds a functionality for checking the left/right hearing aid
and combine audio samples from stereo to mono when only on side connect.

Bug: 117178490
Test: disconnected/reconnected one side hearing when play stereo test
sound.

Change-Id: Idb3871951617680aba3ca82f801a70c95403d889

5 years agoMinor style fixes in gatt_api.cc
Jakub Pawlowski [Thu, 25 Oct 2018 22:23:21 +0000 (00:23 +0200)]
Minor style fixes in gatt_api.cc

Test: compilation
Change-Id: I3050d84443149a5ed77ab1e07f079553546b628c

5 years agoMerge "Add siyuanh@google.com to OWNERS"
Treehugger Robot [Fri, 26 Oct 2018 01:16:15 +0000 (01:16 +0000)]
Merge "Add siyuanh@google.com to OWNERS"

5 years agoSplit gatt_update_auto_connect_dev into separate add/remove functions
Jakub Pawlowski [Thu, 25 Oct 2018 21:04:14 +0000 (23:04 +0200)]
Split gatt_update_auto_connect_dev into separate add/remove functions

Test: compilation, no functional changes
Change-Id: I58b5d565753e0c1b99a3b06b27074b593f3b903b

5 years agoMerge pie-platform-release to aosp-master - DO NOT MERGE
Bill Yi [Wed, 24 Oct 2018 21:48:45 +0000 (14:48 -0700)]
Merge pie-platform-release to aosp-master - DO NOT MERGE

Change-Id: Id9d96121fb33dba3b75b2b5364da997e30006b36

5 years agoAdd siyuanh@google.com to OWNERS
Jack He [Tue, 17 Oct 2017 17:40:38 +0000 (10:40 -0700)]
Add siyuanh@google.com to OWNERS

Test: N/A
Change-Id: I8bdb6e7be8261a25f7ff103a5043001fa7645fee

5 years agoMerge "separate btm_ble_stop_auto_conn from btm_ble_start_auto_conn"
Jakub Pawlowski [Wed, 24 Oct 2018 16:33:59 +0000 (16:33 +0000)]
Merge "separate btm_ble_stop_auto_conn from btm_ble_start_auto_conn"

5 years agoseparate btm_ble_stop_auto_conn from btm_ble_start_auto_conn
Jakub Pawlowski [Wed, 24 Oct 2018 11:22:40 +0000 (13:22 +0200)]
separate btm_ble_stop_auto_conn from btm_ble_start_auto_conn

There is no common code in those two code paths. Also, minor if/else
refactoring to simplify the code.

Test: compilation, no change in how code works.
Change-Id: I82a03a18041bb5ad396f21ed13e8047e093f2765

5 years agoservice: don't use android::String16 in platform-independent code
Jakub Pawlowski [Tue, 23 Oct 2018 19:54:53 +0000 (21:54 +0200)]
service: don't use android::String16 in platform-independent code

Test: compile on linux with ninja
Change-Id: Iac421b43a5516418a33b8c804cfca4c777363b27

5 years agoAllow implicit-fallthrough warnings locally.
Chih-Hung Hsieh [Tue, 16 Oct 2018 17:18:13 +0000 (10:18 -0700)]
Allow implicit-fallthrough warnings locally.

It will be a global error by default.
These warnings will be fixed in new refactored code.

Bug: 112564944
Bug: 116020782
Test: make checkbuild
Change-Id: I67f1170f3f7502a4243d8a5641eb471317b42cf4
Exempt-From-Owner-Approval: do not block on new warnings

5 years agoFix errors around logging when compiling on Linux
Jakub Pawlowski [Tue, 23 Oct 2018 12:46:24 +0000 (14:46 +0200)]
Fix errors around logging when compiling on Linux

* cutils/log.h -> log/log.h
* add missing #include "log/log.h"
* add android_errorWriteWithInfoLog stub

Test: compile on linux using ninja
Change-Id: I720921a2fbf86b5ce5e2a2f691f1e769c91672b6

5 years agoPartial fix for linux build
Jakub Pawlowski [Tue, 23 Oct 2018 13:57:20 +0000 (15:57 +0200)]
Partial fix for linux build

Test: build with ninja on Linux
Change-Id: Ibb5bdde117732556b5b7f0fa6fba8a57c2912782

5 years agoMerge pi-dr1-dev to aosp-master
Bill Yi [Fri, 19 Oct 2018 19:20:55 +0000 (12:20 -0700)]
Merge pi-dr1-dev to aosp-master

Change-Id: I1670051cca44a5a490b42d07ae9977b01ce093e1

5 years agoMerge "AVRCP:Update lidx when ACP handle exist in bta_av_rc_create"
wangfukai [Fri, 19 Oct 2018 06:44:53 +0000 (23:44 -0700)]
Merge "AVRCP:Update lidx when ACP handle exist in bta_av_rc_create"
am: a8f9164a7a

Change-Id: Idcf88f8245cda75a590a5877243eb46dc7af2504

5 years agoFix typo in avdt_scb_by_hdl
wangfukai [Fri, 19 Oct 2018 06:30:38 +0000 (23:30 -0700)]
Fix typo in avdt_scb_by_hdl
am: da8fdc5ad3

Change-Id: Ic9a3d2893927387011db15d1c38ee95eaf4862f8

5 years agoMerge "AVRCP:Update lidx when ACP handle exist in bta_av_rc_create"
Treehugger Robot [Fri, 19 Oct 2018 03:04:30 +0000 (03:04 +0000)]
Merge "AVRCP:Update lidx when ACP handle exist in bta_av_rc_create"

5 years agoFix typo in avdt_scb_by_hdl
wangfukai [Wed, 17 Oct 2018 06:23:12 +0000 (14:23 +0800)]
Fix typo in avdt_scb_by_hdl

Change-Id: I15ecac0232bfeb6c97f802c79bebc7aca03ab874
Signed-off-by: wangfukai <wangfukai@huawei.com>
5 years agoAVRCP:Update lidx when ACP handle exist in bta_av_rc_create
wangfukai [Mon, 15 Oct 2018 13:05:18 +0000 (21:05 +0800)]
AVRCP:Update lidx when ACP handle exist in bta_av_rc_create

Test:Pair smartphone with band and carkit, unpair band and check
Media Audio with carkit on smartphone.
Signed-off-by: wangfukai <wangfukai@huawei.com>
Change-Id: Ib913d2d52e25266e797eb896f99db593531442a7

5 years agoUprev libchrome to r576279 (1/multiple)
Jakub Pawlowski [Mon, 15 Oct 2018 09:02:11 +0000 (02:02 -0700)]
Uprev libchrome to r576279 (1/multiple)
am: 67f5f3725b

Change-Id: I54fea12bed8943b15bd4940950e5fd000bbe3963

5 years agoUprev libchrome to r576279 (1/multiple)
Jakub Pawlowski [Mon, 23 Jul 2018 17:00:25 +0000 (10:00 -0700)]
Uprev libchrome to r576279 (1/multiple)

This patch brings the latest and greatest features of libchrome to
android. It contains ~2600 patches.
Reason for uprev: libbluetooth want to use some of the most recent
features avaliable.

Test: libchrome_test
Change-Id: I5f8d5931b404767d3b86cb3bd8df2a05dd67a768
Merged-In: I5f8d5931b404767d3b86cb3bd8df2a05dd67a768

5 years agoUse proper naming for Identity Address
Jakub Pawlowski [Fri, 12 Oct 2018 19:42:41 +0000 (12:42 -0700)]
Use proper naming for Identity Address
am: 8b64778bb9

Change-Id: Ib779f549b06b39227d56d3a0e2dfb37bf76c97d7

5 years agoUse proper naming for Identity Address
Jakub Pawlowski [Fri, 12 Oct 2018 14:10:08 +0000 (16:10 +0200)]
Use proper naming for Identity Address

During Bonding, devices exchange "Identity Address Information", which
include Identity Address, and Identity Address Type.

Identity Address is either Public Address, or Static Random Address.

Thorugh stack, we improperly use "static" where we should use
"identity" to refer to this address.

Bug: 109827460
Test: compilation, just renamed variables.
Change-Id: Iccee1e8ae881e9b9f480e0bf05eea440a905109a

5 years agoMerge "Hearing Aid: Use valid COC service id"
Hansong Zhang [Fri, 12 Oct 2018 17:16:55 +0000 (10:16 -0700)]
Merge "Hearing Aid: Use valid COC service id"
am: f1db18e858

Change-Id: I1003b0240b81909eb6c7225b247d691795a28a6c

5 years agoMerge "Hearing Aid: Use valid COC service id"
Treehugger Robot [Fri, 12 Oct 2018 17:04:56 +0000 (17:04 +0000)]
Merge "Hearing Aid: Use valid COC service id"

5 years agoMerge "Add bluetooth_test_common to TEST_MAPPING"
Hansong Zhang [Fri, 12 Oct 2018 03:45:11 +0000 (20:45 -0700)]
Merge "Add bluetooth_test_common to TEST_MAPPING"
am: 6b5f3d96cc

Change-Id: Ia6f3e4f5dbc311a8dcb376c5c004a7f7a02580ba

5 years agoMerge "Add bluetooth_test_common to TEST_MAPPING"
Treehugger Robot [Fri, 12 Oct 2018 03:34:30 +0000 (03:34 +0000)]
Merge "Add bluetooth_test_common to TEST_MAPPING"

5 years agoTimer: Fix unstable test
Hansong Zhang [Fri, 12 Oct 2018 02:35:03 +0000 (19:35 -0700)]
Timer: Fix unstable test
am: 466b51280b

Change-Id: I5b9f2420b4663489f300d684529b4f91856b1f37

5 years agoTimer: Fix unstable test
Hansong Zhang [Thu, 11 Oct 2018 21:14:31 +0000 (14:14 -0700)]
Timer: Fix unstable test

* Don't use future.wait_until()
* For cancel_period_task, verify the counter won't change after
  timer is cancelled

Test: run Timer test for 5000 times
Bug: 116081383
Change-Id: Ibc99507e76180a878f417a0b4e7aba1b8adc7cb6

5 years agoHearing Aid: Use valid COC service id
Hansong Zhang [Thu, 11 Oct 2018 01:02:49 +0000 (18:02 -0700)]
Hearing Aid: Use valid COC service id

Test: disconnect hearing aid and let remote device connect to it
Bug: 116317072
Bug: 117423102
Change-Id: Iea001d287256f4d7d9e8213ac8a4f03d78f4bbc5

5 years agoMerge "Allow AVDTP SetConfig from INIT state"
Pavlin Radoslavov [Thu, 11 Oct 2018 18:48:26 +0000 (11:48 -0700)]
Merge "Allow AVDTP SetConfig from INIT state"
am: 311738f7ec

Change-Id: Ia6434fdf9225a443d978b158718477642b47f5b6

5 years agoMerge "Allow AVDTP SetConfig from INIT state"
Treehugger Robot [Thu, 11 Oct 2018 18:38:16 +0000 (18:38 +0000)]
Merge "Allow AVDTP SetConfig from INIT state"

5 years agoMerge "Add more Hearing Aid Profile logs"
Stanley Tng [Thu, 11 Oct 2018 17:33:55 +0000 (10:33 -0700)]
Merge "Add more Hearing Aid Profile logs"
am: 0f14d143df

Change-Id: I7d555fa8dafa0aed8c59c32cad98eae5adceb718

5 years agoMerge "Add more Hearing Aid Profile logs"
Treehugger Robot [Thu, 11 Oct 2018 17:14:59 +0000 (17:14 +0000)]
Merge "Add more Hearing Aid Profile logs"

5 years agoAdd more Hearing Aid Profile logs
Stanley Tng [Thu, 11 Oct 2018 01:57:29 +0000 (18:57 -0700)]
Add more Hearing Aid Profile logs

Add more logs to debug the TimeCheck timeout crash issues.

Test: Manual run
Change-Id: I3a05ca975e41ab002e466150f3f3f28ba0f037df

5 years agoAllow AVDTP SetConfig from INIT state
Pavlin Radoslavov [Tue, 25 Sep 2018 01:42:53 +0000 (18:42 -0700)]
Allow AVDTP SetConfig from INIT state

This addresses AVDTP codec reconfiguration issue on the A2DP Sink side.
Apparently, the A2DP Sink rejects AVDTP Reconfig - then, after the AVDTP Close
(normal), the Sink side doesn't accept AVDTP SetConfig anymore.
If the codecs are already known to the A2DP SRC, it doesn't need the
AVDTP Discover mechanism just for the purpose of the codec reconfiguration.
Hence, we can allow SetConfig from INIT state.

Bug: 115894702
Test: Manual with switching the AAC Sample Rate in the Develop Options
Change-Id: I3b1603dc6ef344eea50383df2eddf309dec80a28

5 years agoLE Enhanced Connection Complete: Check address types
Jakub Pawlowski [Wed, 10 Oct 2018 18:44:40 +0000 (11:44 -0700)]
LE Enhanced Connection Complete: Check address types
am: 26aee6db57

Change-Id: I396a9ebc634b66eec30310627483f25269824d79

5 years agoMerge PPR2.181005.003 from pi-release-2 into pi-platform-release.
Bill Rassieur [Wed, 10 Oct 2018 17:33:47 +0000 (17:33 +0000)]
Merge PPR2.181005.003 from pi-release-2 into pi-platform-release.

Change-Id: I880c32c18f6af7ece5e3510f72f7a25d9291716c
BUG: 117431430

5 years agoLE Enhanced Connection Complete: Check address types
Jakub Pawlowski [Tue, 14 Aug 2018 10:24:33 +0000 (12:24 +0200)]
LE Enhanced Connection Complete: Check address types

Only pass identity addresses to btm_identity_addr_to_random_pseudo.
Only pass random addresses into btm_ble_resolve_random_addr.

Test: bond twice to device using non-resolvable address
Change-Id: I5931e5bc89449ea4ae9b873aedfd7bbcdeef2e01

5 years agoMerge "Add DataElementReader for SDP"
Ajay Panicker [Tue, 9 Oct 2018 19:12:14 +0000 (12:12 -0700)]
Merge "Add DataElementReader for SDP"
am: 424e80f892

Change-Id: I625dabfb5d1c0cf18a58550b6ea35b902cf716e0

5 years agoMerge "Add DataElementReader for SDP"
Ajay Panicker [Tue, 9 Oct 2018 18:53:02 +0000 (18:53 +0000)]
Merge "Add DataElementReader for SDP"

5 years agoFix Timer unittest
Hansong Zhang [Tue, 9 Oct 2018 02:47:01 +0000 (19:47 -0700)]
Fix Timer unittest
am: 4d0a9b422d

Change-Id: I6a96c10e941e9cb8c055f6256bdd06da423176e7

5 years agoFix Timer unittest
Hansong Zhang [Sun, 7 Oct 2018 20:31:01 +0000 (13:31 -0700)]
Fix Timer unittest

* Never set promise more than once
* To verify running task cannot be cancelled, make sure Cancel() is
  called after callback starts
* Remove a stress test case. Sometimes there is unexpected event causing
  deviation.

Test: run Timer test for 5000 times
Bug: 116081383
Change-Id: If99e4958289e9b6aaabc51b15ce4ac035a3ff1e9

5 years agoMerge "Replace A2DP source osi/alarm with common/Timer"
Hansong Zhang [Mon, 8 Oct 2018 23:53:36 +0000 (16:53 -0700)]
Merge "Replace A2DP source osi/alarm with common/Timer"
am: 82c49d533a

Change-Id: I914cc4e97ba1978dfeb0af0e1e9327eb8e44bbd1

5 years agoMerge "Replace A2DP source osi/alarm with common/Timer"
Treehugger Robot [Mon, 8 Oct 2018 23:38:02 +0000 (23:38 +0000)]
Merge "Replace A2DP source osi/alarm with common/Timer"

5 years agoMerge "Move btif_state_machine to common/StateMachine"
Hansong Zhang [Mon, 8 Oct 2018 23:10:21 +0000 (16:10 -0700)]
Merge "Move btif_state_machine to common/StateMachine"
am: 062b311bc3

Change-Id: I2fd18ccf848c6c04af0520e1e57b023eec84b297

5 years agoMerge "Fix race condition around Le Start Encryption handling."
Jakub Pawlowski [Mon, 8 Oct 2018 23:09:40 +0000 (16:09 -0700)]
Merge "Fix race condition around Le Start Encryption handling."
am: f67a4f54b3

Change-Id: Ic343e34c18dd0ce8ef0fdbf8a23037e3bcb24878

5 years agoMerge "Move btif_state_machine to common/StateMachine"
Treehugger Robot [Mon, 8 Oct 2018 22:34:10 +0000 (22:34 +0000)]
Merge "Move btif_state_machine to common/StateMachine"

5 years agoMerge "Fix race condition around Le Start Encryption handling."
Treehugger Robot [Mon, 8 Oct 2018 22:17:28 +0000 (22:17 +0000)]
Merge "Fix race condition around Le Start Encryption handling."

5 years agoReplace A2DP source osi/alarm with common/Timer
Hansong Zhang [Thu, 23 Aug 2018 22:17:10 +0000 (15:17 -0700)]
Replace A2DP source osi/alarm with common/Timer

Test: A2DP stream music
Change-Id: I4f7325b3eb3be07eca6c599c7f6f5e037b8e7a64

5 years agoFix race condition around Le Start Encryption handling.
Jakub Pawlowski [Mon, 1 Oct 2018 11:25:11 +0000 (13:25 +0200)]
Fix race condition around Le Start Encryption handling.

When sending Le Start Encryption, it's possible that at the same exact
moment the connection was disconnected, and there is an incoming
"Disconnection Complete Event". The controller would send error 0x02
"unknown connection identifier" in such case. This can happen
sporadically when reconnecting device multiple times.

Currently, we don't handle this error code. This lead to the timeout
when waiting for "Encryption Complete", and unbonding of the device.

From now on, if 0x02 error code is returned, we'll cancel current SMP
operation, which is the "LE Start Encryption". This will stop the SMP
timer, and make sure the bond to remote device is not lost.

Test: Manual test reconnecting with HID device multiple time in a row,
causing the link drop right after connection, by removing battery, or
closing the shield box.
Bug: 113652889
Change-Id: I2ff9c13dbc8e7b71505908996e26b89fa1ea6a42

5 years agoAdd DataElementReader for SDP
Ajay Panicker [Fri, 14 Sep 2018 22:10:13 +0000 (15:10 -0700)]
Add DataElementReader for SDP

DataElementReader extracts DataElement's from packets which are the
basic container for all data in the SDP protocol.

Bug: 114751344
Test: run host test bluetooth_test_sdp
Change-Id: If01f22d81af1b80e7c9ac8993ee161eba779bfa3

5 years agoMerge "Stop A2DP stream when shutting down A2DP source."
weichinweng [Mon, 8 Oct 2018 11:18:40 +0000 (04:18 -0700)]
Merge "Stop A2DP stream when shutting down A2DP source."
am: 90942c06f2

Change-Id: If18e665cdda1e69aca48cd31bc1a44d5c4d3a237

5 years agoMerge "Stop A2DP stream when shutting down A2DP source."
Treehugger Robot [Mon, 8 Oct 2018 11:06:32 +0000 (11:06 +0000)]
Merge "Stop A2DP stream when shutting down A2DP source."

5 years agoAdd bluetooth_test_common to TEST_MAPPING
Hansong Zhang [Fri, 5 Oct 2018 23:21:09 +0000 (16:21 -0700)]
Add bluetooth_test_common to TEST_MAPPING

Bug: 116081383
Test: unit test
Change-Id: I8231b8f168ab1d86009b7be2cf0b6044f5c8d0cf

5 years agoMove btif_state_machine to common/StateMachine
Hansong Zhang [Thu, 4 Oct 2018 22:04:18 +0000 (15:04 -0700)]
Move btif_state_machine to common/StateMachine

In Bluetooth native infrastructure refactor plan, we need a state
machine class for entire stack

Test: manual
Change-Id: I0e6671e42570482d9a9466b117054b3aadb3e9cc

5 years agoStop A2DP stream when shutting down A2DP source.
weichinweng [Wed, 3 Oct 2018 07:08:54 +0000 (15:08 +0800)]
Stop A2DP stream when shutting down A2DP source.

When shutting down a2dp source,
A2DP source set StateShuttingDown state too fast cause the A2DP doesn’t stop stream.
Will try to stop A2DP when doing A2DP source end session.

Bug: 112279820
Test: Build Pass, BT off/on when play A2DP
Change-Id: I6bfb5c235da1ff4a7e6814bae3a98ae7dd1788aa

5 years agoMerge "MessageLoopThread: Release lock during blocked StartUp/ShutDown"
Hansong Zhang [Thu, 4 Oct 2018 06:23:11 +0000 (23:23 -0700)]
Merge "MessageLoopThread: Release lock during blocked StartUp/ShutDown"
am: 9a6d430622

Change-Id: I8edb2ee00ed78e5f27d91dc23e4cd6a8563c6bc8

5 years agoMerge "MessageLoopThread: Release lock during blocked StartUp/ShutDown"
Treehugger Robot [Thu, 4 Oct 2018 06:10:47 +0000 (06:10 +0000)]
Merge "MessageLoopThread: Release lock during blocked StartUp/ShutDown"

5 years agoMessageLoopThread: Release lock during blocked StartUp/ShutDown
Hansong Zhang [Sat, 29 Sep 2018 21:23:31 +0000 (14:23 -0700)]
MessageLoopThread: Release lock during blocked StartUp/ShutDown

During StartUp/ShutDown(), if another running task in message loop needs
api_lock, then it will deadlock. Release api_lock in StartUp and
ShutDown when current thread is blocked by another task

Bug: 116081383
Test: run unit test
Change-Id: Ic34406d0cfc6364ac965c4f1aa917a5ccaf6b373

5 years agoTimer: Set data member before scheduling task
Hansong Zhang [Wed, 3 Oct 2018 23:01:34 +0000 (16:01 -0700)]
Timer: Set data member before scheduling task
am: 1773dd8d82

Change-Id: I6c6c82ec7a58e429778116d064cc1ac4d825fd6b

5 years agoTimer: Set data member before scheduling task
Hansong Zhang [Fri, 28 Sep 2018 19:10:15 +0000 (12:10 -0700)]
Timer: Set data member before scheduling task

Also increase tolerance for unit tests

Bug: 116081383
Test: Run unit test
Change-Id: I5531c2259cbbc58b6ee7527813e8d5c4164e94c5

5 years agoHearing Aid: use correct Data Length and MediaType
Stanley Tng [Tue, 2 Oct 2018 19:45:20 +0000 (12:45 -0700)]
Hearing Aid: use correct Data Length and MediaType
am: 51a9bba709

Change-Id: I1be9f73bec94680634e7022ca023a5b9f9219a87

5 years agoHearing Aid: use correct Data Length and MediaType
Stanley Tng [Tue, 25 Sep 2018 18:15:24 +0000 (11:15 -0700)]
Hearing Aid: use correct Data Length and MediaType

Adjusted the requested data length to the BT Controller from 168 to 167.
Also, change the default media type during playback to unknown.

Test: Manual testing with Hearing Aids and verifying with OTA logs
Change-Id: Ic4e934729a98bef5c10ebca64093d8a192e79a01

5 years agoMerge "Hearing Aid: Clean up GATT on disconnect"
Hansong Zhang [Fri, 28 Sep 2018 19:35:53 +0000 (12:35 -0700)]
Merge "Hearing Aid: Clean up GATT on disconnect"
am: 36f0889fc6

Change-Id: I6caf6bc8bef9324f1675f5aa62024b97c6f6b5de

5 years agoMerge "Hearing Aid: Clean up GATT on disconnect"
Treehugger Robot [Fri, 28 Sep 2018 19:08:21 +0000 (19:08 +0000)]
Merge "Hearing Aid: Clean up GATT on disconnect"

5 years agoMerge "Rename functions related to BLE scan cache"
Jakub Pawlowski [Fri, 28 Sep 2018 14:43:31 +0000 (07:43 -0700)]
Merge "Rename functions related to BLE scan cache"
am: 68e05e155e

Change-Id: I55adaa8067a2ae50682d3c53814720128a0f1b2e

5 years agoMerge "Rename functions related to BLE scan cache"
Treehugger Robot [Fri, 28 Sep 2018 14:22:08 +0000 (14:22 +0000)]
Merge "Rename functions related to BLE scan cache"

5 years agoRename functions related to BLE scan cache
Jakub Pawlowski [Wed, 8 Aug 2018 13:19:58 +0000 (15:19 +0200)]
Rename functions related to BLE scan cache

They are not related to GATT, update naming.

Test: compilation
Bug: 67058417
Change-Id: Ia84ed98e02fbc04ecfde979f860b8766b0018218

5 years agoHearing Aid: Clean up GATT on disconnect
Hansong Zhang [Thu, 27 Sep 2018 05:02:38 +0000 (22:02 -0700)]
Hearing Aid: Clean up GATT on disconnect

When user requests Disconnect(), after disconnecting GATT,
OnGattDisconnected() never cleans up GATT queue, because the
corresponding device is already removed from HearingDevices. We need to
clean up the queue before connecting the same device again. Without the
fix, sometimes ACL is connected, but the host failed to read GATT
characteristic to open COC. Also clean up connection update status
during disconnect

Bug: 115365334
Test: connect to both devices -> disconnect -> connect, and repeat
Change-Id: I158b19b3d1f2cb2123ec554eb1ffe8c842df998e

5 years agoAdd TEST_MAPPING to system/bt
Jack He [Fri, 28 Sep 2018 00:44:09 +0000 (17:44 -0700)]
Add TEST_MAPPING to system/bt
am: 37b717c612

Change-Id: Iae641e8d55d26577491853eca958347744638ba9

5 years agoMerge "GATTC: Use hex for conn_id in log"
Hansong Zhang [Thu, 27 Sep 2018 22:27:41 +0000 (15:27 -0700)]
Merge "GATTC: Use hex for conn_id in log"
am: 71113b44c3

Change-Id: Iabf9065e751f4090bf676fe109ef23a4310b29d6

5 years agoAdd TEST_MAPPING to system/bt
Jack He [Wed, 29 Aug 2018 01:28:55 +0000 (18:28 -0700)]
Add TEST_MAPPING to system/bt

* Add "postsubmit" test group to TEST_MAPPING in system/bt
* Developer can run tests mannually in system/bt via:
  system/bt$ atest :postsubmit
* Remove legacy configuration files spread across system/bt
* Created unified configuration file system/bt/AndroidTestTemplate.xml
  and add it to the default build config so that developers don't have
  to configure it

Bug: 113359343
Test: atest :postsubmit
Change-Id: I0fdd55b47ef176b5c4ce3d2cd217ffa67cf9bc23

5 years agoMerge "GATTC: Use hex for conn_id in log"
Treehugger Robot [Thu, 27 Sep 2018 22:16:39 +0000 (22:16 +0000)]
Merge "GATTC: Use hex for conn_id in log"

5 years agoMerge "HID: Free timer after removing device"
Hemant Gupta [Thu, 27 Sep 2018 21:03:24 +0000 (14:03 -0700)]
Merge "HID: Free timer after removing device"
am: 1de8ba51e1

Change-Id: Ib99739a3e08926b91e0df57564e690eb1604f05c

5 years agoMerge "HID: Free timer after removing device"
Treehugger Robot [Thu, 27 Sep 2018 20:47:50 +0000 (20:47 +0000)]
Merge "HID: Free timer after removing device"

5 years agoMove Bluetooth to using C++17
Ajay Panicker [Thu, 27 Sep 2018 19:37:16 +0000 (12:37 -0700)]
Move Bluetooth to using C++17
am: 96bcf14a65

Change-Id: I0cd45059f7e3befa275b25be65ea88947c08b3b5

5 years agoGATTC: Use hex for conn_id in log
Hansong Zhang [Thu, 27 Sep 2018 00:42:40 +0000 (17:42 -0700)]
GATTC: Use hex for conn_id in log

For host conn_id, use hex format

Test: manual
Change-Id: I7d7e690a1dbe0665b827c59d104540eafa45d426

5 years agoHID: Free timer after removing device
Hemant Gupta [Thu, 27 Sep 2018 16:05:46 +0000 (21:35 +0530)]
HID: Free timer after removing device

Timer conn.process_repage_timer is being freed in HID_HostDeregister
which causes use after free condition in HID_HostRemoveDev->
HID_HostCloseDev.

Fix:
Call alarm_free after HID_HostRemoveDev in HID_HostDeregister

Test:
Code analysis

Bug: 116774368
Change-Id: Iddecd126716a5660f4c37ddc917bacee84342297

5 years agoMove Bluetooth to using C++17
Ajay Panicker [Mon, 17 Sep 2018 18:35:24 +0000 (11:35 -0700)]
Move Bluetooth to using C++17

C++ 17 has a bunch of features that will help us refactor the Bluetooth
stack to be much more safe and stable.

Bug: 115895445
Test: Compile and testtracker/201115
Change-Id: Ia1e8e179fa1df116969606d119cb8abe11f44761

5 years agoMerge "Add noexcept to move constructors and assignment operators."
Chih-hung Hsieh [Thu, 27 Sep 2018 04:44:30 +0000 (21:44 -0700)]
Merge "Add noexcept to move constructors and assignment operators."
am: 2e3fa05261

Change-Id: Ief6685c41f95433dfa2ac1acd75f18b8895b5da1

5 years agoMerge "Add noexcept to move constructors and assignment operators."
Chih-hung Hsieh [Thu, 27 Sep 2018 04:33:34 +0000 (04:33 +0000)]
Merge "Add noexcept to move constructors and assignment operators."

5 years agoMerge "Use maximum SSR timeout value when A2DP is streaming"
Ugo Yu [Thu, 27 Sep 2018 04:20:09 +0000 (21:20 -0700)]
Merge "Use maximum SSR timeout value when A2DP is streaming"
am: 3dd799fd1a

Change-Id: Iafa7a776e8e844e2265d68eb1028402e4957afbf

5 years agoMerge "Use maximum SSR timeout value when A2DP is streaming"
Treehugger Robot [Thu, 27 Sep 2018 01:58:13 +0000 (01:58 +0000)]
Merge "Use maximum SSR timeout value when A2DP is streaming"

5 years agoMerge "Remove obsoleted Coverity-related comment"
Pavlin Radoslavov [Wed, 26 Sep 2018 23:31:56 +0000 (16:31 -0700)]
Merge "Remove obsoleted Coverity-related comment"
am: 21cd29ca65

Change-Id: I98552cebb24e6b2784dc4771e4ceb213744b9aea