OSDN Git Service

android-x86/system-bt.git
6 years ago[automerger skipped] DO NOT MERGE - Check AVRCP data length when parsing inside avrc_...
Pavlin Radoslavov [Fri, 7 Sep 2018 16:34:46 +0000 (09:34 -0700)]
[automerger skipped] DO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp() am: 2692408d05 am: 90d9589f1e am: 746df692f0  -s ours
am: d3dfe42b4c

Change-Id: I179cf05b99dee0bb34fb30fc4732413c297c7523

6 years agoCheck AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()
Pavlin Radoslavov [Fri, 7 Sep 2018 16:34:13 +0000 (09:34 -0700)]
Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()
am: f779ebe368

Change-Id: Ib07b842d6f4c485a400ef451f81e00b1b331510c

6 years ago[automerger skipped] DO NOT MERGE - Check AVRCP data length when parsing inside avrc_...
Pavlin Radoslavov [Fri, 7 Sep 2018 16:33:18 +0000 (09:33 -0700)]
[automerger skipped] DO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp() am: 2692408d05 am: 90d9589f1e
am: 746df692f0  -s ours

Change-Id: Iaf0899a8521801655b7e1f6e675d9e809739af06

6 years agoDO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp...
Pavlin Radoslavov [Fri, 7 Sep 2018 16:28:22 +0000 (09:28 -0700)]
DO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp() am: 2692408d05
am: 90d9589f1e

Change-Id: I22b0622f5496f5ee8e3de7d95734e0112ba6913f

6 years agoDO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()
Pavlin Radoslavov [Fri, 7 Sep 2018 16:25:17 +0000 (09:25 -0700)]
DO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()
am: 2692408d05

Change-Id: I8c19a5d6eb81e758430707f203c1d75e46f8d064

6 years agoAllocate lcb when connection complete if can't find one am: d53036302e
Chienyuan [Fri, 7 Sep 2018 04:48:15 +0000 (21:48 -0700)]
Allocate lcb when connection complete if can't find one am: d53036302e
am: d1ce1d55d5

Change-Id: I7aa070e7ad029b485abe5a600cb7759cd6aa6b44

6 years agoAllocate lcb when connection complete if can't find one
Chienyuan [Fri, 7 Sep 2018 04:43:11 +0000 (21:43 -0700)]
Allocate lcb when connection complete if can't find one
am: d53036302e

Change-Id: Ic79e372fd5f24ae9b82707b1ffe487047d51bdd0

6 years agoDO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()
Pavlin Radoslavov [Thu, 6 Sep 2018 22:41:27 +0000 (15:41 -0700)]
DO NOT MERGE - Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()

Bug: 111450417
Test: PoC test program
Change-Id: Idd619e52dc7a2944d0d08af824505580e299c163

6 years agoMerge "HID Device: Fix OOB in register_app" into pi-dev
Hansong Zhang [Fri, 7 Sep 2018 00:14:46 +0000 (17:14 -0700)]
Merge "HID Device: Fix OOB in register_app" into pi-dev
am: 01792e7a0e

Change-Id: I03bb0a1f7168278a76529108752fd559451af030

6 years agoCheck AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()
Pavlin Radoslavov [Thu, 6 Sep 2018 22:41:27 +0000 (15:41 -0700)]
Check AVRCP data length when parsing inside avrc_ctrl_pars_vendor_rsp()

Bug: 111450417
Test: PoC test program
Change-Id: Idd619e52dc7a2944d0d08af824505580e299c163
(cherry picked from commit 1c14e10cac53d5a5724dcf34c5679ad8819f9442)

6 years agoMerge "HID Device: Fix OOB in register_app" into pi-dev
TreeHugger Robot [Thu, 6 Sep 2018 23:22:29 +0000 (23:22 +0000)]
Merge "HID Device: Fix OOB in register_app" into pi-dev

6 years agoHID Device: Fix OOB in register_app
Hansong Zhang [Wed, 5 Sep 2018 23:39:16 +0000 (16:39 -0700)]
HID Device: Fix OOB in register_app

Bug: 113037220
Bug: 113111784
Test: manual
Change-Id: I91bcd5032959458b926c479160c7e391b8de313b

6 years agoAllocate lcb when connection complete if can't find one
Chienyuan [Wed, 29 Aug 2018 05:38:19 +0000 (13:38 +0800)]
Allocate lcb when connection complete if can't find one

When BT stack sends create connection command and receive connection
request at the same time, connection request will reuse the link control
block created by create connection command. But the link control block
will be released before connection complete due to controller busy.

Bug:112818458
Test: manual - turn on BT and turn on Headset within little time gap
Change-Id: Ie30c655b933250f1709ba10c578ea5f30ea13139

6 years agoImplement A2DP source and AVRCP target binder servers am: 780e29c219
Bailey Forrest [Wed, 29 Aug 2018 23:33:42 +0000 (16:33 -0700)]
Implement A2DP source and AVRCP target binder servers am: 780e29c219
am: 5521ed18fe

Change-Id: I4b77b2a4f4f09b3766e03a4c031828e429cb4839

