OSDN Git Service
Chih-Hung Hsieh [Wed, 12 Sep 2018 22:20:43 +0000 (15:20 -0700)]
Suppress implicit-fallthrough warnings.
Add FALLTHROUGH_INTENDED for clang compiler.
Bug:
112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: Iedf7e46445101a5e3358473e1200212d67cf58d1
Joseph Pirozzo [Fri, 14 Sep 2018 22:48:55 +0000 (22:48 +0000)]
Merge "AVRCP Controller media session queue"
Hansong Zhang [Tue, 14 Aug 2018 21:29:23 +0000 (14:29 -0700)]
Add Timer as an alternative to osi alarm
* Add a private method MessageLoopThread.DoInThreadDelayed to post a
delayed task in message loop, as an alternative approach to osi alarm
clock
* Add a unit test for MessageLoopThread to check ShutDown() waits until
current task finishes
* Add Timer using MessageLoopThread.DoInThreadDelayed
* Timer provides similar API as osi alarm, and uses same OS clock (boot
timer) as alarm
* Add benchmark and unit tests to ensure the performance is comparable
to the existing osi alarm
Test: Run unit test and benchmark test
./test/run_unit_tests.sh bluetooth_test_common
./test/run_benchmarks.sh bluetooth_benchmark_timer_performance
--benchmark_repetitions=10 --benchmark_report_aggregates_only=true
Bug:
110303473
Change-Id: I6f2e7ae2f80f9889fc5fe3c8cd6b9b2670938b46
Treehugger Robot [Thu, 13 Sep 2018 01:30:08 +0000 (01:30 +0000)]
Merge "Add support for A2DP LDAC Sink function"
Ajay Panicker [Wed, 12 Sep 2018 22:27:42 +0000 (22:27 +0000)]
Merge "Add extractBE to the Bluetooth Packets Iterators"
Chisato Kenmochi [Fri, 10 Aug 2018 11:44:05 +0000 (20:44 +0900)]
Add support for A2DP LDAC Sink function
Note: The LDAC decoder source code is needed to run with this patch.
Bug:
112839060
Test: Manual
Change-Id: Idce0070dcce4d6b83cfd08213b846d957d694d26
Signed-off-by: Chisato Kenmochi <Chisato.Kenmochi@sony.com>
Pavlin Radoslavov [Tue, 11 Sep 2018 23:47:47 +0000 (16:47 -0700)]
Add a check whether an A2DP codec is supported before including it
Some of the A2DP SRC or SNK codecs might not be supported if the
corresponding shared library is not included.
Don't include such codecs when configuring and registering
the stream end points on the local device.
Bug:
112839060
Test: Manual - remove A2DP codec shared libraries and check the
returned AVDTP Capabilities
Change-Id: Ia8fbdac915b208f9950ef7c9f50e3e0dc87e9111
Ajay Panicker [Mon, 10 Sep 2018 19:01:50 +0000 (12:01 -0700)]
Add extractBE to the Bluetooth Packets Iterators
ExtractBE allows data to be extracted from Bluetooth packets in a big
endian format.
Bug:
114751344
Test: run net_test_btpackets
Change-Id: Ib01d726893e106d34c11048acc09fee201d81c09
Treehugger Robot [Mon, 10 Sep 2018 23:40:29 +0000 (23:40 +0000)]
Merge "Fix spacing in hearing aid dumpsys"
Pavlin Radoslavov [Sun, 9 Sep 2018 18:06:21 +0000 (11:06 -0700)]
Disable absolute volume control for deepblue2 speaker
The speaker does not accept the volume levels from the Phone.
It responds back with rounded down volume levels.
Bug: b/
37834035
Test: Manual
Change-Id: Ie5575233c3cf31c087addd3cef1c12ad36b820b0
Hansong Zhang [Fri, 7 Sep 2018 16:39:22 +0000 (09:39 -0700)]
Fix spacing in hearing aid dumpsys
Bug:
114242876
Test: See dumpsys output for bluetooth_manager
Change-Id: Ifb0884ba4e90e2b925bafc52a15d3375c9aec288
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
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
Treehugger Robot [Wed, 29 Aug 2018 00:32:15 +0000 (00:32 +0000)]
Merge "[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS"
Joseph Pirozzo [Tue, 28 Aug 2018 22:33:47 +0000 (15:33 -0700)]
AVRCP Controller media session queue
Add support for the Now Playing Content available through AVRCP to
receive proper notifications when it changes and expose it via media
session rather than a node in the browse tree.
Bug:
78598689
Test: Stream Music, change songs and playlist, verify media session
queue.
Change-Id: I46c32d05c5a674388c9e59830ec0596432cd78ef
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
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
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"
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
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
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
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
Treehugger Robot [Mon, 27 Aug 2018 19:03:21 +0000 (19:03 +0000)]
Merge "Move 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
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
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
Treehugger Robot [Thu, 23 Aug 2018 22:54:16 +0000 (22:54 +0000)]
Merge "L2CAP: 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
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
Treehugger Robot [Tue, 21 Aug 2018 23:47:01 +0000 (23:47 +0000)]
Merge "A2DP-SINK: Use MessageLoopThread for decoding"
Ted Wang [Tue, 21 Aug 2018 02:32:49 +0000 (02:32 +0000)]
Merge "Fix "Disable Absolute Volume" Bluetooth developer option"
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
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
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
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
Treehugger Robot [Sat, 18 Aug 2018 20:18:39 +0000 (20:18 +0000)]
Merge "Implement 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
Treehugger Robot [Sat, 18 Aug 2018 00:30:46 +0000 (00:30 +0000)]
Merge "Replace 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
Treehugger Robot [Thu, 16 Aug 2018 18:27:34 +0000 (18:27 +0000)]
Merge "HID: Remove device from database in error case"
Treehugger Robot [Wed, 15 Aug 2018 02:41:17 +0000 (02:41 +0000)]
Merge "Enable SNIFF mode for HFP"
Treehugger Robot [Wed, 15 Aug 2018 00:11:21 +0000 (00:11 +0000)]
Merge "Fix reliable write."
Treehugger Robot [Tue, 14 Aug 2018 23:27:34 +0000 (23:27 +0000)]
Merge "HFP: Only active BT device can hung up call"
Treehugger Robot [Tue, 14 Aug 2018 23:21:53 +0000 (23:21 +0000)]
Merge "Check startup_future before using it"
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
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
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
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
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
yunhanw [Mon, 13 Aug 2018 18:47:47 +0000 (11:47 -0700)]
Re-enable LE advertising after disconnect, on controllers not supporting advertising when connected
Bug:
112451773
Test: compiled and local device test
Change-Id: Ia39f46b3b9667cba34465e3ff310df85a765c3e1
Ugo Yu [Mon, 13 Aug 2018 02:12:40 +0000 (10:12 +0800)]
Fix wrong UUID mask when doing BLE filter scan
bug:
112350218
Test: manual
Change-Id: I9e4297b936e7a7db164e7ff3bf680c43600c5bda
Treehugger Robot [Thu, 9 Aug 2018 20:00:19 +0000 (20:00 +0000)]
Merge "Get rid of meaningles GATT client error log"
Jakub Pawlowski [Thu, 9 Aug 2018 07:24:41 +0000 (09:24 +0200)]
Get rid of meaningles GATT client error log
Right now we often get this error in logs:
E bt_btif_gattc: btif_gattc_upstreams_evt: Unhandled event (7)!
This is often misinterpreted during log analysis as error, where this
really means just uninteresting event we don't want to handle.
Change-Id: Ia7804b2e1802a117198a31e025d05a80f973e896
Joseph Pirozzo [Wed, 8 Aug 2018 23:01:21 +0000 (23:01 +0000)]
Merge changes from topic "avrcp_controller_timer"
* changes:
Reduce Media State change callbacks
AVRCP Controller metadata feature
Joseph Pirozzo [Fri, 3 Aug 2018 15:25:19 +0000 (08:25 -0700)]
Reduce Media State change callbacks
Eliminate the 2 second timer and only update media state when it
changes.
Bug:
28917369
Test: Play music, pause and change its position observe status is
correct.
Change-Id: Iaf17e8cde570651706c55603b01c5100d4c60aa4
Pirama Arumuga Nainar [Tue, 7 Aug 2018 21:43:20 +0000 (14:43 -0700)]
Reorder static libs to appease ld.gold linker
Bug: http://b/
112277682
Bug: http://b/
79419131
Lld, which is the default linker for the platform, is able to resolve
symbols across libraries irrespective of the order they appear in the
command line. This was not the case for ld.gold and other linkers.
Unfortunately, there are some targets that still rely on ld.gold
(pgo-taimen-config1 in internal release branch being one of
them).
With http://aosp/721652, libbt-stack should be added before libbt-common
so MessageLoopThread::~MessageLoopThread is resolved correctly. If not,
the following error is reported by gold:
system/bt/stack/btu/btu_init.cc:41: error: undefined reference to
'bluetooth::common::MessageLoopThread::MessageLoopThread(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
Test: m USE_CLANG_LLD=false
Change-Id: I9c8208218ffb4bb027ad75b51bcd484e9bb37368
Joseph Pirozzo [Tue, 7 Aug 2018 19:28:40 +0000 (12:28 -0700)]
AVRCP Controller metadata feature
Process the METADATA feature flag separately from the VENDOR feature
flag to ensure it doesn't get overwritten.
Bug:
110039732
Test: connect avrcp from phone verify getCapabilities events supported
is sent.
Change-Id: Ib5d54c13d6c912904f20e8760f1632fa5737b98f
Xin Li [Mon, 6 Aug 2018 23:52:40 +0000 (16:52 -0700)]
Merge Android Pie into master
Bug:
112104996
Change-Id: I242b3c68bcb25f29f8e979487f507a0585f1a8ae
Jakub Pawlowski [Mon, 6 Aug 2018 18:00:14 +0000 (11:00 -0700)]
Fix bad constructor usage in HearingDevice
am:
897a734a47
Change-Id: I859ce7751ee787fcbf9b5e46f07690a28fa91a1f
Jakub Pawlowski [Mon, 6 Aug 2018 13:48:57 +0000 (15:48 +0200)]
Fix bad constructor usage in HearingDevice
Bug:
112135987
Test: compilation
Change-Id: Ifaf0189f512ef2abdc7179bda5d6ff1e291fde54
Jack He [Fri, 3 Aug 2018 08:34:36 +0000 (01:34 -0700)]
Build: Disable host_supported for cc_benchmark
am:
58b49f8c5d
Change-Id: I1614d74f1f6980623ef38f00be4a1024a7f8e306
Jack He [Fri, 3 Aug 2018 07:40:56 +0000 (00:40 -0700)]
Build: Disable host_supported for cc_benchmark
* host_supported is broken in cc_benchmark on Mac
Bug:
77585931
Test: make
Change-Id: I2d2b4d52a108f90e3ce2d9c8c9f5510918f1fcff
Jack He [Thu, 2 Aug 2018 21:24:47 +0000 (14:24 -0700)]
Use MessageLoopThread in A2DP source, JNI, BTA, HCI and module bring-up
am:
6d110527c8
Change-Id: I1093576b83d19cac3a11ff4d81173d97604d2a4d
Jack He [Thu, 2 Aug 2018 21:24:00 +0000 (14:24 -0700)]
Add MessageLoopThread, ExecutionBarrier, and performance tests
am:
c27d25789b
Change-Id: I040d328e642b351420f9a1f4eb35e6c0dc09a74e
Jack He [Thu, 26 Jul 2018 04:43:01 +0000 (21:43 -0700)]
Use MessageLoopThread in A2DP source, JNI, BTA, HCI and module bring-up
* Replace OSI thread with MessageLoopThread in
- btif_a2dp_source (A2DP encoding thread)
- btif_core (JNI thread)
- btu_init (BTA thread)
- hci_layer (HCI thread)
- module (module bring up thread)
- various unit test threads
* Code that uses reactor from OSI thread is not replaced in this change
because they need to move from using reactor to message loop first
* Main difference:
- HCI layer no longer has access to mutex protecting message loop
set up and tear down. Messages posted to thread after ShutDown()
is called become no-op
- In all cases QuitClosure() is used instead of QuitWhenIdleClosure().
This means that we will never force kill a thread. An infinite loop
will delay the shutdown of Bluetooth stack.
* do_in_hci_thread is actually do_in_bta_thread
* Move the definition of do_in_bta_thread from bta to btu since btu is
where the thread actually lives
* Remove bta_closure_api.h and replace it with stack/include/btu.h
* Remove header inclusion in bta_sys.h and include stack/include/btu.h
in individual compilation units
* Fixed a bug in btif_cleanup_bluetooth where btif_jni_disassociate()
was not called on the JNI thread
* Make setting real time priority a requirement
* Crash during the following scenario:
- When btif_profile_queue cleanup failed to be scheduled on JNI thread
- When A2DP encoder thread failed to gain real time priority
- When BTA thread failed to start up
- When BTA thread failed to gain real time priority
- When BTA thread failed to schedule its first callback
* Turn off Bluetooth in the following scenario:
- When HCI thread failed to gain real time priority
- When bt_workqueue thread failed to gain real time priority
Bug:
110303473
Test: make, native and Java unit tests,
Connect to headset and listen to music through A2DP,
testplans/details/184455/3975
Change-Id: Ib448992fc0ba5af82c2d117dd65f1abd45d2acb6
Jack He [Wed, 25 Jul 2018 19:02:22 +0000 (12:02 -0700)]
Add MessageLoopThread, ExecutionBarrier, and performance tests
* Add MessageLoopThread to abstract thread implementation to our code
* Add ExecutionBarrier utility class to help with thread synchronization
* Add more performance tests and performance benchmarks to evaluate
execution efficiency in both batch and sequential usages, for various
thread implementations including:
- libosi reactor on pthread
- MessageLoop on libosi reactor on pthread
- MessageLoop on STL std::thread
- MessageLoop on Posix pthread
- MessageLoop on libchrome base::Thread
- MessageLoop on MessageLoopThread
Bug:
110303473
Test: make, native and Java unit tests,
test/run_benchmarks.sh net_benchmark_thread_performance,
test/run_unit_tests.sh net_test_performance,
test/run_unit_tests.sh bluetooth_test_common,
testplans/details/184455/3975
Change-Id: I5b4ce2ee910a0f1d2edf95e0296916dea04d3f89
Venkata Jagadeesh [Wed, 1 Aug 2018 18:53:41 +0000 (11:53 -0700)]
Merge "Add security handling for LE connection oriented channels"
am:
fc53a1fcba
Change-Id: Ibba4bdb0f337d743a7148d49a1ad23eb2f8a8b5e
Treehugger Robot [Wed, 1 Aug 2018 18:38:10 +0000 (18:38 +0000)]
Merge "Add security handling for LE connection oriented channels"
Aiswarya Cyriac [Tue, 31 Jul 2018 23:32:00 +0000 (16:32 -0700)]
Fix for Bluetooth device name is resetting to default name after reboot
am:
f589e45a3c
Change-Id: I313af6b96913b72fc140c7873c1952f24b75c12a
Venkata Jagadeesh [Fri, 18 Mar 2016 06:34:30 +0000 (12:04 +0530)]
Add security handling for LE connection oriented channels
Use case:
Run PTS test cases TP/LE/CFC/BV-10-C to BV-16-C
Steps:
1. These test cases executed with two DUT as PTS support not available
2. Set desired security level on DUT and Remote with tool
3. Initiate LE COC connection request from DUT
Failure:
LE COC connection accepted though even remote security are not met.
Fix:
Added security handling for COC connection
Test: Ran sl4a test for BleCocTest
Change-Id: I5f6385d462698582e701b5a07953c0ccb932bbbf
Aiswarya Cyriac [Mon, 23 Jul 2018 09:47:48 +0000 (15:17 +0530)]
Fix for Bluetooth device name is resetting to default name after reboot
Reason: When the BT device name is updated is getting saved to the
config data pointer but not to the persistent data (i.e. bt_config.conf).
So, when the reboot is happening it is not able to get the updated device
name from the persistent data (i.e. bt_config.conf) as during reboot
bt_config_flush is not called.
Fix: Saving the BT Device name to persistent data using btif_config_flush
once it is set.
Test: Manual Reboot test
Bug:
110301897
Change-Id: Ie329b475eaaf208ed667f27e271a00e230e4b95c
Signed-off-by: Aiswarya Cyriac <aiswarya.cyriac@intel.com>
Signed-off-by: Gaganpreet kaur <gaganpreetx.kaur@intel.com>
Joseph Pirozzo [Mon, 30 Jul 2018 20:42:22 +0000 (13:42 -0700)]
Merge "Set Browsed Player memory allocation"
am:
0b610a13c2
Change-Id: I7e432dd8dcc8e389807998e2f07d368414412dd1
Joseph Pirozzo [Mon, 30 Jul 2018 20:31:00 +0000 (20:31 +0000)]
Merge "Set Browsed Player memory allocation"
Pavlin Radoslavov [Fri, 27 Jul 2018 23:54:27 +0000 (16:54 -0700)]
Add additional checks for AVDTP Codec Capabilities
am:
3c5cef21d3
Change-Id: If9ab310626b5acb2364a2403ba831de3021b5ce2
Joseph Pirozzo [Fri, 27 Jul 2018 18:08:17 +0000 (11:08 -0700)]
Set Browsed Player memory allocation
When setting a browsed player memory for folder depth was incorrectly
allocated based on folder item count not depth.
Bug:
111370532
Test: Set a browsed player that has a depth greater than item count.
Change-Id: I6984c5852f623e7e9478429bdab3dcbcf57196e0
Pavlin Radoslavov [Thu, 26 Jul 2018 02:03:09 +0000 (19:03 -0700)]
Add additional checks for AVDTP Codec Capabilities
Reject AVDTP Codec Capabilities that contain invalid fields
Bug:
110918549
Test: Manual - connect to a device that sends invalid codec capability
Change-Id: Ib697cc9ad13ed666fbafa9219447592fe3f56684
Bailey Forrest [Wed, 25 Jul 2018 00:55:15 +0000 (17:55 -0700)]
Merge "Swap order of registered/status in RegisterForNotificationCallback"
am:
95d0798e7f
Change-Id: Ibe4f75b8eb8b50dd9aaa105bdbafe766bedb8ed4
Treehugger Robot [Wed, 25 Jul 2018 00:45:53 +0000 (00:45 +0000)]
Merge "Swap order of registered/status in RegisterForNotificationCallback"
Joseph Pirozzo [Wed, 25 Jul 2018 00:40:58 +0000 (17:40 -0700)]
Merge "Enable 2-EV3 packets for Wide Band HFP client"
am:
503067b5f8
Change-Id: Ib1e98cd9888ec9e5ff2da8a8114a6c24d4813cfc
Subramanian Srinivasan [Wed, 25 Jul 2018 00:40:34 +0000 (17:40 -0700)]
Merge "Use appropriate Tx time in BLE Set Data length command"
am:
135c7bc70c
Change-Id: Iafa186226b9ca38f71958de68055fe594bfac557
Joseph Pirozzo [Wed, 25 Jul 2018 00:38:12 +0000 (00:38 +0000)]
Merge "Enable 2-EV3 packets for Wide Band HFP client"
Treehugger Robot [Wed, 25 Jul 2018 00:33:00 +0000 (00:33 +0000)]
Merge "Use appropriate Tx time in BLE Set Data length command"
Fen Wang [Wed, 25 Jul 2018 00:12:23 +0000 (17:12 -0700)]
Make PROPERTY_PRODUCT_MODEL device configurable
am:
19e728b9d2
Change-Id: I5f25b8a07749e3c3eb7fed3fd4415fac3490c7b5
Bailey Forrest [Wed, 1 Mar 2017 19:27:05 +0000 (11:27 -0800)]
Swap order of registered/status in RegisterForNotificationCallback
It's confusing how the order is inconsistent with the one defined in
hardware/libhardware/include/hardware/bt_gatt_client.h
Test: Build. Right now no code uses these functions.
Change-Id: I04b93ba74555455fd981a3809ea3e0bfffca4696
Subramanian Srinivasan [Thu, 15 Mar 2018 22:58:20 +0000 (15:58 -0700)]
Use appropriate Tx time in BLE Set Data length command
Fixes Tx time parameter in HCI LE set data length command
depending on HCI versions supported by controller.
Bug:
110373079
Change-Id: I83cc4c41ca4c2b6470ec30057717946b1d7fe329
Fen Wang [Tue, 10 Apr 2018 03:41:34 +0000 (12:41 +0900)]
Make PROPERTY_PRODUCT_MODEL device configurable
Make it possible to set PROPERTY_PRODUCT_MODEL in device configuration.
Bug:
Change-Id: I4d34d4ec368f7eb8bd50e2d5431bb120a284f4e3
Cheney Ni [Tue, 24 Jul 2018 04:31:32 +0000 (21:31 -0700)]
Merge "Ignore SDP failure while bonding if SDP was not attempted"
am:
62fee1a223
Change-Id: Iae385d9feca203640c00ab93a8199d3dc3f85fa1
Treehugger Robot [Tue, 24 Jul 2018 04:21:40 +0000 (04:21 +0000)]
Merge "Ignore SDP failure while bonding if SDP was not attempted"
Hansong Zhang [Wed, 18 Jul 2018 22:34:06 +0000 (15:34 -0700)]
Clean up style in BLE White List code
am:
efb54f7d37
Change-Id: Ia4cee8a5437c430dc75fbf16db9cc381ed4f2e1c
Hansong Zhang [Tue, 17 Jul 2018 00:57:17 +0000 (17:57 -0700)]
Clean up style in BLE White List code
* Remove unused code
* Update BgConnHash to return size_t for hashcode
* Change BLE scan_int and scan_win to uint16_t according to spec
Bug:
111562702
Test: SL4A BLE test and manual with BLE mouse
Change-Id: Ieff3acbfaa95b7d804e57021d562218d9fbe42cc
Cheney Ni [Tue, 17 Jul 2018 11:27:59 +0000 (19:27 +0800)]
Ignore SDP failure while bonding if SDP was not attempted
When bonding, there is an ACL_UP event to the upper layers and some apps
may want to fetch SDP in return. This can break pairing. In cases SDP fails,
it causes the procedure to be finished before the LinkKey is generated.
And thus the LinkKey is not committed to NVRAM and the device is not paired.
Bug:
111189110
Test: : Pair / Unpair BT accessories manually
Change-Id: Iaefbe8b6c1fc3e78f0f120220992df84699a2eb8
Jack He [Tue, 17 Jul 2018 23:59:50 +0000 (16:59 -0700)]
Merge "Metrics: Add python script to dump metrics into ASCII format"
am:
85cce9b01f
Change-Id: Ib882d2a6fc9d430cb7d0bf55e0e7c551b7b2d05a
Treehugger Robot [Tue, 17 Jul 2018 23:50:34 +0000 (23:50 +0000)]
Merge "Metrics: Add python script to dump metrics into ASCII format"
Jack He [Fri, 13 Jul 2018 21:54:38 +0000 (14:54 -0700)]
Metrics: Add python script to dump metrics into ASCII format
Test: make,
./dump_metrics_ascii.py proto/bluetooth/metrics/bluetooth.proto
Change-Id: Ie671fa2c2ceb9f93ed62495b592a2cf9d69ff41b
Ben YoungTae Kim [Tue, 17 Jul 2018 03:49:06 +0000 (20:49 -0700)]
Increase DM connection size for multiple links
am:
d12993c4f6
Change-Id: I0a0d4cc4a0e8f32d3b3407c370389260f864a3e7
Ben YoungTae Kim [Tue, 10 Jul 2018 00:58:12 +0000 (17:58 -0700)]
Increase DM connection size for multiple links
For multiple headset connections, it will be increased to support
multiple services(HFP/AV/CT) for each links.
Test: Connect to 4 or more headsets and play music
Bug:
110972513
Change-Id: I56f69e12fb1a4a614c69fa383e9c53675a189fc9
Benson Li [Fri, 13 Jul 2018 20:10:16 +0000 (13:10 -0700)]
Merge "HFP: Reset BTA SCO control block when bta_ag_create_sco failed"
am:
44e0158c80
Change-Id: I9f87fd712572e9495b5bceac2f7b96985c963a58
Jack He [Fri, 13 Jul 2018 20:09:18 +0000 (13:09 -0700)]
Merge "SCO: Allocate 6 BTM SCO control blocks for Multi-HFP support"
am:
ef3927a23e
Change-Id: Ic87f2bca46c7f3313e7ec9c838ba49fbac0441e5
Treehugger Robot [Fri, 13 Jul 2018 19:59:10 +0000 (19:59 +0000)]
Merge "HFP: Reset BTA SCO control block when bta_ag_create_sco failed"
Treehugger Robot [Fri, 13 Jul 2018 19:58:46 +0000 (19:58 +0000)]
Merge "SCO: Allocate 6 BTM SCO control blocks for Multi-HFP support"