OSDN Git Service

android-x86/system-bt.git
5 years agoMetrics: Add Bluetooth quality report to statsd am: 12724bd83b
Jack He [Wed, 30 Jan 2019 10:29:02 +0000 (02:29 -0800)]
Metrics: Add Bluetooth quality report to statsd am: 12724bd83b
am: 11d39fbe70

Change-Id: I671671ed3be110c5b9fa229c75d669d54392d2bb

5 years agoMetrics: Add Bluetooth quality report to statsd
Jack He [Wed, 30 Jan 2019 10:07:04 +0000 (02:07 -0800)]
Metrics: Add Bluetooth quality report to statsd
am: 12724bd83b

Change-Id: Ibceca50f90ba325db47a03983ebdf693cfaed90e

5 years agoMetrics: Add Bluetooth quality report to statsd
Jack He [Tue, 29 Jan 2019 22:51:46 +0000 (14:51 -0800)]
Metrics: Add Bluetooth quality report to statsd

Bug: 112969790
Test: make, test drive with statsd
Change-Id: I20232facbd40f7f49bf574f47754ba5222a2aa34

5 years agoMerge changes I79037ddb,I9bab0078 am: 3fb1b1b89e
Jack He [Wed, 30 Jan 2019 05:28:59 +0000 (21:28 -0800)]
Merge changes I79037ddb,I9bab0078 am: 3fb1b1b89e
am: e7971c55d4

Change-Id: I31ac559037237cc282c27f99b4c781ee54f5e367

5 years agoMerge changes I79037ddb,I9bab0078
Jack He [Wed, 30 Jan 2019 05:15:26 +0000 (21:15 -0800)]
Merge changes I79037ddb,I9bab0078
am: 3fb1b1b89e

Change-Id: I0cbba0d141d93f342ae6e6f1a24a8b3266c8092f

5 years agoMerge changes I79037ddb,I9bab0078
Treehugger Robot [Wed, 30 Jan 2019 04:57:36 +0000 (04:57 +0000)]
Merge changes I79037ddb,I9bab0078

* changes:
  Metrics: add remote version info log to statsd
  Metrics: Log HCI timeout event over stats log

5 years agoMetrics: add remote version info log to statsd
Jack He [Tue, 29 Jan 2019 22:49:34 +0000 (14:49 -0800)]
Metrics: add remote version info log to statsd

Bug: 112969790
Test: make, test drive with statsd
Change-Id: I79037ddb6c4af3bf3e5cc8a890c8ee66652b8a81

5 years agoMetrics: Log HCI timeout event over stats log
Jack He [Mon, 21 Jan 2019 07:16:45 +0000 (23:16 -0800)]
Metrics: Log HCI timeout event over stats log

Fixes: 121213292
Bug: 111812273
Test: make, test drive with statsd
Change-Id: I9bab0078a1e45c9811fd63f4c5aef9f4704ac555

5 years agoUsing std::promise and std::future to block till A2DP device activated am: f0999d8be8
Cheney Ni [Wed, 30 Jan 2019 01:58:46 +0000 (17:58 -0800)]
Using std::promise and std::future to block till A2DP device activated am: f0999d8be8
am: c7f7d727e2

Change-Id: I6fe9507733ed49160853c7cbc1690faf87497092

5 years agoUsing std::promise and std::future to block till A2DP device activated
Cheney Ni [Wed, 30 Jan 2019 01:52:39 +0000 (17:52 -0800)]
Using std::promise and std::future to block till A2DP device activated
am: f0999d8be8

Change-Id: Ic013217fb07dd1c3aa33623c641ae47c915730bf

5 years agoMerge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev am: 1946090...
Hansong Zhang [Wed, 30 Jan 2019 01:05:50 +0000 (17:05 -0800)]
Merge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev am: 19460901d8 am: 154230b832 am: a3a57067d0
am: f4aa470028

Change-Id: I20fca0d1bb08a631d03be5ad201d1e61a388f8c2

5 years agoMerge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev am: 1946090...
Hansong Zhang [Wed, 30 Jan 2019 01:02:43 +0000 (17:02 -0800)]
Merge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev am: 19460901d8 am: 154230b832
am: a3a57067d0

Change-Id: Ib76648858de768c8b3db411eda84efe7abbd420f

5 years agoMerge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev am: 19460901d8
Hansong Zhang [Wed, 30 Jan 2019 00:56:34 +0000 (16:56 -0800)]
Merge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev am: 19460901d8
am: 154230b832

Change-Id: I69aba9f5350a2b4510e49494839bbff6369c8b4a

5 years agoMerge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev
Hansong Zhang [Wed, 30 Jan 2019 00:49:16 +0000 (16:49 -0800)]
Merge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev
am: 19460901d8

Change-Id: If4f3b40817ff57bdae4777ae330854a9119ae0b7

5 years agoMerge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev
TreeHugger Robot [Wed, 30 Jan 2019 00:25:28 +0000 (00:25 +0000)]
Merge "btm_ble_multi_adv: Check data length in HCI interface" into oc-dev

5 years agoUsing std::promise and std::future to block till A2DP device activated
Cheney Ni [Wed, 19 Dec 2018 10:46:18 +0000 (18:46 +0800)]
Using std::promise and std::future to block till A2DP device activated