6 years agoImplement A2DP source and AVRCP target binder servers
Bailey Forrest [Wed, 29 Aug 2018 23:29:33 +0000 (16:29 -0700)]
Implement A2DP source and AVRCP target binder servers
am: 780e29c219

Change-Id: I9cbeafd80df6fb0a2502418e51bb080b0595b946

6 years agoImplement A2DP source and AVRCP target binder servers
Bailey Forrest [Wed, 22 Aug 2018 00:20:29 +0000 (17:20 -0700)]
Implement A2DP source and AVRCP target binder servers

Bug: 64231556
Test: On device.
Change-Id: I57136d5550e8e52626a1e7eb26b7d8c02cd94eb5

6 years agoMerge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS" am: 91de25f4a5
Bailey Forrest [Wed, 29 Aug 2018 00:41:00 +0000 (17:41 -0700)]
Merge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS" am: 91de25f4a5
am: a414c157c0

Change-Id: Ie9cb0e27d035e4c7d7f51b4dc420aa9690a90ed5

6 years agoMerge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS"
Bailey Forrest [Wed, 29 Aug 2018 00:36:55 +0000 (17:36 -0700)]
Merge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS"
am: 91de25f4a5

Change-Id: Ied8af7dd57085e9fef09ee9850619f1b689018f2

6 years agoFix out-of-bounds reading in btm_ble_vendor_capability_vsc_cmpl_cback am: 224eff1163
Yamei Du [Wed, 29 Aug 2018 00:36:55 +0000 (17:36 -0700)]
Fix out-of-bounds reading in btm_ble_vendor_capability_vsc_cmpl_cback am: 224eff1163
am: f99e2dba25

Change-Id: I425e5a8da376585a0df70ca4bc94d726bbb77e2e

6 years agoFix out-of-bounds reading in btm_ble_vendor_capability_vsc_cmpl_cback
Yamei Du [Wed, 29 Aug 2018 00:32:51 +0000 (17:32 -0700)]
Fix out-of-bounds reading in btm_ble_vendor_capability_vsc_cmpl_cback
am: 224eff1163

Change-Id: I43eb49485b08bc55eab808221b3915cc0df7da11

6 years agoMerge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS"
Treehugger Robot [Wed, 29 Aug 2018 00:32:15 +0000 (00:32 +0000)]
Merge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS"

6 years agoFix out-of-bounds reading in btm_ble_vendor_capability_vsc_cmpl_cback
Yamei Du [Mon, 11 Sep 2017 11:10:47 +0000 (19:10 +0800)]
Fix out-of-bounds reading in btm_ble_vendor_capability_vsc_cmpl_cback

8 bits parameters get 16 bits from buffer in btm_ble_vendor_
capability_vsc_cmpl_cback, which would cause out-of-bounds reading.
Correct STREAM_TO_UINT16 to STREAM_TO_UINT8

Test: manual
Bug: 112167084
Change-Id: Id2b71a8f74eee5d93f287d4705aadab449c55fce

6 years agoDon't add items to a response if a previous item fails to be added am: 7f29cc5ce2
Ajay Panicker [Tue, 28 Aug 2018 20:20:55 +0000 (13:20 -0700)]
Don't add items to a response if a previous item fails to be added am: 7f29cc5ce2
am: a6ac1493e7

Change-Id: I2a7c1b6b5a407bc9bb4416f091e8fc530cc61008

6 years agoDon't add items to a response if a previous item fails to be added
Ajay Panicker [Tue, 28 Aug 2018 20:06:36 +0000 (13:06 -0700)]
Don't add items to a response if a previous item fails to be added
am: 7f29cc5ce2

Change-Id: I1b56c78e07e5bdf8f2f7b5f440be6c32aecbbc72

6 years agoMerge "Set the AVRCP Browsing MTU for a device after browse open" am: 6002df2ff2
Ajay Panicker [Tue, 28 Aug 2018 19:57:59 +0000 (12:57 -0700)]
Merge "Set the AVRCP Browsing MTU for a device after browse open" am: 6002df2ff2
am: 16d6ebc7d3

Change-Id: Ia5eec4b42696be63342ad1836316e55e126fdeb7

6 years agoMake thread names more meaningful am: 96d16e38ae
Jack He [Tue, 28 Aug 2018 19:52:13 +0000 (12:52 -0700)]
Make thread names more meaningful am: 96d16e38ae
am: 5861bf3732

Change-Id: Id261b2d0886d9be5bd409bd96e6126000b7b13cf

6 years agoDon't add items to a response if a previous item fails to be added
Ajay Panicker [Wed, 22 Aug 2018 23:24:03 +0000 (16:24 -0700)]
Don't add items to a response if a previous item fails to be added

Bug: 112164711
Test: Run native test net_test_avrcp
Change-Id: Iace287bb716b28eda62a8a0500deb99cc46ae485

6 years agoMerge "Set the AVRCP Browsing MTU for a device after browse open"
Ajay Panicker [Tue, 28 Aug 2018 19:22:18 +0000 (12:22 -0700)]
Merge "Set the AVRCP Browsing MTU for a device after browse open"
am: 6002df2ff2

Change-Id: I340a9f20348fb588fa9feac2cc327e1b8f649387

