Commit Graph

1912 Commits

Author SHA1 Message Date
TreeHugger Robot
c4c0b6251b Merge "Tag some "new Binder()" instances to detect leaks." into sc-dev am: c8955e0799 am: 7da4e4c89c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15225384

Change-Id: I74e95d4f14d80e92405a5fc872978540838f5888
2021-07-08 00:58:51 +00:00
Jeff Sharkey
79b834d47c Tag some "new Binder()" instances to detect leaks.
We've seen evidence of a Binder leak, and our hunch is that it's
caused by one of these anonymous "new Binder()" sites.  Adding
descriptors will help us identify the leak cause.

Bug: 192415943
Test: atest BluetoothInstrumentationTests
Change-Id: I30cd15f084cf50f67edd833b27b853c4b22e1db1
2021-07-07 17:17:07 -06:00
Rahul Sabnis
97a9e05dac Merge "Update BluetoothAdapter and BluetoothDevice documentation" am: 0591dcac60 am: 301ad0c728 am: bd5568f800 am: f85699dc0f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1713250

Change-Id: Iabcd961878192216aa4c8ac7c62180b7a92cc230
2021-07-02 22:45:26 +00:00
Rahul Sabnis
f85699dc0f Merge "Update BluetoothAdapter and BluetoothDevice documentation" am: 0591dcac60 am: 301ad0c728 am: bd5568f800
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1713250

Change-Id: Idb7e0d7d4b5ddafe9f461851655e2b01693eeecf
2021-07-02 22:32:05 +00:00
Rahul Sabnis
bd5568f800 Merge "Update BluetoothAdapter and BluetoothDevice documentation" am: 0591dcac60 am: 301ad0c728
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1713250

Change-Id: I3c67ce35ae5c26ff497365fb3ab683474e2b4b69
2021-07-02 22:31:26 +00:00
Etienne Ruffieux
5e3a79e1d6 Update BluetoothAdapter and BluetoothDevice documentation
Update BluetoothAdapter#startDiscovery and
BluetoothDevice#fetchUuidsWithSdp documentation to
indicate that it queues the request if a device is
currently bonding

Tag: #feature
Bug: 187165224
Test: Manual
Merged-In: I3dbcdacff062f6c33c2fdc8d64170bf60b2fbf6f
Change-Id: I7e598417ba96a5acc9f13fb6d29a0612740f31b4
2021-07-01 22:39:36 +00:00
Rahul Sabnis
d748e6ec7a Update BluetoothAdapter and BluetoothDevice documentation
Update BluetoothAdapter#startDiscovery and
BluetoothDevice#fetchUuidsWithSdp documentation to
indicate that it queues the request if a device is
currently bonding

Tag: #feature
Bug: 187165224
Test: Manual
Change-Id: I3dbcdacff062f6c33c2fdc8d64170bf60b2fbf6f
2021-07-01 22:36:56 +00:00
Johanna Ye
19734ef448 Merge "Fix long characteristic write concurrency bug." 2021-06-30 14:21:59 +00:00
Johanna Ye
4e2056b367 Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40 am: 8e9787fdb1 am: 7bd3fa33dc am: 2ca11a0ebe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221

Change-Id: I2aa83d3dc16e4d60efc22a62eb7421da6318f68b
2021-06-29 20:16:03 +00:00
Johanna Ye
2ca11a0ebe Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40 am: 8e9787fdb1 am: 7bd3fa33dc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221

Change-Id: Ie7fe3c1f90149a818ca14711cf6128b4e08dbcdb
2021-06-29 20:03:43 +00:00
Johanna Ye
7bd3fa33dc Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40 am: 8e9787fdb1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221

Change-Id: I3ecb6ae4c51c4a843be0eb265825966c8afb42ae
2021-06-29 19:43:02 +00:00
Johanna Ye
e36f798dea Add synchronization to all mDeviceBusy state changes.
Tag: #stability
Test: make
Bug: 169559728
Change-Id: I5c1b926a4c774b4bc5f24a9aaa66aa5f7780e121
2021-06-29 16:19:53 +02:00
Johanna Ye
3fd335f4de Fix long characteristic write concurrency bug.
Tag: #stability
Test: Bramble (pixel phone) with test app
Bug: 169559728
Ignore-AOSP-First: Current security annotation parity
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I3e3a5ff0965c1ca4f79e70e6163bc5d6917edbd1
2021-06-29 16:14:53 +02:00
Rahul Sabnis
14bb3b4267 resolve merge conflicts of 6041a06620 to sc-dev-plus-aosp
Bug: 191935916
Test: Manual
Merged-In: Ia46dc4e50d42dbd574588b531045cb680aa09d94
Change-Id: I728cdd4e60dcb753a9a688b4c5b5c2a89db50fce
2021-06-24 04:52:56 +00:00
Rahul Sabnis
a8d3435cfd Add BluetoothLeAudio to BluetoothAdapter#getProfileProxy and
BluetoothAdapter#closeProfileProxy