There is a new interface to replace UIPC with Blueototh Audio Hal v2 and
synchronization issues between BT Stack and Audio Hal was found when
activating a new A2DP device. Because the API to activate an A2DP device
was non-blocking, it was possilbe that there was a race condition when
BT Stack starting A2DP session and Audio Hal was opening A2DP output.
There was a chance that the output was opened before session started and
causing A2DP to have no sound.

This CL uses std::promise and std::future are able to achieve the
serialize of starting session and opening output for A2DP.

Bug: 111519504
Bug: 122505783
Test: A2DP reconnection and switching

Change-Id: I88c42ea1eb5f8def2345dbfaab26c6d1a91c54cc

5 years agoAdd IdGenerator am: 23478f71d0
Jakub Pawlowski [Tue, 29 Jan 2019 07:56:01 +0000 (23:56 -0800)]
Add IdGenerator am: 23478f71d0
am: 0bc4579ba3

Change-Id: I59e5cff32382a1c6cc86aa163ea8baa89a15e07d

5 years agoAdd IdGenerator
Jakub Pawlowski [Tue, 29 Jan 2019 07:51:56 +0000 (23:51 -0800)]
Add IdGenerator
am: 23478f71d0

Change-Id: I974608ed960f88067abfbab07f917de8950f4522

5 years agoAdd IdGenerator
Jakub Pawlowski [Wed, 8 Aug 2018 14:32:44 +0000 (16:32 +0200)]
Add IdGenerator

Test: added unit test
Bug: 67058417
Change-Id: I41a9200cbf703f5404f312e4cb1199b640e86270

5 years agoBQR: Cleanup BQR header definititon am: 63aca79a30
Jack He [Sat, 26 Jan 2019 02:36:20 +0000 (18:36 -0800)]
BQR: Cleanup BQR header definititon am: 63aca79a30
am: 9187066d98

Change-Id: I246b31e6bbf9e9bbeb27dd3a8339e62f9b81361e

5 years agoBQR: Cleanup BQR header definititon
Jack He [Sat, 26 Jan 2019 02:33:12 +0000 (18:33 -0800)]
BQR: Cleanup BQR header definititon
am: 63aca79a30

Change-Id: Ie3780d6f6382ca82f2f809d4359ee20aa84f0cc3

5 years agoBQR: Cleanup BQR header definititon
Jack He [Fri, 25 Jan 2019 21:45:16 +0000 (13:45 -0800)]
BQR: Cleanup BQR header definititon

* Rename persist.bluetooth.bqr.eventmask to persist.bluetooth.bqr.event_mask
* Rename persist.bluetooth.bqr.interval to
  persist.bluetooth.bqr.min_interval_ms
* Rename all instances of reporting interval to minimum report interval
  milliseconds
* Add zero initialization to all event values
* Add comment on the unit of timestamp and piconet clock

Bug: 111384296
Test: make, no functional change
Change-Id: I5174297ec314a862da7591bcf3aefea9b6778f1a

5 years ago[automerger skipped] DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency...
Suren Baghdasaryan [Fri, 25 Jan 2019 17:31:02 +0000 (09:31 -0800)]
[automerger skipped] DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy include"" am: fc27af1a25 -s ours
am: d6fa46a515 -s ours
am skip reason: subject contains skip directive

Change-Id: Ic185d138e9f6fed533a126083743310e197e00a7

5 years ago[automerger skipped] DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency...
Suren Baghdasaryan [Fri, 25 Jan 2019 17:20:42 +0000 (09:20 -0800)]
[automerger skipped] DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy include""
am: fc27af1a25 -s ours
am skip reason: subject contains skip directive

Change-Id: I1586c715e769e192e2d37350279152ec084cbce3

5 years agoBQR: Add Bluetooth Quality Report feature am: 6e632477a4
Ray [Fri, 25 Jan 2019 17:04:38 +0000 (09:04 -0800)]
BQR: Add Bluetooth Quality Report feature am: 6e632477a4
am: 5d7470d629

Change-Id: I3ecd5ef0c6474c7368a05176af71785e74a2571e

5 years agoBQR: Add Bluetooth Quality Report feature
Ray [Fri, 25 Jan 2019 17:00:23 +0000 (09:00 -0800)]
BQR: Add Bluetooth Quality Report feature
am: 6e632477a4

Change-Id: I7f3684b437ea914eb446bcdafb83f19d870944de

5 years agoDO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy...
Suren Baghdasaryan [Fri, 25 Jan 2019 05:34:11 +0000 (05:34 +0000)]
DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy include""

This reverts commit e5751caf675fc0bee229f8c427564c2e927184fd.

Reason for revert: AOSP is fixed with new vendor image

Change-Id: I96db6ffe9cce3d5158b96c171026839d62ec3756
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
5 years agoBQR: Add Bluetooth Quality Report feature
Ray [Thu, 3 Jan 2019 13:19:16 +0000 (21:19 +0800)]
BQR: Add Bluetooth Quality Report feature

Bluetooth disconnects, voice and audio quality issues are sometimes hard
to debug without an OTA (Over The Air) log.
For debugging this kind of issue we would need to identify it belongs to
the host, Bluetooth controller/firmware, environment or the remote
Bluetooth device.
This feature would route the link and firmware/controller stats (ex: TX
power level, RSSI, Unused AFH channel count...) to the host when quality
events happen.