6 years agoMake thread names more meaningful
Jack He [Tue, 28 Aug 2018 19:01:37 +0000 (12:01 -0700)]
Make thread names more meaningful
am: 96d16e38ae

Change-Id: Ie00925ac157fc98280eb2e519f357ebc22b9f12b

6 years agoMerge "Set the AVRCP Browsing MTU for a device after browse open"
Treehugger Robot [Tue, 28 Aug 2018 18:38:17 +0000 (18:38 +0000)]
Merge "Set the AVRCP Browsing MTU for a device after browse open"

6 years agoSet the AVRCP Browsing MTU for a device after browse open
Ajay Panicker [Fri, 24 Aug 2018 17:32:07 +0000 (10:32 -0700)]
Set the AVRCP Browsing MTU for a device after browse open

Trying to get the Browsing MTU before the Browsing channel is opened
returns the minimum MTU. This leads to smaller browsing messages than
expected.

Bug: 113160447
Test: Connect to device and see that Avrcp Browse packets are the
correct size

Change-Id: Iefda855d0a777439a8a6829619bc4c5543b62eaf

6 years agoCommon: Replace ExecutionBarrier with std::promise and std::future am: f607f2d1a4
Jack He [Tue, 28 Aug 2018 01:33:09 +0000 (18:33 -0700)]
Common: Replace ExecutionBarrier with std::promise and std::future am: f607f2d1a4
am: 4600d63c88

Change-Id: Ibcaa788024472424d5121b26239e2281ede6209c

6 years agoCommon: Replace ExecutionBarrier with std::promise and std::future
Jack He [Tue, 28 Aug 2018 01:29:05 +0000 (18:29 -0700)]
Common: Replace ExecutionBarrier with std::promise and std::future
am: f607f2d1a4

Change-Id: I9e48df80f044f702c8819d1f7ebe3e62a78f2655

6 years agoMake thread names more meaningful
Jack He [Mon, 27 Aug 2018 20:55:14 +0000 (13:55 -0700)]
Make thread names more meaningful

* Rename threads:
  - module_wrapper -> bt_module_lifecycle_thread
  - btif_a2dp_sink_worker_thread -> bt_a2dp_sink_worker_thread
  - btif_a2dp_source_thread -> bt_a2dp_source_worker_thread
  - bt_jni_workqueue -> bt_jni_thread
  - stack_manager -> bt_stack_manager_thread
  - hci_thread -> bt_hci_thread
  - bt_workqueue -> bt_startup_thread
  - btu_message_loop -> bt_main_thread
* Rename functions:
  - do_in_bta_thread -> do_in_main_thread
  - get_message_loop -> get_main_message_loop
  - post_to_hci_message_loop -> post_to_main_message_loop
* Refactored bta_sys_sendmsg

Bug: 110303473
Test: make, unit test, stream music
Change-Id: I3051f6ea2d33db37af8eebafba7db4d1e113f611

6 years agoCommon: Replace ExecutionBarrier with std::promise and std::future
Jack He [Sat, 25 Aug 2018 00:14:10 +0000 (17:14 -0700)]
Common: Replace ExecutionBarrier with std::promise and std::future

* std::promise and std::future are able to achieve the same
  functionalities of ExecutionBarrier with extra flexibility
* Replace "_barrier" with "_promise" in system/bt/common

Bug: 110303473
Fixes: 112159657
Test: mm -j40, unit test
Change-Id: I2a420bbf16bf92e4b3dd256d9f23480fc2be7be1

6 years agoRun the wakelock JNI callbacks on the JNI thread am: c788ad7038
Pavlin Radoslavov [Mon, 27 Aug 2018 20:46:32 +0000 (13:46 -0700)]
Run the wakelock JNI callbacks on the JNI thread am: c788ad7038
am: 9f1fcda634

Change-Id: I3c5e817905d2e05403d0a43a3f35231fd19e367e

6 years agoRun the wakelock JNI callbacks on the JNI thread
Pavlin Radoslavov [Mon, 27 Aug 2018 20:42:57 +0000 (13:42 -0700)]
Run the wakelock JNI callbacks on the JNI thread
am: c788ad7038

Change-Id: I95f2f701a2ebb3c5f28e8f2bbae06e553a8dbd55

6 years agoMerge "Move metrics and time library to libbt-common" am: 0cdc006666
Jack He [Mon, 27 Aug 2018 19:41:29 +0000 (12:41 -0700)]
Merge "Move metrics and time library to libbt-common" am: 0cdc006666
am: dfe2e0758a

Change-Id: I16309df0ce191c429359470b52c4ac099f8884ea

6 years agoMerge "Move metrics and time library to libbt-common"
Jack He [Mon, 27 Aug 2018 19:37:25 +0000 (12:37 -0700)]
Merge "Move metrics and time library to libbt-common"
am: 0cdc006666

Change-Id: I8aeac160d9b537ecdcd92836d7c36f1e26b215e1

6 years agoRun the wakelock JNI callbacks on the JNI thread
Pavlin Radoslavov [Sat, 25 Aug 2018 01:45:16 +0000 (18:45 -0700)]
Run the wakelock JNI callbacks on the JNI thread