Tag: #feature
Bug: 15083918
Test: Manual
Merged-In: Ia46dc4e50d42dbd574588b531045cb680aa09d94
Change-Id: Ia46dc4e50d42dbd574588b531045cb680aa09d94
2021-06-23 23:46:43 +00:00
Rahul Sabnis
5a623c1a6d Add BluetoothLeAudio to BluetoothAdapter#getProfileProxy and
BluetoothAdapter#closeProfileProxy

Tag: #feature
Bug: 15083918
Test: Manual
Change-Id: Ia46dc4e50d42dbd574588b531045cb680aa09d94
2021-06-23 16:10:07 -07:00
Alice Kuo
47840a8d73 Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage.
This change contains two item,
1. public BluetoothProfile.LE_AUDIO that App can use
BluetoothProfile.ServiceLister with LE Audio profile, such as HFP, A2DP
and hearing aid profile.
2. public getGroupId API that App can use this api to identify which
devices are in the same group

Bug: 150670922
Test: Manual test
Change-Id: I32865720a8195b7c5ae29411cd1f3de95e7fc9b5
Merged-In: I32865720a8195b7c5ae29411cd1f3de95e7fc9b5
2021-06-21 23:34:53 +00:00
TreeHugger Robot
24b23c4587 Merge "Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage." into sc-dev-plus-aosp am: 893020512f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14572662

Change-Id: I63e5a559dac4bbec7146a253b7e13e2a21c53098
2021-06-21 15:47:01 +00:00
TreeHugger Robot
d6821cf042 Merge "Adds rahulsabnis@ as an owner for all Bluetooth files in frameworks/base" into sc-dev am: b389f98256 am: c961456aeb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15028266

Change-Id: Ib6f6e05d8f4f84e124949463e11f79b1953c647d
2021-06-21 12:02:16 +00:00
Jakub Pawlowski
3469791105 Bluetooth: fix comments on Volume Control Profile review
Bug: 150670922
Test: compilation
Merged-In: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c
Change-Id: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c
(cherry picked from commit 37c700dbbe)
2021-06-19 08:38:35 +00:00
TreeHugger Robot
893020512f Merge "Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage." into sc-dev-plus-aosp 2021-06-18 22:20:06 +00:00
Jakub Pawlowski
4619694a85 Bluetooth: fix comments on Volume Control Profile review
Bug: 150670922
Test: compilation
Merged-In: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c
Change-Id: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c
2021-06-18 20:46:27 +00:00
Treehugger Robot
efc94c3852 Merge "Adds rahulsabnis@ as an owner for all Bluetooth files in frameworks/base" am: 87a2d5bf91 am: 04d39400db
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1741394

Change-Id: I0cae32f20979a121f64011d5e2f4fab676c79355
2021-06-18 19:59:53 +00:00
Rahul Sabnis
4571f15931 Adds rahulsabnis@ as an owner for all Bluetooth files in frameworks/base
Tag: #feature
Bug: 191481598
Test: Manual
Merged-In: I6c8606c8e4802b74e80555e8ebf78932863d3f5b
Change-Id: I6c8606c8e4802b74e80555e8ebf78932863d3f5b
2021-06-18 12:27:11 -07:00
Treehugger Robot
87a2d5bf91 Merge "Adds rahulsabnis@ as an owner for all Bluetooth files in frameworks/base" 2021-06-18 19:21:16 +00:00
Rahul Sabnis
165faf4460 Adds rahulsabnis@ as an owner for all Bluetooth files in frameworks/base
Tag: #feature
Bug: 191481598
Test: Manual
Change-Id: I6c8606c8e4802b74e80555e8ebf78932863d3f5b
2021-06-18 10:31:26 -07:00
Jakub Pawlowski
37c700dbbe Bluetooth: fix comments on Volume Control Profile review
Bug: 150670922
Test: compilation
Merged-In: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c
Change-Id: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c
2021-06-18 17:26:43 +00:00
Łukasz Rymanowski
a5a3d32839 DO NOT MERGE Bluetooth: add Volume Control Profile boilerpalate
This is very simple API to allow Android to connect VCP profile.