Quality Monitoring Mode:
The controller will periodically send Bluetooth Quality VSE sub-event to
the host.

Approaching LSTO:
Once no packets are received from the connected Bluetooth device for a
duration longer than the half of LSTO (Link Supervision Timeout) value,
the controller will report Approaching LSTO event to the host.

A2DP Audio Choppy:
When audio stall, the controller will report A2DP Audio Choppy event to
the host.

(e)SCO Voice Choppy:
The controller will report (e)SCO Voice Choppy event to the host if the
voice quality might be bad.

Bug: 111384296
Test: - Verified that all functionalites with the Bluetooth controller /
        firmware which supports Bluetooth Quality Report VSC
(OpCode: 0xFD5E) and Bluetooth Quality Report (Sub-event code:
0x58) of VSE.
      - Verified that this feature could work on both the A2DP HW
        offload and non-offload modes.

Change-Id: I3fd3000bace7606855cac3b9b87134499c0ca891

5 years agoConvert Android.mk file to Android.bp am: aa044495fc
Sasha Smundak [Fri, 25 Jan 2019 08:17:38 +0000 (00:17 -0800)]
Convert Android.mk file to Android.bp am: aa044495fc
am: dd0a988d8d

Change-Id: Ic7db6ba149e676faf617e1d76ee1df5cdd227c95

5 years agoConvert Android.mk file to Android.bp
Sasha Smundak [Fri, 25 Jan 2019 08:13:31 +0000 (00:13 -0800)]
Convert Android.mk file to Android.bp
am: aa044495fc

Change-Id: I8905a9c28b9fc76083655bda05145559b1a15162

5 years agoConvert Android.mk file to Android.bp
Sasha Smundak [Tue, 22 Jan 2019 21:46:37 +0000 (13:46 -0800)]
Convert Android.mk file to Android.bp

See build/soong/README.md for more information.

Change-Id: Ida03ab11c7fa6148fa5711ce1770b6951e831412
Fixes: 122332236
Test: treehugger

5 years agoSDP: Remove SDP_DEBUG_RAW flag am: fa84129932
Jack He [Fri, 25 Jan 2019 03:53:50 +0000 (19:53 -0800)]
SDP: Remove SDP_DEBUG_RAW flag am: fa84129932
am: 4b6af7e21a

Change-Id: I1d633060429314677684a1bd8eb8b9a0b8aac87e

5 years agoSDP: Remove SDP_DEBUG_RAW flag
Jack He [Fri, 25 Jan 2019 03:49:44 +0000 (19:49 -0800)]
SDP: Remove SDP_DEBUG_RAW flag
am: fa84129932

Change-Id: Id77bdfec4e2a4b91ece3d9264dbbbf327618478b

5 years agoSDP: Remove SDP_DEBUG_RAW flag
Jack He [Fri, 25 Jan 2019 00:59:52 +0000 (16:59 -0800)]
SDP: Remove SDP_DEBUG_RAW flag

* This flag is almost always set to false, making blocks of code
  unreachable

Test: make
Change-Id: Ie5ceafa7ae02ccbfec537a5d3960e617b746ecdf

5 years agoMerge "Disable AVRCP position change in silence mode" am: 869ae99427
Ugo Yu [Thu, 24 Jan 2019 18:38:29 +0000 (10:38 -0800)]
Merge "Disable AVRCP position change in silence mode" am: 869ae99427
am: 9aa5731e1e

Change-Id: If487b82a125f9ddfe53d38fe3a5b5174b79299f0

5 years agoMerge "Disable AVRCP position change in silence mode"
Ugo Yu [Thu, 24 Jan 2019 18:28:38 +0000 (10:28 -0800)]
Merge "Disable AVRCP position change in silence mode"
am: 869ae99427

Change-Id: Ia0c8ae4a17a0153a620a9f9aca3042f737512f71

5 years agoMerge "Disable AVRCP position change in silence mode"
Treehugger Robot [Thu, 24 Jan 2019 18:08:05 +0000 (18:08 +0000)]
Merge "Disable AVRCP position change in silence mode"

5 years ago[automerger skipped] Merge "DO NOT MERGE: Revert "Add libprocessgroup dependency...
Suren Baghdasaryan [Thu, 24 Jan 2019 07:17:25 +0000 (23:17 -0800)]
[automerger skipped] Merge "DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include"" am: 69eb5b3551 -s ours
am: 6757cf09ce -s ours
am skip reason: subject contains skip directive

Change-Id: I65d4b52f57607c786da0eef75a2b9fbc4a6bef5d

5 years ago[automerger skipped] Merge "DO NOT MERGE: Revert "Add libprocessgroup dependency...
Suren Baghdasaryan [Thu, 24 Jan 2019 07:08:32 +0000 (23:08 -0800)]
[automerger skipped] Merge "DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include""
am: 69eb5b3551 -s ours
am skip reason: subject contains skip directive

Change-Id: I8680db89a05f5eaf4b605c66d85dcea7ed43acf3

5 years agoMerge "DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy...
Suren Baghdasaryan [Thu, 24 Jan 2019 06:57:55 +0000 (06:57 +0000)]
Merge "DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include""