All JNI callbacks must be on the JNI thread, otherwise this could
impact the threads' operation.

Bug: 111277984
Test: A2DP streaming
Change-Id: I94fa4500aea62a574c80749e904434e46eb4e942

6 years agoMerge "Move metrics and time library to libbt-common"
Treehugger Robot [Mon, 27 Aug 2018 19:03:21 +0000 (19:03 +0000)]
Merge "Move metrics and time library to libbt-common"

6 years agoMove metrics and time library to libbt-common
Jack He [Wed, 15 Aug 2018 19:38:37 +0000 (12:38 -0700)]
Move metrics and time library to libbt-common

* libbt-osi is being deprecated and libbt-common will replace it
* Move recently implemented metrics library to libbt-common
* Move time library from libbt-osi to libbt-common and renamed as time_util
  to avoid potention name collision with system time libraries
* Need to keep time library for now because we need to use
  CLOCK_BOOTTIME that include system suspension time for A2DP encoding
* Use libchrome logging methods in metrics library
* Put both metrics and time_util into bluetooth::common namespace
* Return uint64_t for time_get_os_boottime_ms and update various
  receiver types
* Remove tBTM_CB.max_collision_delay and use the constant
  BTM_SEC_MAX_COLLISION_DELAY instead

Bug: 111568640
Test: mm -j40, unit test, stream music
Change-Id: I8c384a810d592bb6b9eb322134e947d066489ba4

6 years agoFix V535 CWE-691: inner/outer for loop sharing variables am: 7cedf6e5c7
Ruchi Kandoi [Sun, 26 Aug 2018 21:02:59 +0000 (14:02 -0700)]
Fix V535 CWE-691: inner/outer for loop sharing variables am: 7cedf6e5c7
am: 7fdfaf2fa1

Change-Id: I6d1c17c7dd6721cb7ed541b1b26b9816789a120a

6 years agoFix V535 CWE-691: inner/outer for loop sharing variables
Ruchi Kandoi [Sun, 26 Aug 2018 20:58:35 +0000 (13:58 -0700)]
Fix V535 CWE-691: inner/outer for loop sharing variables
am: 7cedf6e5c7

Change-Id: I62c000ac87b56b2d59f4054e57c12126ad653abc

6 years agoFix V535 CWE-691: inner/outer for loop sharing variables
Ruchi Kandoi [Fri, 17 Aug 2018 20:30:06 +0000 (13:30 -0700)]
Fix V535 CWE-691: inner/outer for loop sharing variables

Test: compiles
Bug: 112146072
Change-Id: Ie9e10d727edc652865458298cb59a24ac5732c98