Bug: 150670922
Test: compilation
Sponsor: jpawlowski@
CTS-Coverage-Bug: 190833351
Merged-In: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
Change-Id: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
2021-06-18 14:33:41 +02:00
Jakub Pawlowski
d8ad48746d DO NOT MERGE Revert "Bluetooth: add Volume Control Profile boilerpalate"
This reverts commit 690b89ec89.

Merged-In: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
Change-Id: I164fcdeddab6579cf10174c1123984e856fa6f20
2021-06-18 14:33:03 +02:00
Alice Kuo
7579fa3425 Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage.
This change contains two item,
1. public BluetoothProfile.LE_AUDIO that App can use
BluetoothProfile.ServiceLister with LE Audio profile, such as HFP, A2DP
and hearing aid profile.
2. public getGroupId API that App can use this api to identify which
devices are in the same group

Bug: 150670922
Test: Manual test
Ignore-AOSP-First: prevent merge conflict
Change-Id: I32865720a8195b7c5ae29411cd1f3de95e7fc9b5
2021-06-18 09:26:46 +00:00
Łukasz Rymanowski
c6d6653d96 DO NOT MERGE Bluetooth: add Volume Control Profile boilerpalate
This is very simple API to allow Android to connect VCP profile.

Bug: 150670922
Test: compilation
Sponsor: jpawlowski@
CTS-Coverage-Bug: 190833351
Merged-In: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
Change-Id: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
2021-06-18 09:23:35 +00:00
Jakub Pawlowski
55ece29ae2 DO NOT MERGE Revert "Bluetooth: add Volume Control Profile boilerpalate"
This reverts commit 690b89ec89.

Merged-In: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
Change-Id: I164fcdeddab6579cf10174c1123984e856fa6f20
2021-06-18 09:23:14 +00:00
Treehugger Robot
2248a568e4 Merge "Fix NPE in logging" am: ceba9c2521 am: 01ca11578f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1736917

Change-Id: I34e9ac464bf0f2d35f86c7fbf716c0a006d6ecb4
2021-06-18 02:18:47 +00:00
Treehugger Robot
ceba9c2521 Merge "Fix NPE in logging" 2021-06-17 23:55:09 +00:00
Jakub Pawlowski
ef956abe7a Merge "Bluetooth: add Volume Control Profile boilerpalate" am: 0778be8099 am: 46a57e4af2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1736553

Change-Id: Ic5e77ef574940ec720f82e3d13026e6d74863bc2
2021-06-17 22:10:24 +00:00
Jakub Pawlowski
0778be8099 Merge "Bluetooth: add Volume Control Profile boilerpalate" 2021-06-17 21:34:30 +00:00
Martin Brabham
22f1dcf528 Fix NPE in logging
Bug: 191268917
Test: Manual test app, log OobData
Tag: #stability
Change-Id: I975722642298cb580081de9a324302d7a3282d3c
2021-06-17 20:36:06 +00:00
Rahul Sabnis
739f69bc0c Update nullability checks to use Objects#requireNonNull
instead of deprecated method in Preconditions class

Tag: #feature
Bug: 190767948
Test: Manual
Merged-In: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
Change-Id: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
2021-06-14 23:40:27 +00:00
Rahul Sabnis
710f462a5f Update nullability checks to use Objects#requireNonNull
instead of deprecated method in Preconditions class

Tag: #feature
Bug: 190767948
Test: Manual
Change-Id: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
2021-06-14 14:57:21 -07:00
Łukasz Rymanowski
690b89ec89 Bluetooth: add Volume Control Profile boilerpalate
This is very simple API to allow Android to connect VCP profile.

Bug: 150670922
Test: compilation
Sponsor: jpawlowski@
CTS-Coverage-Bug: 190833351
Change-Id: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
Merged-In: Ib20d967fcf6797077abf83b40b0eda526e5ab89d
2021-06-14 15:18:05 +00:00
Jeff Sharkey
fde28483d7 Merge "More Binder call AttributionSource assignment." into sc-dev 2021-06-04 04:07:17 +00:00
Jeff Sharkey
17bb873156 CloseGuard for more Bluetooth components.
We've seen evidence of IBluetoothProfileServiceConnection and
IBluetoothStateChangeCallback references being leaked, so attempt to
unregister them when an object is finalized without closing.