5 years agoMerge "GATT connection_manager: Fix logic to remove white list device" am: 4d834e9d0e
Hansong Zhang [Thu, 24 Jan 2019 06:51:32 +0000 (22:51 -0800)]
Merge "GATT connection_manager: Fix logic to remove white list device" am: 4d834e9d0e
am: 48796c80de

Change-Id: Idc7db05fb31b068d386052cb10f8d446dc318416

5 years agoMerge "GATT connection_manager: Fix logic to remove white list device"
Hansong Zhang [Thu, 24 Jan 2019 06:38:45 +0000 (22:38 -0800)]
Merge "GATT connection_manager: Fix logic to remove white list device"
am: 4d834e9d0e

Change-Id: Ib17d50227975b604eda1f6fa845ca0c9bda19e95

5 years agoMerge "GATT connection_manager: Fix logic to remove white list device"
Treehugger Robot [Thu, 24 Jan 2019 06:26:29 +0000 (06:26 +0000)]
Merge "GATT connection_manager: Fix logic to remove white list device"

5 years agoDO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include"
Suren Baghdasaryan [Thu, 24 Jan 2019 04:54:50 +0000 (20:54 -0800)]
DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include"

This reverts commit 8ef9dc6f3f334b444bbfffae18185a36d6a1f5b5.

Reason for revert: Broke AOSP

Change-Id: If6b0121b5ce60915accf705dbbba268cc4a96203
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
5 years agoMerge "Add a new isAshaHearingAidSupported method to Bluetooth Manager" am: aff79b9db4
Stanley Tng [Thu, 24 Jan 2019 02:40:09 +0000 (18:40 -0800)]
Merge "Add a new isAshaHearingAidSupported method to Bluetooth Manager" am: aff79b9db4
am: 56a3ac368e

Change-Id: I22e8aa8723edb02d16385ab3ef2014f54a8277dd

5 years agoMerge "Add a new isAshaHearingAidSupported method to Bluetooth Manager"
Stanley Tng [Thu, 24 Jan 2019 02:03:59 +0000 (18:03 -0800)]
Merge "Add a new isAshaHearingAidSupported method to Bluetooth Manager"
am: aff79b9db4

Change-Id: I073b587aa6d41b551bdd6a3f6e8b17955cfd4130

5 years agoMerge "Add a new isAshaHearingAidSupported method to Bluetooth Manager"
Treehugger Robot [Thu, 24 Jan 2019 01:34:25 +0000 (01:34 +0000)]
Merge "Add a new isAshaHearingAidSupported method to Bluetooth Manager"

5 years agoDisable AVRCP position change in silence mode
Ugo Yu [Sat, 12 Jan 2019 19:12:30 +0000 (03:12 +0800)]
Disable AVRCP position change in silence mode

* Save the silence mode information in BtifAvPeer send from
  JAVA, which helps AVRCP devices to check whether device
  silence mode is enabled or not.
* Stop sending AVRCP position change event to remote when
  silence mode is enabled.

Bug: 112323989
Test: Manual
Change-Id: I99d88a31caea062790c4ff0dc9199ed82f058067

5 years agoGATT connection_manager: Fix logic to remove white list device
Hansong Zhang [Wed, 23 Jan 2019 22:03:24 +0000 (14:03 -0800)]
GATT connection_manager: Fix logic to remove white list device

Device in bgconn_dev will be removed when no app is using it. Fix the
logic to prevent from use after free.

Bug: 123297334
Test: Manual
Change-Id: I35a0191ba48fabbcf28525388dfa63b93b20c96d

5 years agoMerge "Add binder interfaces for metadata APIs" am: 5ac84e7897
Ugo Yu [Wed, 23 Jan 2019 08:13:05 +0000 (00:13 -0800)]
Merge "Add binder interfaces for metadata APIs" am: 5ac84e7897
am: 827d9efad2

Change-Id: I26f5457dcf999492b2090705b0efe6450a7d8a8a

5 years agoMerge "Add binder interfaces for metadata APIs"
Ugo Yu [Wed, 23 Jan 2019 07:50:47 +0000 (23:50 -0800)]
Merge "Add binder interfaces for metadata APIs"
am: 5ac84e7897

Change-Id: Ifaf958504f373f611788235d8b2aa470a99c9d4b

5 years agoMerge "Add binder interfaces for metadata APIs"
Treehugger Robot [Wed, 23 Jan 2019 07:38:06 +0000 (07:38 +0000)]
Merge "Add binder interfaces for metadata APIs"

5 years ago[automerger skipped] Fix the LE CoC SL4A Test failure due to length check am: 07ff96727c
Stanley Tng [Wed, 23 Jan 2019 02:16:58 +0000 (18:16 -0800)]
[automerger skipped] Fix the LE CoC SL4A Test failure due to length check am: 07ff96727c
am: 091035cd2a -s ours
am skip reason: SHA1 091035cd2a skipped by user stng

Change-Id: I79dd3dff38117cdbcbdc13a4b09b9835c93b4946

5 years agoFix the LE CoC SL4A Test failure due to length check
Stanley Tng [Wed, 23 Jan 2019 01:07:35 +0000 (17:07 -0800)]
Fix the LE CoC SL4A Test failure due to length check
am: 07ff96727c