6 years ago[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS
Bailey Forrest [Sat, 25 Aug 2018 00:04:00 +0000 (17:04 -0700)]
[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS

BT_PROPERTY_UUIDS returns an array of UUID objects

Bug: None
Test: Manual
Change-Id: I9ace472b8bddb5823dc7309528d94faba3d0dfe2

6 years agoMerge "L2CAP: Handle no idle timeout (0xFFFF)" am: 4e9717ed2d
Nitin Shivpure [Thu, 23 Aug 2018 23:07:43 +0000 (16:07 -0700)]
Merge "L2CAP: Handle no idle timeout (0xFFFF)" am: 4e9717ed2d
am: 9dddf9f7be

Change-Id: I67c0eb42639400c6c2c11bfad91e84a3b8515b35

6 years agoMerge "L2CAP: Handle no idle timeout (0xFFFF)"
Nitin Shivpure [Thu, 23 Aug 2018 23:03:57 +0000 (16:03 -0700)]
Merge "L2CAP: Handle no idle timeout (0xFFFF)"
am: 4e9717ed2d

Change-Id: Ia77d3021fc07af620abd706d9fdd83dbd3754424

6 years agoMerge "L2CAP: Handle no idle timeout (0xFFFF)"
Treehugger Robot [Thu, 23 Aug 2018 22:54:16 +0000 (22:54 +0000)]
Merge "L2CAP: Handle no idle timeout (0xFFFF)"

6 years agoClear connection update pending flag when disconnected am: 54e8b72a50
Stanley Tng [Thu, 23 Aug 2018 22:03:41 +0000 (15:03 -0700)]
Clear connection update pending flag when disconnected am: 54e8b72a50
am: ba4ea1f575

Change-Id: If4ab0c796fb4812e44f2b24df5d513f2195d06fc

6 years agoClear connection update pending flag when disconnected
Stanley Tng [Thu, 23 Aug 2018 21:53:24 +0000 (14:53 -0700)]
Clear connection update pending flag when disconnected
am: 54e8b72a50

Change-Id: Ia60a75778714b48f038c2de77f239f16e3149255

6 years agoL2CAP: Handle no idle timeout (0xFFFF)
Nitin Shivpure [Mon, 30 Jul 2018 12:44:54 +0000 (18:14 +0530)]
L2CAP: Handle no idle timeout (0xFFFF)

Precondition:
1. DUT acts as GATT server.
2. Remote acts as Gatt Client

Use case:
1. Remote device starts BLE scan
2. Remote device connects to DUT
3. Remote device keeps on sending notifications to DUT

Expected result:
Connection should be active after 18 hours

Observed Result:
Connection is dropped after 18 hours due to l2c_link_timeout.

Root Cause:
L2CAP is not properly handling no idle timeout(0xFFFF) and 65535000 ms
timer gets started after BLE connection, leading to connection getting dropped
after 18 hours.

Fix:
If there is no L2CAP dynamic ccb and no idle timeout is configured for
GATT or any other fixed  channel, then cancel existing LCB timer.

Test: No BLE disconnection seen after 18 hours

Bug: 112249120
Change-Id: I58766564cf62efb7af0869035115459bae37c558

6 years agoClear connection update pending flag when disconnected
Stanley Tng [Wed, 22 Aug 2018 21:43:57 +0000 (14:43 -0700)]
Clear connection update pending flag when disconnected

For the hearing aid profile and when we get disconnection
while there is a pending connection update, then clear the flag so that
the next connection update can proceed.

Bug: 112050972
Test: Manual test to check for regressions
Change-Id: I54635a680cf276cf6c9f94520943c3efa97e77ec

6 years ago[automerger skipped] Fix "Disable Absolute Volume" Bluetooth develop option work
Ted [Wed, 22 Aug 2018 22:41:54 +0000 (15:41 -0700)]
[automerger skipped] Fix "Disable Absolute Volume" Bluetooth develop option work
am: 1ccb7c3489  -s ours

Change-Id: I1b639880570b893f7d91baa5461fe5c26d0a0718

6 years agoMerge "A2DP-SINK: Use MessageLoopThread for decoding" am: 376b8cf273
Jack He [Wed, 22 Aug 2018 08:29:07 +0000 (01:29 -0700)]
Merge "A2DP-SINK: Use MessageLoopThread for decoding" am: 376b8cf273
am: 75d95ba6ba

Change-Id: If3da028e019d4e9910f25b9692471e96f0bce6e7

6 years agoMerge "A2DP-SINK: Use MessageLoopThread for decoding"
Jack He [Wed, 22 Aug 2018 01:24:32 +0000 (18:24 -0700)]
Merge "A2DP-SINK: Use MessageLoopThread for decoding"
am: 376b8cf273

Change-Id: I5a76fcc2c44dabcb553fc52acf79f57c3885bce3

6 years agoMerge "A2DP-SINK: Use MessageLoopThread for decoding"
Treehugger Robot [Tue, 21 Aug 2018 23:47:01 +0000 (23:47 +0000)]
Merge "A2DP-SINK: Use MessageLoopThread for decoding"

6 years agoMerge "Fix "Disable Absolute Volume" Bluetooth developer option" am: 4de73dae02
Ted Wang [Tue, 21 Aug 2018 03:59:33 +0000 (20:59 -0700)]
Merge "Fix "Disable Absolute Volume" Bluetooth developer option" am: 4de73dae02
am: 8bdbab4380

Change-Id: Id8c1b39f917acbe949ee433d977ee6dc2c3d4bb1

6 years agoFix "Disable Absolute Volume" Bluetooth develop option work
Ted [Fri, 17 Aug 2018 10:49:37 +0000 (18:49 +0800)]
Fix "Disable Absolute Volume" Bluetooth develop option work

Do not report device support absolute volume while
"Disable Absolute Volume" in developer option is enabled or
the remote device is listed in the interoperability database.

Test: manually adjust volume when Disable Absolute Volume is enabled
Bug: 112193362
Change-Id: Id63a22dba0d8a871035774fc86b66d32e9225b48
Merged-In: Id63a22dba0d8a871035774fc86b66d32e9225b48

6 years agoMerge "Fix "Disable Absolute Volume" Bluetooth developer option"
Ted Wang [Tue, 21 Aug 2018 03:32:28 +0000 (20:32 -0700)]
Merge "Fix "Disable Absolute Volume" Bluetooth developer option"
am: 4de73dae02

Change-Id: I8a1dd33fef1588126748a69ca57ab4e6839cc89a

6 years agoMerge "Fix "Disable Absolute Volume" Bluetooth developer option"
Ted Wang [Tue, 21 Aug 2018 02:32:49 +0000 (02:32 +0000)]
Merge "Fix "Disable Absolute Volume" Bluetooth developer option"

6 years agoDisable CFI verification for stack_rfcomm test that uses gtest+gmock am: baa8df4f57
Jack He [Tue, 21 Aug 2018 02:13:26 +0000 (19:13 -0700)]
Disable CFI verification for stack_rfcomm test that uses gtest+gmock am: baa8df4f57
am: e25d36e3ba

Change-Id: If43d7d15b79303be222c86322a2b6593740b73b5

6 years agoDisable CFI verification for stack_rfcomm test that uses gtest+gmock
Jack He [Tue, 21 Aug 2018 01:23:24 +0000 (18:23 -0700)]
Disable CFI verification for stack_rfcomm test that uses gtest+gmock
am: baa8df4f57

Change-Id: Ibc40188504563046a945e0d0840b3b978c2d8f11

6 years agoDisable CFI verification for stack_rfcomm test that uses gtest+gmock
Jack He [Mon, 20 Aug 2018 22:46:24 +0000 (15:46 -0700)]
Disable CFI verification for stack_rfcomm test that uses gtest+gmock

Apparently, the CFI verification crashes unit tests that
are using gtest+gmock. Interestingly, those tests succeed for 32-bit
binaries, and fail for 64-bit binaries.

Bug: 71739588
Test: Running the 64-bit version of the unit tests in test/run_unit_tests.sh
Change-Id: Ic950087181a86d08af1b858272e946ef4125b78a

6 years agoA2DP-SINK: Use MessageLoopThread for decoding
Jack He [Thu, 16 Aug 2018 08:29:50 +0000 (01:29 -0700)]
A2DP-SINK: Use MessageLoopThread for decoding

* Instead of OSI thread, use MessageLoopThread for decoding
* Similar to A2DP source
* Change tBTIF_A2DP_SINK_CB into a proper class BtifA2dpSinkControlBlock
* Initialize variables in BtifA2dpSinkControlBlock's constructor
* Free un-freed variables in BtifA2dpSinkControlBlock::Reset() method

Bug: 110303473
Test: mm -j40, unit test, stream music
Change-Id: I21f5b0c9f88d2cadada6fc854070d31ac378244f

6 years agoFix "Disable Absolute Volume" Bluetooth developer option
Ted [Fri, 17 Aug 2018 10:49:37 +0000 (18:49 +0800)]
Fix "Disable Absolute Volume" Bluetooth developer option

Do not report device support absolute volume while
"Disable Absolute Volume" in developer option is enabled or
the remote device is listed in the interoperability database.

Test: manually adjust volume when Disable Absolute Volume is enabled
Bug: 112193362
Change-Id: Id63a22dba0d8a871035774fc86b66d32e9225b48

6 years agoA2DP Offload: Fix Max AVDTP MTU for Offload am: e42bc5bb99
Sunny Kapdi [Mon, 20 Aug 2018 06:05:16 +0000 (23:05 -0700)]
A2DP Offload: Fix Max AVDTP MTU for Offload am: e42bc5bb99
am: 8bbd39de33

Change-Id: Ic5b3829ffaa6fd8abfba5b555cfa75e52b3e9fea

6 years agoA2DP Offload: Fix Max AVDTP MTU for Offload
Sunny Kapdi [Mon, 20 Aug 2018 06:01:28 +0000 (23:01 -0700)]
A2DP Offload: Fix Max AVDTP MTU for Offload
am: e42bc5bb99

Change-Id: I91c9db05409352fe64f2c47f7b3608959760d0c2

6 years agoA2DP Offload: Fix Max AVDTP MTU for Offload
Sunny Kapdi [Thu, 5 Jul 2018 21:31:21 +0000 (14:31 -0700)]
A2DP Offload: Fix Max AVDTP MTU for Offload

Fix the max AVDTP MTU for Offload to what
can fit in a 3DH5 packet after accounting
for AVDTP and L2CAP header.

Also:
 - Moved MAX_2MBPS_AVDTP_MTU and MAX_3MBPS_AVDTP_MTU to the common
   avdt_api.h so it can be used by the rest of the code
 - Removed previously incorrect value of BTA_AV_MAX_A2DP_MTU and
   replace it with the new (correct) value of MAX_3MBPS_AVDTP_MTU
 - Removed duplicate define of MAX_2MBPS_AVDTP_MTU and use
   the one from avdt_api.h

Bug: 78907438
Test: A2DP Streaming
Change-Id: I2c60c34c33e4164c9f7e2e7362bbb600482dec97

6 years agoMerge "Implement A2DP sink and AVRCP controller binder server" am: bb216d2135
Bailey Forrest [Sat, 18 Aug 2018 20:29:10 +0000 (13:29 -0700)]
Merge "Implement A2DP sink and AVRCP controller binder server" am: bb216d2135
am: b849a93e8f

Change-Id: Ib35564311cc8b52b2ff186b03d63e000adfb30d6

6 years agoMerge "Implement A2DP sink and AVRCP controller binder server"
Bailey Forrest [Sat, 18 Aug 2018 20:25:10 +0000 (13:25 -0700)]
Merge "Implement A2DP sink and AVRCP controller binder server"
am: bb216d2135

Change-Id: Ic620184565246aa4a3b2f20df4bfcc39f5a3e395

6 years agoMerge "Implement A2DP sink and AVRCP controller binder server"
Treehugger Robot [Sat, 18 Aug 2018 20:18:39 +0000 (20:18 +0000)]
Merge "Implement A2DP sink and AVRCP controller binder server"

6 years agoImplement A2DP sink and AVRCP controller binder server
Bailey Forrest [Tue, 31 Jan 2017 01:38:58 +0000 (17:38 -0800)]
Implement A2DP sink and AVRCP controller binder server

Also added bonded device management because this is needed for A2DP to
work with most devices.

Bug: 32657860
Test: Run on device, modified tests pass.
Change-Id: I862e41b6594b7cec9f61094d300577574cc8bbc6

6 years agoMerge "Replace period_ms_t with uint64_t" am: e0fc57522f
Jack He [Sat, 18 Aug 2018 02:25:12 +0000 (19:25 -0700)]
Merge "Replace period_ms_t with uint64_t" am: e0fc57522f
am: 73d409b888

Change-Id: I616678dc196caa8097cafe9ed74a421bbc9431ae

6 years agoMerge "Replace period_ms_t with uint64_t"
Jack He [Sat, 18 Aug 2018 02:08:11 +0000 (19:08 -0700)]
Merge "Replace period_ms_t with uint64_t"
am: e0fc57522f

Change-Id: Ia0e930e8efe1a6c14f3073d65eb130b68de48db2

6 years agoMerge "Replace period_ms_t with uint64_t"
Treehugger Robot [Sat, 18 Aug 2018 00:30:46 +0000 (00:30 +0000)]
Merge "Replace period_ms_t with uint64_t"

6 years agoReplace period_ms_t with uint64_t
Jack He [Thu, 16 Aug 2018 05:17:23 +0000 (22:17 -0700)]
Replace period_ms_t with uint64_t

* There is no need to define a unit for millisecond in our system since
  uint64_t is the largest integer that is supported
* period_ms_t results in many unnecessary dependency on
  osi/include/time.h
* Used text editor to do the directory wise replacement, basically
    sed -i 's/period_ms_t/uint64_t/g' *
* Need to modify several method and variable names to indicate that they
  are using millisecond as time unit

Bug: 110303473
Test: build, no functional change as period_ms_t was a typedef of
      uint64_t

Change-Id: I497c9a146a97bab7c7477b358847dad958b92034

6 years agoMerge "HID: Remove device from database in error case" am: 8a227452d1
Hemant Gupta [Fri, 17 Aug 2018 00:44:32 +0000 (17:44 -0700)]
Merge "HID: Remove device from database in error case" am: 8a227452d1
am: 51ac073266

Change-Id: Id0b38e46d26f341e34b5756ac0e6f603b426972b

6 years agoFix wrong UUID mask when doing BLE filter scan
Ugo Yu [Fri, 17 Aug 2018 00:33:34 +0000 (17:33 -0700)]
Fix wrong UUID mask when doing BLE filter scan
am: f827e9fc32

Change-Id: I98baeb41a2bdeafe7164a2c756b1931e593e9733

6 years agoMerge "HID: Remove device from database in error case"
Hemant Gupta [Thu, 16 Aug 2018 23:52:28 +0000 (16:52 -0700)]
Merge "HID: Remove device from database in error case"
am: 8a227452d1

Change-Id: I307b1671a86485b4f17dd254f49cdc91ad96bf34

6 years agoMerge "HID: Remove device from database in error case"
Treehugger Robot [Thu, 16 Aug 2018 18:27:34 +0000 (18:27 +0000)]
Merge "HID: Remove device from database in error case"

6 years agoMerge "Enable SNIFF mode for HFP" am: 156fefcad7
Ugo Yu [Wed, 15 Aug 2018 07:59:17 +0000 (00:59 -0700)]
Merge "Enable SNIFF mode for HFP" am: 156fefcad7
am: b61c633b2e

Change-Id: Iac9c3a97077831e8df03d46f0da92b24221ae020

6 years agoMerge "Fix reliable write." am: 8f19e1179e
Qiyu Hu [Wed, 15 Aug 2018 07:58:36 +0000 (00:58 -0700)]
Merge "Fix reliable write." am: 8f19e1179e
am: 7ce911f7bb

Change-Id: I4380e2b6b2c94d7c1c9469ef06f333ab1c305509

6 years agoMerge "HFP: Only active BT device can hung up call" am: 340eb06e41
minle.zuo [Wed, 15 Aug 2018 07:51:53 +0000 (00:51 -0700)]
Merge "HFP: Only active BT device can hung up call" am: 340eb06e41
am: 268365ab2b

Change-Id: I2f2e2ceabc68728d6bbf77b4a462b8dd854e641d

6 years agoMerge "Check startup_future before using it" am: ee0c0d8b0d
Bailey Forrest [Wed, 15 Aug 2018 07:45:12 +0000 (00:45 -0700)]
Merge "Check startup_future before using it" am: ee0c0d8b0d
am: ed5509be9e

Change-Id: Iaecc7e7dc1333e4d7d2d7f80e2cf80bb848fffa5

6 years agoMerge "Enable SNIFF mode for HFP"
Ugo Yu [Wed, 15 Aug 2018 03:21:36 +0000 (20:21 -0700)]
Merge "Enable SNIFF mode for HFP"
am: 156fefcad7

Change-Id: I8d6dfc2e34d6eccec2738d279d9bbfedff1656df

6 years agoMerge "Fix reliable write."
Qiyu Hu [Wed, 15 Aug 2018 03:21:01 +0000 (20:21 -0700)]
Merge "Fix reliable write."
am: 8f19e1179e

Change-Id: Id51e49f4bbf7029386be917215cf79e03529ddfa

6 years agoMerge "HFP: Only active BT device can hung up call"
minle.zuo [Wed, 15 Aug 2018 03:16:11 +0000 (20:16 -0700)]
Merge "HFP: Only active BT device can hung up call"
am: 340eb06e41

Change-Id: I6cd4885aaa2dc893f8b8541abf4bac89d8b3af41

6 years agoMerge "Check startup_future before using it"
Bailey Forrest [Wed, 15 Aug 2018 03:09:55 +0000 (20:09 -0700)]
Merge "Check startup_future before using it"
am: ee0c0d8b0d

Change-Id: I10282a2c31f19c211e8c0890b7b3a0de005b1ed6

6 years agoMerge "Enable SNIFF mode for HFP"
Treehugger Robot [Wed, 15 Aug 2018 02:41:17 +0000 (02:41 +0000)]
Merge "Enable SNIFF mode for HFP"

6 years agoMerge "Fix reliable write."
Treehugger Robot [Wed, 15 Aug 2018 00:11:21 +0000 (00:11 +0000)]
Merge "Fix reliable write."

6 years agoMerge "HFP: Only active BT device can hung up call"
Treehugger Robot [Tue, 14 Aug 2018 23:27:34 +0000 (23:27 +0000)]
Merge "HFP: Only active BT device can hung up call"

6 years agoMerge "Check startup_future before using it"
Treehugger Robot [Tue, 14 Aug 2018 23:21:53 +0000 (23:21 +0000)]
Merge "Check startup_future before using it"

6 years agoFix reliable write.
Qiyu Hu [Wed, 13 Jun 2018 15:08:17 +0000 (08:08 -0700)]
Fix reliable write.

We cannot simply assume the write is terminated in reliable write. When
the reliable write value is longer than MTU allows, the current
implementation can only send whatever MTU allows and naively set the
status to GATT_SUCCESS, in the name of "application should verify handle
offset and value are matched or not". That's why MTU negotiation is a
workaround as people mention in b/37031096, which just fits all the write
value into a single request.

This also blocks our test on CtsVerifier.

Bug: 37031096
Test: Manual test and confirm that we don't simply send partial value
Change-Id: I907877608f4672f24c002e630e58bf9133937a5e

6 years agoHID: Remove device from database in error case
Hemant Gupta [Tue, 19 Sep 2017 10:00:56 +0000 (15:30 +0530)]
HID: Remove device from database in error case

Usecase:
1) Pair and connect with remote hid device.
2) Disconnect with remote hid device.
3) Unpair DUT from remote hid device.
4) Send connect request from hid device by pressing any button.
5) Try to pair and connect DUT with remote hid device.

