Opening the serial port(s) returns -1 when it fails, check
that the number of file descriptors is greater than 0 and
less than the size of the array.
Test: VtsHalBluetoothV1_0TargetTest, Bluetooth start/stop
Bug: 64420262
Change-Id: Icbffa5bd8c02030e389bac03aa5e1e78cc3c6057
Removes redundant "java-static" target.
Note, targets aren't removed here which have internal
targets that depend on them.
Bug: 36376126
Test: pass
Change-Id: I830f02e5f219d2d58721132c358d2783c3942eac
Allow them to be static.
This is required for a couple of reasons:
- enabling HIDL passthrough in recovery
- enabling VTS tests to be static blobs
Bug: 32920003
Bug: 64040096
Test: update-all-google-makefiles.sh
Merged-In: I1b2401fb273ab80819e3870aa71fe742269674ba
Change-Id: I1b2401fb273ab80819e3870aa71fe742269674ba
(cherry picked from commit 7206708528)
hwbinder.jar will be used instead of framework.jar on build-time, but
on runtime framework.jar will be used.
This is to cut the circular dependency when using configstore from
Android framework.
Bug: 35771640
Test: no test.
Change-Id: I04cab676c91d2ea423f5e2c1b2b9efa15e522f37
Allow them to be static.
This is required for a couple of reasons:
- enabling HIDL passthrough in recovery
- enabling VTS tests to be static blobs
Bug: 32920003
Bug: 64040096
Test: update-all-google-makefiles.sh
Change-Id: I1b2401fb273ab80819e3870aa71fe742269674ba
The byte offsets for Packet Boundary (PB) and Broadcast (BC) flags
in the HCI ACL Header is swapped. This will fixed it so that it matches
the Bluetooth Specifications.
Bug: 63241720
Test: Run manual VTS tests for Bluetooth
Change-Id: Ifc1f4d4f054a1dab13458c563e47bfb884f39d92
(cherry picked from commit 7915b71fb9)
The byte offsets for Packet Boundary (PB) and Broadcast (BC) flags
in the HCI ACL Header is swapped. This will fixed it so that it matches
the Bluetooth Specifications.
Bug: 63241720
Test: Run manual VTS tests for Bluetooth
Change-Id: Ifc1f4d4f054a1dab13458c563e47bfb884f39d92
Add missing headers that aren't automatically included when
BOARD_VNDK_VERSION is set.
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j <module> where <module> is
android.hardware.bluetooth-async.vendor,
android.hardware.bluetooth@1.0-impl.vendor, and
android.hardware.bluetooth-hci.vendor
Change-Id: Ifb14d254fa358fbd2b9fbeecb028d6efd18e9483
* Add libbluetooth-types - library containing types implementation, that
is common between stystem/bt and packages/apps/Bluetooth. It must be
included in every project using btif interface.
* Put Raw Address implementation into libbluetooth-types
* Unify all "to/from string" helper methods into ToString and FromString
* bd_addr_empty -> RawAddress::kEmpty
* bd_addr_any -> RawAddress::kAny
Also fix leaks in jni str2addr by adding ReleaseStringUTFChars
Test: types_unittest
Change-Id: I7dca82ec2293ae5338a9500dd6aa43b59d25657a
Merged-In: I7dca82ec2293ae5338a9500dd6aa43b59d25657a
If to send type and data separately for one HCI packet,
it will cause two system call context switch to kernel space,
which will introduce software overhead on data path.
Plus, if vendor does not use pure UART interface, it causes different
data behavior on BUS and may not adapt to all vendors as legacy HAL did.
Considering backward-compatibility, to use writev to send
type and data together once as legacy BT HAL did.
Bug: 63391357
Test: H4 UTTest, BT VTS test, Bluetooth on/off
Change-Id: I2d93085fe0c01b48d0e3729a3fa85b5b27335b2c
(cherry picked from commit 92afd74a15)
If to send type and data separately for one HCI packet,
it will cause two system call context switch to kernel space,
which will introduce software overhead on data path.
Plus, if vendor does not use pure UART interface, it causes different
data behavior on BUS and may not adapt to all vendors as legacy HAL did.
Considering backward-compatibility, to use writev to send
type and data together once as legacy BT HAL did.
Test: H4 UTTest, BT VTS test, Bluetooth on/off
Change-Id: I2d93085fe0c01b48d0e3729a3fa85b5b27335b2c
android.hidl.base@1.0 and android.hidlmanager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Change-Id: I424371932af129bba9d58dcf8652c64297f35f05
Bluetooth threads that are used in audio have deadline
requirements for glitchless playback. Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load. Use schedulerservice to request RT
scheduling.
Bug 37518404
Test: play Bluetooth audio, check for RT with systrace
Change-Id: I043a97df3d2801922b54dcbf7c700ae11a48c217
It is not used by bluetooth and nfc services.
Bug: 33241851
Bug: 37305530
Test: built and tested on sailfish
(cherry picked from commit 593eeb7a4b)
Change-Id: I599073296baa5eee72a1fce8caa4eb8352f66218
Merged-In: I599073296baa5eee72a1fce8caa4eb8352f66218
The test is still built in data/nativetest64, but it must be marked as
vendor since it depends on vendor modules.
Also proprietary -> vendor.
Test: build with BOARD_VNDK_VERSION := current
Test: run test on internal marlin, passes
Bug: 33241851
(cherry picked from commit 2cfae52a2e)
Merged-In: I856838fe208a4cd038ea16d47f03f6278224b2ee
Change-Id: I856838fe208a4cd038ea16d47f03f6278224b2ee
It is not used by bluetooth and nfc services.
Bug: 33241851
Bug: 37305530
Test: built and tested on sailfish
Change-Id: I599073296baa5eee72a1fce8caa4eb8352f66218
Merged-In: I599073296baa5eee72a1fce8caa4eb8352f66218
The test is still built in data/nativetest64, but it must be marked as
vendor since it depends on vendor modules.
Also proprietary -> vendor.
Test: build with BOARD_VNDK_VERSION := current
Test: run test on internal marlin, passes
Bug: 33241851
Change-Id: I856838fe208a4cd038ea16d47f03f6278224b2ee
Helper libraries also now on vendor partition.
Test: links
Test: bluetooth works on internal Marlin
Bug: 33241851
(cherry picked from commit 96510c80f8)
Merged-In: Ie99faf9146ce2ce3df83a2b46acfaa36a54c16c2
Change-Id: Ie99faf9146ce2ce3df83a2b46acfaa36a54c16c2
Helper libraries also now on vendor partition.
Test: links
Test: bluetooth works on internal Marlin
Bug: 33241851
Change-Id: Ie99faf9146ce2ce3df83a2b46acfaa36a54c16c2
EAS (Energy-Aware Scheduler) tends to cluster tasks together unless
they're marked to prefer an idle CPU (prefer-idle) during placement.
This is to save energy however it increases latencies. This is
noticeable when the Binder driver demotes the RT task to CFS and when
we try to do load balance in this path, the selection path still selects
a busy CPU. Add Bluetooth HAL service to the foreground schedtune group
to fix this as its critical for tasks like bluetooth audio playback.
Test: Boot and verify bluetooth HAL is in the foreground stune group
Bug: 36867985
Change-Id: Ib3c43cca4a2049af3700978b58a05989cc20b6ac
Signed-off-by: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 1b8f6f7c77)
EAS (Energy-Aware Scheduler) tends to cluster tasks together unless
they're marked to prefer an idle CPU (prefer-idle) during placement.
This is to save energy however it increases latencies. This is
noticeable when the Binder driver demotes the RT task to CFS and when
we try to do load balance in this path, the selection path still selects
a busy CPU. Add Bluetooth HAL service to the foreground schedtune group
to fix this as its critical for tasks like bluetooth audio playback.
Test: Boot and verify bluetooth HAL is in the foreground stune group
Bug: 36867985
Change-Id: Ib3c43cca4a2049af3700978b58a05989cc20b6ac
Signed-off-by: Joel Fernandes <joelaf@google.com>
VtsHalBluetoothV1_0TargetTest uses VtsHalHidlCallbackBase.
Callback class extends VtsHalHidlCallbackBase and use waitForCallback, notifyFromCallback, and setWaitTimeout
The original Bluetooth test contains the following use cases:
* Wait for specific callback
* Set timeout for specific callback waiting
The modified version supports the above use cases.
Bug: 36036059
Test: Test pass locally
Change-Id: I961baaf7f1b09fa9c134629cc7280565a2664ed5
(cherry picked from commit 51d023c48e)
VtsHalBluetoothV1_0TargetTest uses VtsHalHidlCallbackBase.
Callback class extends VtsHalHidlCallbackBase and use waitForCallback, notifyFromCallback, and setWaitTimeout
The original Bluetooth test contains the following use cases:
* Wait for specific callback
* Set timeout for specific callback waiting
The modified version supports the above use cases.
Bug: 36036059
Test: Test pass locally
Change-Id: I961baaf7f1b09fa9c134629cc7280565a2664ed5
Log if the Bluetooth service has died.
Also check the return status for Bluetooth service binder callbacks to
avoid DEAD_OBJECT exception when com.android.bluetooth crashes.
Bug: 36026072
Test: unit tests; Bluetooth off/on/off; kill -6 com.android.bluetooth
Change-Id: Ia28e6777ee7b78f06db8d5214324e696441d00f7
The vendor open interface command returns the total number
of FDs opened. (2 or 4 if the interface is MCT)
However, the list of FDs is always 4 in either case. If the
open command returns 2, the FDs are shared cmd/event and
data in/out.
2 FDs example
[41, 41, 42, 42]
4 FDs example
[41, 42, 43, 44]
If we condition the registration of ACL_IN on the total
number of FDs, then 2 FD MCT interfaces will not get data.
Fixes: 36067612, 36035039, 36188793
Test: manual, pairing is quick and data does transfer
Change-Id: Icc8728239ba81426d5fc0e678c5c5480fd9b5081
The power mode should be unimportant if power off succeeds.
Test: Switch users (Toggles Bluetooth under CPU load)
Bug: 36026072
Change-Id: I09fafe4d4f9a466a7e12e617925f98ef3805c738
- Hold the mutex during callbacks
- Disable power mode before deleting hci_
Bug: 36084266
Test: Switch users repeatedly (toggles Bluetooth)
Change-Id: I7e4d405e9028c3363c112a8b09c03b8aea652b7a
Some devices still use MCT as their UART protocol, so
we need to bring it forward to the fresh new HAL.
Also, adding tests for H4 while I'm here.
Test: new unit tests pass and a device using MCT now
boots BT again \o/
Fixes: 34992730
Change-Id: Idb8e536a2779929ad8a0d4bac492c3011995cd79
Bug: 35328775
Test: works in both binderized and passthrough modes
Merged-In: I18f21b53c2282e27342a58716475ae213a2837d4
Change-Id: I18f21b53c2282e27342a58716475ae213a2837d4
Java intermediates are now created in the common rather than the device-
specific generated sources subdirectory.
Bug: 33842609
Test: make
Change-Id: I16af4cd19bf0b24baa0ad9ebfdb86b4d959c8672
This ensures the vendor library can release any wakelocks held and
perform any additional cleanup steps as necessary.
Change-Id: Ibfeac161109162ac375eef9c20f147f0506de602
Fixes: 35097918
Test: manual; disable Bluetooth, monitor wakelocks
Generate filegroups for .hal files so that driver/profiler build rules
can migrate to another project.
Bug: 34893894
Test: mmma hardware/interfaces -j32
Change-Id: Iefc98a6df16706fbb798bc32405fe8ff0c3de450
If a device does not have a factory address set, generate one.
Since this is a bug, add a warning.
Bug: 34952761
Test: Pixel C Bluetooth turns on and off
Change-Id: Icd2ef5c40f0ef6ad93effd9dd662b4b79d3eb0f6
Implement low power mode using timeouts from the interface.
Test: Boots, Bluetooth turns on/off,
Instrumented bt_vendor library shows power management
calls.
Change-Id: Ic4fcbb222f24b66c13f3797b14475d278c49fbc6
Allow timeouts to change the timeout.
Add a unit test for this.
Test: Unit tests pass, Bluetooth starts and stops.
Change-Id: I1be8a18dd74a312175ec9c27de37213272650e8e