Change-Id: I06461df508cd8f0246b2673db2c1810aab3c9322

5 years agoAdd a new isAshaHearingAidSupported method to Bluetooth Manager
Stanley Tng [Mon, 14 Jan 2019 00:13:09 +0000 (16:13 -0800)]
Add a new isAshaHearingAidSupported method to Bluetooth Manager

As part of adding isHearingAidsProfileSupported method to
BluetoothAdapter, this new method is added to query the support state.

Test: Manual testing with configuration enabled and disabled.
Bug: 119617521
Change-Id: I97151443c6a5bd459a7c73c61f7fa7d5a386909a
(cherry picked from commit 7d51ff78280a9e03949ffed8f7f61d5226c3a27b)

5 years agoAdd binder interfaces for metadata APIs
Ugo Yu [Sat, 12 Jan 2019 00:13:16 +0000 (08:13 +0800)]
Add binder interfaces for metadata APIs

Bug: 121051445
Test: build pass

Change-Id: Icd51b7cc0a4dec5a2bffec4ded67caffeedb126b

5 years agoFix the LE CoC SL4A Test failure due to length check
Stanley Tng [Tue, 11 Dec 2018 22:45:13 +0000 (14:45 -0800)]
Fix the LE CoC SL4A Test failure due to length check

Fix a regression from the previous CL that checks the buffer length
before doing a memcpy. The previous check is too strict causing valid
sized buffers to be rejected. The length check is incorrect and off by the header size.

Bug: 117306992
Bug: 112321180
Test: Run the LE CoC SL4A Tests
Change-Id: I9bbcd58460a02394010f74a18e9ebdbcd546d43d
Merged-In: I9bbcd58460a02394010f74a18e9ebdbcd546d43d
(cherry picked from commit fcb1994de1f6ee34b8dc6804a2b32e20bf138073)

5 years agoAdd libprocessgroup dependency and fix sched_policy include am: 8ef9dc6f3f
Suren Baghdasaryan [Tue, 22 Jan 2019 21:58:08 +0000 (13:58 -0800)]
Add libprocessgroup dependency and fix sched_policy include am: 8ef9dc6f3f
am: a5b1ff8f52

Change-Id: I332a3251035d209f454fc5ccd5eca6b6810e03f2

5 years agoAdd libprocessgroup dependency and fix sched_policy include
Suren Baghdasaryan [Tue, 22 Jan 2019 21:24:03 +0000 (13:24 -0800)]
Add libprocessgroup dependency and fix sched_policy include
am: 8ef9dc6f3f

Change-Id: If5ec34928a56d7d0f6daeb16b91a693ca0646a03

5 years agoAdd libprocessgroup dependency and fix sched_policy include
Suren Baghdasaryan [Thu, 20 Dec 2018 01:36:37 +0000 (17:36 -0800)]
Add libprocessgroup dependency and fix sched_policy include

libbt-utils uses set_sched_policy which is now implemented inside
libprocessgroup. Add required dependency and header file include.

Exempt-From-Owner-Approval: janitorial

Bug: 111307099
Test: builds, boots

Merged-In: I4d0dcfad22b30ac249a7874b42a7121e2ffedadb
Change-Id: I4d0dcfad22b30ac249a7874b42a7121e2ffedadb
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
5 years agoMerge "Metric: Add logging for link layer connection events" am: e6b80778a8
Jack He [Thu, 17 Jan 2019 23:21:47 +0000 (15:21 -0800)]
Merge "Metric: Add logging for link layer connection events" am: e6b80778a8
am: 7b5765948e

Change-Id: I15b379d16e089c64e3de54ac96ae8d8c5099df06