Expected Result
1) Connection should fail after step 4 if remote device does not initaite pairing.
2) Connection should succeed with remote device and hid device should be added to
paired list and hid operations should work properly.

Observed Result
HID operations from remote device starts working without device added to paired list
and UI stucked at pairing.

Root Cause:
After step 4, device should be removed from database when incoming connection is
rejected.

Fix:
Perform virtual unplug for device when connection request for hid is received from
unpaired device.

Test: Issue is not reproducible after stress testing with above change

Bug: 68176469
Change-Id: I9bc72ccc7a849c0d6acf3230a75e1fe95949b3fe

6 years agoEnable SNIFF mode for HFP
Ugo Yu [Tue, 7 Aug 2018 01:55:11 +0000 (09:55 +0800)]
Enable SNIFF mode for HFP

Bug: 112285337
Test: Manual
Change-Id: Ibb019d11cf93051a198df4efb7bd79f31c15a9c0

6 years agoHFP: Only active BT device can hung up call
minle.zuo [Wed, 25 Jul 2018 09:02:51 +0000 (17:02 +0800)]
HFP: Only active BT device can hung up call

Some inactive devices can't send hung up key to host when
HFP connected and active call exist.
And other inactive devices can send hung up call by
sending hung up command.

Solution: To keep consistency of this behavior,
only allow active BT device to hung up call.