Bug: 189091551
Test: manual
Change-Id: I23792d48d94578acd7fc7a5164a95171801ee721
2021-06-03 15:38:17 -06:00
Jeff Sharkey
22ca72a675 More Binder call AttributionSource assignment.
Since developers can use a BluetoothDevice object can make remote
calls, it needs to have an accurate AttributionSource.  Previous CLs
had updated many places where these BluetoothDevice instances were
passed across Binder interfaces, but this change updates several
remaining locations which had been missed.

Introduces new "Attributable" marker interface to offer consistent
tooling when applying AttributionSource updates.

Bug: 187097694
Test: atest BluetoothInstrumentationTests
Change-Id: Icad3b9726591f0fbad58a493cefa5a0af7648280
2021-06-03 12:14:17 -06:00
Jeff Sharkey
6e8cafb843 Merge "Relax ACTION_TETHERING_STATE_CHANGED permissions." into sc-dev 2021-05-20 23:47:30 +00:00
Jeff Sharkey
263d880cf9 Relax ACTION_TETHERING_STATE_CHANGED permissions.
This broadcast doesn't contain any sensitive BluetoothDevice extras;
it only contains a single boolean indicating tethering state, so
relax it to no longer require the BLUETOOTH_CONNECT permission.

Bug: 188706031
Test: atest BluetoothInstrumentationTests
Change-Id: I2ff5c501844186a5813b2347246bbc83c190222d
2021-05-20 08:20:53 -06:00
Rahul Sabnis
b8cfbebbec Merge "Update BluetoothDevice#setAlias based on API council feedback: now accepts null input and returns an int (with error codes). Update CompanionDeviceManager#canPairWithoutPrompt to take a UserHandle instead of an int. Adds BluetoothStatusCodes class for all new Bluetooth error / success codes. Moved OOB and hci disconnect constants to the new BluetoothStatusCodes class." into sc-dev 2021-05-19 16:00:04 +00:00
Rahul Sabnis
d6b43bb520 Update BluetoothDevice#setAlias based on API council feedback: now
accepts null input and returns an int (with error codes).
Update CompanionDeviceManager#canPairWithoutPrompt to take a
UserHandle instead of an int. Adds BluetoothStatusCodes class for all
new Bluetooth error / success codes. Moved OOB and hci disconnect
constants to the new BluetoothStatusCodes class.

Tag: #feature
Bug: 184714087
Test: atest BluetoothDeviceTest#test_setAlias_getAlias
Change-Id: Ife03506f2cf68800f5824cb5fa94fec8aa34a39c
2021-05-17 16:47:55 -07:00
Jeff Sharkey
dd6dd3b1fb Apply AttributionSource during Intent delivery.
There are some Parcelables which offer to perform Binder calls, and
when these are delivered via Intent extras they fallback to
ActivityThread.currentAttributionSource(), instead of being tagged
based on the relevant app component.

This change begins using Intent.prepareToEnterProcess() as a hook to
fix-up AttributionSource when those extras finally land in the
destination process.  It uses the relevant AttributionSource based
on the Activity or Service the Intent is delivered to, which
developers have control over via AppComponentFactory.

In the case of <receiver> manifest elements, this change applies the
first android:attributionTags value to the Context used for that
BroadcastReceiver.

Bug: 187097694
Test: atest AttributionTest
Change-Id: I8f5197db7e8d7277d34f0ef2bb90bfdf1871186a
2021-05-15 09:48:14 -06:00
Treehugger Robot
ff3c817ba8 Merge "Bluetooth ScanFilter: Allow null in setDeviceAddress" am: 561b4c8aad am: 05c6b40a84 am: 32712787a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702025

Change-Id: I48df730d65443e2417acf24d563ef7d7ad780340
2021-05-12 00:37:15 +00:00
Rahul Sabnis
30002e7cd3 Merge "Update docs for BluetoothDevice#fetchUuidsWithSdp to reflect that if the device is bonding, we either broadcast cached UUIDs or wait for SDP to be performed after the device is bonded." am: d8c539d8b8 am: 27918f0cf2 am: 634cd45795
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1698769

Change-Id: I0b4ae79183c1b6e72c75369a25ca375acd4e5331
2021-05-10 21:21:20 +00:00