5 years ago[automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105...
Xin Li [Thu, 17 Jan 2019 23:01:56 +0000 (15:01 -0800)]
[automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master" am: f15c1197f5 -s ours
am: 98aa467973 -s ours
am skip reason: subject contains skip directive

Change-Id: Ifbf5bab360131698dc9d2384c4bee332cbb8d464

5 years agoMerge "Metric: Add logging for link layer connection events"
Jack He [Thu, 17 Jan 2019 22:57:39 +0000 (14:57 -0800)]
Merge "Metric: Add logging for link layer connection events"
am: e6b80778a8

Change-Id: Icaf506c40c16b12b63cac0c5327f8c68f9033c9e

5 years ago[automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105...
Xin Li [Thu, 17 Jan 2019 22:44:52 +0000 (14:44 -0800)]
[automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master"
am: f15c1197f5 -s ours
am skip reason: subject contains skip directive

Change-Id: Ib82454185f6d69fa695354c1ce488ad42ad990aa

5 years agoMerge "Metric: Add logging for link layer connection events"
Treehugger Robot [Thu, 17 Jan 2019 22:30:43 +0000 (22:30 +0000)]
Merge "Metric: Add logging for link layer connection events"

5 years ago[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001)...
Xin Li [Thu, 17 Jan 2019 22:05:38 +0000 (14:05 -0800)]
[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master am: dfdcf1f0e0 -s ours
am: c4bb52b4f3 -s ours
am skip reason: subject contains skip directive

Change-Id: Ib69a65276a618024f463874256c4e2275dc3a5b7

5 years ago[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001)...
Xin Li [Thu, 17 Jan 2019 21:53:32 +0000 (13:53 -0800)]
[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master
am: dfdcf1f0e0 -s ours
am skip reason: subject contains skip directive

Change-Id: Ibf1cb4eab80383dba8f7a5bbfe2bb5bff95ca43f

5 years agoMerge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master"
Xin Li [Thu, 17 Jan 2019 21:19:42 +0000 (21:19 +0000)]
Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master"

5 years agoMerge "Add new Hearing Aids commands to improve L/R Sync" am: 055a5f4056
Stanley Tng [Thu, 17 Jan 2019 18:49:26 +0000 (10:49 -0800)]
Merge "Add new Hearing Aids commands to improve L/R Sync" am: 055a5f4056
am: 376b0e83e3

Change-Id: I8398824a2362b6af4419cad371a41519c9029723

5 years agoMerge "Add new Hearing Aids commands to improve L/R Sync"
Stanley Tng [Thu, 17 Jan 2019 18:45:08 +0000 (10:45 -0800)]
Merge "Add new Hearing Aids commands to improve L/R Sync"
am: 055a5f4056

Change-Id: I19b467c2f4a185c0ea6953b3697597997d33c871

5 years agoMerge "Add new Hearing Aids commands to improve L/R Sync"
Treehugger Robot [Thu, 17 Jan 2019 18:27:10 +0000 (18:27 +0000)]
Merge "Add new Hearing Aids commands to improve L/R Sync"

5 years agoMerge "Wait for Notifications before sending audio data" am: 2bd5ea5772
Stanley Tng [Thu, 17 Jan 2019 17:00:10 +0000 (09:00 -0800)]
Merge "Wait for Notifications before sending audio data" am: 2bd5ea5772
am: a0e377ac0d

Change-Id: I24474c29c0b4bdc65148357dde18677e404f068c

5 years agoMerge "Wait for Notifications before sending audio data"
Stanley Tng [Thu, 17 Jan 2019 16:55:25 +0000 (08:55 -0800)]
Merge "Wait for Notifications before sending audio data"
am: 2bd5ea5772

Change-Id: Ie9e4efb8efe0e287d7450b587aca0010459c648e

5 years agoMerge "Wait for Notifications before sending audio data"
Treehugger Robot [Thu, 17 Jan 2019 15:25:39 +0000 (15:25 +0000)]
Merge "Wait for Notifications before sending audio data"

5 years agoAdd new Hearing Aids commands to improve L/R Sync
Stanley Tng [Tue, 1 Jan 2019 22:52:07 +0000 (14:52 -0800)]
Add new Hearing Aids commands to improve L/R Sync

Prototyping new commands to the Hearing Aids devices to improve the
Left/Right Sync issues. The new commands are:
1. Add a new byte parameter to the START command that indicates the
other side device is actively streaming or disconnected,
2. Whenever there is an LE Connection Update event from the phone BT
controller, send a new Status Update command to all connected devices,
3. Whenever one side gets disconnected or starts streaming, send a new
Status Update command to the other side to inform about this change.

Bug: 117778955
Bug: 120921220
Test: Manual Testing with Hearing Aids
Change-Id: I5c94867d4574802025e3b433573e52d3c40c9828

5 years agoWait for Notifications before sending audio data
Stanley Tng [Wed, 26 Dec 2018 02:12:51 +0000 (18:12 -0800)]
Wait for Notifications before sending audio data

For the Hearing Aids Profile, wait for the notification status from the
devices after sending the Start command. The reason is that the devices
may be in low power mode and the phone should not start streaming audio
data to these devices until it is fully awake.

Test: Manual testing with Hearing Aids devices
Bug: 117778955
Bug: 120921220
Change-Id: I28b79e7e284d5e75864c0b12315fbb8bd47acf74

5 years agobtm_ble_multi_adv: Check data length in HCI interface
Hansong Zhang [Wed, 16 Jan 2019 20:33:26 +0000 (12:33 -0800)]
btm_ble_multi_adv: Check data length in HCI interface

For BleAdvertiserVscHciInterfaceImpl and
BleAdvertiserLegacyHciInterfaceImpl, the maximum size of scan response
and advertising packet data length should be BTM_BLE_AD_DATA_LEN (31).

Bug: 121145627
Test: POC
Change-Id: I7653a6c186b7313ef2b1547bca120b9d41c90140

5 years agoMetric: Add logging for link layer connection events
Jack He [Thu, 20 Dec 2018 23:46:17 +0000 (15:46 -0800)]
Metric: Add logging for link layer connection events

* Logs when there is an event affecting Bluetooth device's link
  layer connection. Triggerred when there is a related HCI command
  or event
* Users of this metrics can deduce Bluetooth device's connection state
  from these events
* HCI commands are logged before the command is sent, after receiving,
  command status, and after receiving command complete
  event comes back
* HCI events are logged when they arrive
* Simplifies logic in btu_hcif_hdl_command_status() since p_cmd is never
  null and we always ignore parameter total length field
* Call btm_identity_addr_to_random_pseudo() when parsing command status
  packet for LE create connection, extended create connection,
  add/remove/clear whitelist commands

DETAILS:

* Bluetooth classic commands:
  - CMD_CREATE_CONNECTION
  - CMD_DISCONNECT
  - CMD_CREATE_CONNECTION_CANCEL
  - CMD_ACCEPT_CONNECTION_REQUEST
  - CMD_REJECT_CONNECTION_REQUEST
  - CMD_SETUP_ESCO_CONNECTION
  - CMD_ACCEPT_ESCO_CONNECTION
  - CMD_REJECT_ESCO_CONNECTION
  - CMD_ENH_SETUP_ESCO_CONNECTION
  - CMD_ENH_ACCEPT_ESCO_CONNECTION
* Bluetooth low energy commands:
  - CMD_BLE_CREATE_LL_CONN [Only logged when there is an error or initiator filter policy is 0x00]
  - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
  - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
  - CMD_BLE_CLEAR_WHITE_LIST
  - CMD_BLE_ADD_WHITE_LIST
  - CMD_BLE_REMOVE_WHITE_LIST
* Bluetooth classic events:
  - EVT_CONNECTION_COMP
  - EVT_CONNECTION_REQUEST
  - EVT_DISCONNECTION_COMP
  - EVT_ESCO_CONNECTION_COMP
  - EVT_ESCO_CONNECTION_CHANGED
* Bluetooth low energy meta events:
  - BLE_EVT_CONN_COMPLETE_EVT
  - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT

Bug: 112969790
Test: make and test drive statsd
Change-Id: Ib843dfa95bb6448c41dac261dabcf17947efda06

5 years agoAllow bond request from devices with BTM_IO_CAP_NONE am: c52062c078
Tiansong Cui [Wed, 16 Jan 2019 16:49:50 +0000 (08:49 -0800)]
Allow bond request from devices with BTM_IO_CAP_NONE am: c52062c078
am: 21b9e3e50a

Change-Id: I15305db379166df60f9db362e0757640ac899d0f

5 years agoAllow bond request from devices with BTM_IO_CAP_NONE
Tiansong Cui [Wed, 16 Jan 2019 16:40:30 +0000 (08:40 -0800)]
Allow bond request from devices with BTM_IO_CAP_NONE
am: c52062c078

Change-Id: I50aa6393eb74fb83ea5878c7236930dc81f35bc1

5 years agoAllow bond request from devices with BTM_IO_CAP_NONE
Tiansong Cui [Tue, 15 Jan 2019 21:22:46 +0000 (13:22 -0800)]
Allow bond request from devices with BTM_IO_CAP_NONE

Devices with BTM_IO_CAP_NONE should still be able to create
(although unauthenticated) bond with other devices.

Bug: internal 122119496
Test: manual
Change-Id: Iac008d0199ca11d06db8c91cda821f992ba3d4ee

5 years agoDO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master
Xin Li [Tue, 15 Jan 2019 18:17:12 +0000 (10:17 -0800)]
DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master

Bug: 122685541
Change-Id: Iafca519871aab60f057bb7f6abc1bcf2f0394ba2

5 years ago[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001)...
Xin Li [Tue, 15 Jan 2019 02:19:14 +0000 (18:19 -0800)]
[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into stage-aosp-master
am: d1540dd00a -s ours
am skip reason: subject contains skip directive

Change-Id: Ib4cacbf12afe380e31e507a4da05c1ed24660894

5 years agoDO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into stage-aosp-master
Xin Li [Tue, 15 Jan 2019 00:14:40 +0000 (16:14 -0800)]
DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into stage-aosp-master

Bug: 122685541
Change-Id: I579759f87bab672ef5189f9d13e8417651a04d60

5 years agoMerge "Fix BT a bad/ out of bounds array read" am: 7da7696e07
Sal Savage [Mon, 14 Jan 2019 23:02:49 +0000 (15:02 -0800)]
Merge "Fix BT a bad/ out of bounds array read" am: 7da7696e07
am: 3e5b229b14

Change-Id: Ic087f8ab710e00b55a7174da329563a51e10c3ff

5 years agoMerge "Fix BT a bad/ out of bounds array read"
Sal Savage [Mon, 14 Jan 2019 22:12:00 +0000 (14:12 -0800)]
Merge "Fix BT a bad/ out of bounds array read"
am: 7da7696e07

Change-Id: Idca50acaa84f59f95800e94a846247824d0341ef

5 years agoSnap for 5230900 from aa9c1b4abdb2ca7beea467f7be82e83363a32b11 to pi-platform-release
android-build-team Robot [Mon, 14 Jan 2019 22:03:03 +0000 (22:03 +0000)]
Snap for 5230900 from aa9c1b4abdb2ca7beea467f7be82e83363a32b11 to pi-platform-release

Change-Id: I50623117c36dbe20a0c8d120a7115628a2f53566

5 years agoMerge "Fix BT a bad/ out of bounds array read"
Sal Savage [Mon, 14 Jan 2019 21:43:55 +0000 (21:43 +0000)]
Merge "Fix BT a bad/ out of bounds array read"

5 years agoMerge "SMP: Fix invalid auth_req in LE Security Request handler" am: 6ab305324d
Manoj Babulal [Mon, 14 Jan 2019 14:34:57 +0000 (06:34 -0800)]
Merge "SMP: Fix invalid auth_req in LE Security Request handler" am: 6ab305324d
am: 7510bae535

Change-Id: Idf624b3c261f06f82089f81c718390eee691ba15

5 years agoMerge "SMP: Fix invalid auth_req in LE Security Request handler"
Manoj Babulal [Mon, 14 Jan 2019 14:29:36 +0000 (06:29 -0800)]
Merge "SMP: Fix invalid auth_req in LE Security Request handler"
am: 6ab305324d

Change-Id: I408779f11d8778ebd188239e6a5f21e30d0f8f51

5 years agoMerge "SMP: Fix invalid auth_req in LE Security Request handler"
Treehugger Robot [Mon, 14 Jan 2019 14:23:01 +0000 (14:23 +0000)]
Merge "SMP: Fix invalid auth_req in LE Security Request handler"

5 years agoDo not crash on LE Create Connection "Command Disallowed" am: 9d52abf4d4
Jakub Pawlowski [Mon, 14 Jan 2019 09:56:58 +0000 (01:56 -0800)]
Do not crash on LE Create Connection "Command Disallowed" am: 9d52abf4d4
am: fa5ea4cb1b

Change-Id: I5acfc319065ed6d2e2e30c769c826f8036b6e1f9

5 years agoDo not crash on LE Create Connection "Command Disallowed"
Jakub Pawlowski [Mon, 14 Jan 2019 09:32:03 +0000 (01:32 -0800)]
Do not crash on LE Create Connection "Command Disallowed"
am: 9d52abf4d4

Change-Id: Ie2db913998282a20ccf66406ada730347f240e5f

5 years agoDo not crash on LE Create Connection "Command Disallowed"
Jakub Pawlowski [Thu, 3 Jan 2019 14:13:11 +0000 (15:13 +0100)]
Do not crash on LE Create Connection "Command Disallowed"

Being in "Connecting" used to mean we are either doing direct
connection, or background connection procedure. Now we have just one
connection procedure. This means there is no ambiguity when the
controller responds with "Command Disallowed" - we know exactly which
state to go back to.

Bug: 110412113
Bug: 112827989
Test: there is no test, or reproduction scenarion to verify that
      Ran GattConnectTest for sanity

Change-Id: I9ed1cdc7ae4032cda4e8a166310eca0004c7f9dc

5 years agoSMP: Fix invalid auth_req in LE Security Request handler
Manoj Babulal [Thu, 27 Dec 2018 10:43:19 +0000 (02:43 -0800)]
SMP: Fix invalid auth_req in LE Security Request handler

Due to wrong pointer de-reference, auth_req value read
in smp_proc_sec_req (LE Security Request packet handler)
was invalid.

Logcat trace shows invalid auth_req value:
.. bt_smp  : smp_proc_sec_req: auth_req=0xf9
   ....
.. bt_smp  : smp_proc_sec_req: auth_req=0xe9

After the fix, auth_req value is correct:
.. bt_smp  : smp_proc_sec_req: auth_req=0x1
   ....
.. bt_smp  : smp_proc_sec_req: auth_req=0x5

This data flow can be traced in code on this path:
smp_data_received -> smp_sm_event -> smp_proc_sec_req

Issue seen after following change:
https://android-review.googlesource.com/c/platform/system/bt/+/492442

Issue was discovered during execution of PTS test
cases GAP/SEC/AUT/BV-13-C and GAP/SEC/AUT/BV-14-C.

Fixes: 122066779

Test: Verified logcat trace shows valid auth_req
value prints from smp_proc_sec_req() function

Change-Id: I072b4794fb56a05b7ac7f2f4ca606514d7524550

5 years agoJanuary Pi-platform-release merges
Adam Seaton [Fri, 11 Jan 2019 22:55:24 +0000 (22:55 +0000)]
January Pi-platform-release merges

Change-Id: Id66375f8b1f3329e82df3d0fdb06917c065209de

5 years agoFix BT a bad/ out of bounds array read
Sal Savage [Wed, 9 Jan 2019 20:50:07 +0000 (12:50 -0800)]
Fix BT a bad/ out of bounds array read

Bug: 121375525
Test: Used automotive hardware and verified that pairing and media
      streaming and control still work and crashes no longer happen.
Change-Id: I3476425131718aded980f57a8b9be92a8e9f9d3b

5 years agoFix potential NULL dereference in smp_proc_confirm am: 3c3fbd869f
Jakub Pawlowski [Fri, 11 Jan 2019 17:01:12 +0000 (09:01 -0800)]
Fix potential NULL dereference in smp_proc_confirm am: 3c3fbd869f
am: c92f39f7bd

Change-Id: Ibaa9eb509f5228b00f6474bef190dced059b1662

5 years agoFix potential NULL dereference in smp_proc_confirm
Jakub Pawlowski [Fri, 11 Jan 2019 16:55:05 +0000 (08:55 -0800)]
Fix potential NULL dereference in smp_proc_confirm
am: 3c3fbd869f

Change-Id: I1b3175cb9a393da80adc52c886993af89788e48c

5 years agoFix potential NULL dereference in smp_proc_confirm
Jakub Pawlowski [Fri, 11 Jan 2019 12:43:33 +0000 (13:43 +0100)]
Fix potential NULL dereference in smp_proc_confirm

Bug: 122102910
Test: compilation
Change-Id: Idd16e1c1924165924847f1aad64ddd44a8a1b8ab