Test: Active device can hung up call and inactive can't hung up

Change-Id: Iec1ae689f1d40c15199707e9e925814f71ded619

6 years agoCheck startup_future before using it
Bailey Forrest [Thu, 2 Aug 2018 22:10:46 +0000 (15:10 -0700)]
Check startup_future before using it

event_finish_startup and startup_timer_expired can race, leading one of
them to try to use startup_future when it is NULL.

Check startup_future still exists before using it.

Bug: 112114060
Test: Use Bluetooth
Change-Id: I018d45f070b3f931c1114abf0471b6ea1d524f2a

6 years agoMerge "Merge stage-dr1-aosp-master into stage-aosp-master" into stage-aosp-master
Xin Li [Tue, 14 Aug 2018 00:44:14 +0000 (17:44 -0700)]
Merge "Merge stage-dr1-aosp-master into stage-aosp-master" into stage-aosp-master
am: c05810f5b8

Change-Id: I97e61446c75e2f517fd21c7de5a6dd424078c2a1

6 years agoMerge "Merge stage-dr1-aosp-master into stage-aosp-master" into stage-aosp-master
Xin Li [Mon, 13 Aug 2018 23:42:29 +0000 (23:42 +0000)]
Merge "Merge stage-dr1-aosp-master into stage-aosp-master" into stage-aosp-master