aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "Add new extra EXTRA_TRANSPORT for acl connection state broadcasts to ↵Rahul Sabnis2022-01-251-4/+12
|\| | | | | | | | | | | | | | | identify whether the connection is over LE or BR/EDR" am: 94339d1b2b am: 7162d3d7d9 am: d1cdfb8bf5 am: 3293528b8a Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1959744 Change-Id: I14775eb3b3c950e270db724c237a6a241a5f283e
| * Merge "Add new extra EXTRA_TRANSPORT for acl connection state broadcasts to ↵Rahul Sabnis2022-01-251-4/+12
| |\ | | | | | | | | | identify whether the connection is over LE or BR/EDR"
| | * Add new extra EXTRA_TRANSPORT for acl connection state broadcasts toRahul Sabnis2022-01-241-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | identify whether the connection is over LE or BR/EDR Tag: #feature Bug: 213956674 Test: Manual Change-Id: I0b00351c6f9597abd46cb6d6717eee8507333b1c
* | | SpatialAudio: Add API to switch buffer size am: a81d2c64bb am: ed2bc6fa00 ↵Chen Chen2022-01-251-0/+30
|\| | | | | | | | | | | | | | | | | | | | | | | am: c27d82992a am: 579740b026 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1954936 Change-Id: I5b66c0e24d2431323dc85ba830f4077e0a299881
| * | SpatialAudio: Add API to switch buffer sizeChen Chen2022-01-251-0/+30
| | | | | | | | | | | | | | | | | | | | | Bug: 214615268 Test: Manually test signal passing from bluetooth/system to framework Tag: #feature Change-Id: Ie556c1d271b54834f360cf64249385fe44011181
* | | Merge "Removes BluetoothDevice#getService from the non-SDK API list" am: ↵Rahul Sabnis2022-01-251-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | 06b5e8b227 am: 0395324a99 am: ffadbd5cc0 am: 243a4475c0 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1959739 Change-Id: I2214990e4a46538210330f06341dfe174ef3aedd
| * | Merge "Removes BluetoothDevice#getService from the non-SDK API list"Rahul Sabnis2022-01-251-1/+0
| |\ \
| | * | Removes BluetoothDevice#getService from the non-SDK API listRahul Sabnis2022-01-251-1/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | Tag: #feature Bug: 194935825 Test: Manual NoNonSdkCheck: Low usage rate & mainline requirements Change-Id: If19a286b1e7e349a3a88eca6a7d3368d8a89d474
* | | Merge "SpatialAudio: Provide API to allow/disallow low latency audio" am: ↵Chen Chen2022-01-211-0/+30
|\| | | | | | | | | | | | | | | | | | | | | | | 68da957020 am: 9f5236d177 am: 3a8b527f2f am: d5970adf04 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1949758 Change-Id: I44aea6834f0cc7f3e4d40a31675ac14e7a3cc4a0
| * | SpatialAudio: Provide API to allow/disallow low latency audioChen Chen2022-01-201-0/+30
| |/ | | | | | | | | | | | | | | Bug: 214615268 Test: Manually test signal passing from framework to bluetooth/system Tag: #feature Change-Id: If7e1706c54bc6652698b0f5d5570de13ae54b519
* | Merge "Temporarily comment out usages of PropertyInvalidatedCache in ↵Rahul Sabnis2022-01-141-11/+12
|\| | | | | | | | | | | | | | | Bluetooth code while it is pending migration to module-utils" am: 325365b74d am: 2df97c9b59 am: 9331dd0bca am: b89147989c Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1947703 Change-Id: I4c23485a14736907a9157cf4b25943602763b7a3
| * Temporarily comment out usages of PropertyInvalidatedCache in Bluetooth codeRahul Sabnis2022-01-121-11/+12
| | | | | | | | | | | | | | | | | | while it is pending migration to module-utils Tag: #feature Bug: 210468958 Test: Manual Change-Id: Iab59d235ca59fe2b5863fb4714eaccbc64fa915c
* | Prepare PropertyInvalidatedCache for SystemApiLee Shombert2022-01-041-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 152453213 Tag: #refactor This commit prepares PropertyInvalidatedCache to function as a system api. Specifically, the methods recompute() and bypass() which may be overridden by clients are now public (instead of protected). This forces an update to all existing clients, to accommodate the change in method visibility. Two small changes have been made as cleanup: 1. The awkwardly named debugCompareQueryResults() is now resultEquals(), which is more or less consistent with how other equality tests are named in Android. This name change affects two clients. 2. PackageManager has changed to use resultEquals() instead of maybeCheckConsistency(). This provides a simpler and more consistent use of the APIs. maybeCheckConsistency() has been made private. Test: atest PropertyInvalidatedCacheTests Change-Id: I4110f8e887a4fd8c784141e8892557a9d1b80a94
* Merge "Moved AttributionSource related APIs in AttributionSource"Etienne Ruffieux2021-12-161-1/+1
|\
| * Moved AttributionSource related APIs in AttributionSourceEtienne Ruffieux2021-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Modified myAttributionSource() to check for global AS for process in ActivityThread and fallback to building new AS with PackageManager#getPackageForUid(myUid()) if null. Tag: #feature Bug: 210467846 Bug: 210468546 Test: build Change-Id: I7aa75395469bf0bb806100420faaf98c52057355 CTS-Coverage-Bug: 210906055
* | Copy attributable to BluetoothWilliam Escande2021-12-141-1/+0
|/ | | | | | | | | | Attributable is called by bluetooth and it's hidden. By copying into bluetooth we are now allowed to call it Bug: 210467788 Test: build Tag: #refactor Change-Id: I73ea07c9439988ab5477c82799f718c6d81513be
* Merge SP1A.211105.004 to aosp-master - DO NOT MERGEBill Yi2021-11-021-1/+4
|\ | | | | | | | | | | Merged-In: I7e267e3c046d726750180efa81806cbbefb17b68 Merged-In: I5ff5973c95868bee2b7444ecded7443d6e6429c9 Change-Id: Ic3cd62083de4219dbf52f568ca4f34bdc7a08516
| * Bluetooth: Fix formatting in getAlias()Hansong Zhang2021-09-151-1/+4
| | | | | | | | | | | | | | Bug: 180747689 Test: manual Change-Id: Ic309f4aad116fd424d5d0d0e2016d61be8826b78 (cherry picked from commit 4e7449ce893cf3f3019b0201b766d0a784da1754)
| * Update BluetoothAdapter and BluetoothDevice documentationEtienne Ruffieux2021-07-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Revert "Removed BluetoothDevice#prepareToEnterProcess"Etienne Ruffieux2021-10-251-0/+5
| | | | | | | | | | | | | | | | | | This reverts commit 39639385f90678e97aa6848ae3b43de6bfb3b49e. Reason for revert: Introducing regression for gms core Test: None Change-Id: I644b10c1869c12e1622300de43bfbdb57fb583d8
* | Removed BluetoothDevice#prepareToEnterProcessEtienne Ruffieux2021-10-151-5/+0
| | | | | | | | | | | | | | Tag: #feature Bug: 200202780 Test: manual Change-Id: I8d4be1da1bcb5b819c324f1a3a89c7dc317c31d6
* | Add BluetoothDevice#connect and BluetoothDevice#disconnect as System APIsRahul Sabnis2021-09-291-0/+84
| | | | | | | | | | | | | | Tag: #feature Bug: 201462141 Test: Manual Change-Id: I79332c63e99efd9e90036ba2c693835151cc1240
* | csip: Expose an extra data with intent and store in CachedBluetoothDeviceAlice Kuo2021-09-171-1/+10
| | | | | | | | | | | | | | | | | | Bug: 178981521 Bug: 150670922 Test: Discover and pair with the CSIP supported device, and check the pairing string in the dialog Change-Id: I3e99c59e0cb974409291e1b4c28393106784e133
* | Make createBond(int) a system APIQasim Javed2021-09-161-1/+1
| | | | | | | | | | | | | | BUG: 195156317 Test: Manual Change-Id: I10d9ac305cbc1bb28c8150e1b167a0e61ad3f04e
* | Add a system api to fetch uuids by the specific transportAlice Kuo2021-08-201-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | The functionality is similar with fetchUuidsWithSdp which uses TRANSPORT_AUTO. Bt stack depends on the devie type and address type to do sdp or gatt service discovery. Add an api to specific the transport. It would be fexible to handle the dual mode device. Ignore-AOSP-First: avoid merge conflict Tag: #feature Bug: 194447999 Test: atest BluetoothInstrumentationTests Test: Take two headphone to test the dual mode behavior Change-Id: I32c8dde68969e0bdc42e4e898c43a4f2c1d3379a Merged-In: I32c8dde68969e0bdc42e4e898c43a4f2c1d3379a
* | Merge "Prevent create bond for null MAC address" am: c2ad5c7d1c am: bf8217c9acJakub Pawlowski2021-07-281-0/+6
|\ \ | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1776317 Change-Id: I42b68e9ddfad158e2b091ca60f57781081058913
| * | Prevent create bond for null MAC addressEtienne Ruffieux2021-07-281-0/+6
| | | | | | | | | | | | | | | | | | | | | Tag: #feature Bug: 193702115 Test: atest BluetoothInstrumentationTests Change-Id: I5684f00cf4a567a899c958b94af22ccf5067b476
* | | Merge "Update BluetoothAdapter and BluetoothDevice documentation" am: ↵Rahul Sabnis2021-07-021-1/+2
|\| | | |/ |/| | | | | | | | | | | 0591dcac60 am: 608a468332 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1713250 Change-Id: I3c67ce35ae5c26ff497365fb3ab683474e2b4b69
| * Update BluetoothAdapter and BluetoothDevice documentationRahul Sabnis2021-07-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | More Binder call AttributionSource assignment.Jeff Sharkey2021-06-031-20/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Update BluetoothDevice#setAlias based on API council feedback: now ↵Rahul Sabnis2021-05-191-13/+25
|\ \ | | | | | | | | | 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
| * | Update BluetoothDevice#setAlias based on API council feedback: nowRahul Sabnis2021-05-171-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Apply AttributionSource during Intent delivery.Jeff Sharkey2021-05-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Update docs for BluetoothDevice#fetchUuidsWithSdp to reflect that if ↵Rahul Sabnis2021-05-101-4/+4
|\ \ \ | |/ / |/| / | |/ | | | | | | | | the device is bonding, we either broadcast cached UUIDs or wait for SDP to be performed after the device is bonded." am: 8e3fb4c4c1 am: f7fb98276e am: 60faa32ffb Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1698769 Change-Id: I0b4ae79183c1b6e72c75369a25ca375acd4e5331
| * Update docs for BluetoothDevice#fetchUuidsWithSdp to reflect that if theRahul Sabnis2021-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | device is bonding, we either broadcast cached UUIDs or wait for SDP to be performed after the device is bonded. Tag: #feature Bug: 187157597 Test: Manual Change-Id: I1bd694195c4e974b7cd72f81848a6343b45c98fd
| * OOB: Implement getLocalOutOfBand APIMartin Brabham2021-04-071-0/+19
| | | | | | | | | | | | | | | | | | CTS-Coverage-Bug: 184395281 Bug: 178007935 Tag: #feature Test: manual Change-Id: I5bc11ac13d9cbb8f76f422aa4aea8295ebec95b4 Merged-In: I5bc11ac13d9cbb8f76f422aa4aea8295ebec95b4
* | Ensure privileged APIs require runtime permission.Jeff Sharkey2021-04-291-18/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When users revoke a runtime permission, they expect all interactions to be blocked, including those protected by the BLUETOOTH_PRIVILEGED permission. This change finishes applying that policy to any remaining Bluetooth APIs which didn't already implement it. To keep the implementation straightforward, this change does "data delivery" checks when registering for callbacks; the ideal behavior would be to wait until data is actually delivered through the callbacks, but RemoteCallbackList doesn't have support for AttributionSource yet. Bug: 186405452 Test: atest BluetoothInstrumentationTests Change-Id: Idd7be143eb8baff020a0718065293baae708041b
* | Long-tail of AttributionSource plumbing.Jeff Sharkey2021-04-241-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wires up AttributionSource across the remaining long-tail of Bluetooth AIDL interfaces, ensuring that developers can accurately make calls chained back to a specific Context. Moves "for data delivery" permission checks to happen in a single location on each interface to ensure they're performed consistently with the new AttributionSource arguments. Note that "for data delivery" isn't the best name; it's designed to represent that the requested action was performed and should result in the relevant appop being noted for the caller. This change has the positive side effect of ensuring that all interfaces are consistently enforcing the BLUETOOTH_CONNECT permission, even in the case where BLUETOOTH_PRIVILEGED is also required; this is what ensures that revoking the "Nearby devices" permission takes effect for all callers. Additionally, standardizing on enforcing permissions closer to the AIDL entry point reduces the need for @RequiresPermission annotations to be carried around inside the Bluetooth stack. Bug: 183626112 Test: atest BluetoothInstrumentationTests Change-Id: I8023dda654e325b8bfa2f0cdb994ad63a2b429d4
* | More AttributionSource plumbing.Jeff Sharkey2021-04-231-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To prepare for future work which will plumb AttributionSource values through all remaining AIDLs, we need profiles to interact directly with the specific BluetoothAdapter they were created from. This is how we'll ensure that the relevant AttributionSource can be chained down from the original Context they're obtained from. This change also marks getDefaultAdapter() as deprecated to clearly communicate that BluetoothManager.getAdapter() is the best-practice path to obtaining a correctly scoped BluetoothAdapter instance. Bug: 183626112 Test: atest BluetoothInstrumentationTests Change-Id: I1e15170d7679019bbb6e396279d6e633e3dad4d6
* | Pass attribution source to BT APIs.Oli Lan2021-04-221-28/+25
| | | | | | | | | | | | | | | | | | | | | | This adds attribution source to BT method calls. This is now required to allow the app ops for the new BT permissions (BLUETOOTH_CONNECT, BLUETOOTH_ADVERTISE, and BLUETOOTH_SCAN) to be noted. Bug: 183626112 Test: atest BluetoothInstrumentationTests Change-Id: I81598553b762e491d6364064a2e1ef41dec89bf9
* | Refinement of AttributionSource handling.Jeff Sharkey2021-04-221-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous CLs had started passing AttributionSource values across Binder calls inside BluetoothDevice instances, but this can cause confuse the permission check logic in the future; we should instead always aim to use the AttributionSource closest to the app making the call, instead of parceling it. This change also improves logging to highlight when we're quietly treating a permission as denied, and when a UID is mismatched. Bug: 186106084 Test: atest BluetoothInstrumentationTests Change-Id: I5d3fdb3c573cb9e77474952d8680caa4c4c464eb
* | Merge "Pass AttributionSource to AdapterService methods." into sc-devJeff Sharkey2021-04-211-25/+39
|\ \
| * | Pass AttributionSource to AdapterService methods.Oli Lan2021-04-211-25/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds attribution source to AdapterService bluetooth method calls. This is now required to allow the app ops for the new bluetooth permissions (BLUETOOTH_CONNECT, BLUETOOTH_ADVERTISE, and BLUETOOTH_SCAN) to be noted. Bug: 183626112 Test: atest AdapterServiceTest Test: atest CtsPermissionTestCases:android.permission.cts.NearbyDevicesPermissionTest Change-Id: I8d1fe41ca9945a3baab584f248a17b3a1eb255f7
* | | Annotations for Bluetooth broadcast intents.Jeff Sharkey2021-04-211-4/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work has been using Error Prone rules and annotations to reflect the current state of permission enforcement across the Bluetooth stack, and we're now in a position were we can add new permission enforcement that had been missing. We've currently standardized on saying that APIs that return device or Bluetooth state information (without sharing details about any particular remote Bluetooth device) do not need to be permission protected. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: I53ac7a4fe1dea57316048c3cac4fa237b6ba3d38
* | Update Bluetooth API annotations.Jeff Sharkey2021-04-141-62/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work has introduced a new "Nearby devices" runtime permission which protects all existing Bluetooth APIs; we've done this by defining a <split-permission> to convert the old BLUETOOTH and BLUETOOTH_ADMIN permissions into one of three new permissions: * BLUETOOTH_ADVERTISE: Required to be able to advertise to nearby Bluetooth devices. * BLUETOOTH_CONNECT: Allows applications to connect to paired bluetooth devices. * BLUETOOTH_SCAN: Required to be able to discover and pair nearby Bluetooth devices. At its core, this change begins updating the Bluetooth APIs to have correct @RequiresPermission indicating which permission is actually enforced internally. To ensure alignment across Binder, the newly added "RequiresPermissionChecker" Error Prone checker was used to discover any inconsistencies, ensuring correctness from server-side enforcement up through to the public APIs. In addition, since developers will continue building apps for both modern and legacy platforms, this change introduces new auto-doc annotations which will emit helpful consistent documentation describing the behavior of older devices that are still using the old permission model. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: I02aa127e8e07f239561f4f2a3bbdfc6fccb82f7f
* | OOB: Implement generateLocalOutOfBand APIMartin Brabham2021-04-061-0/+19
| | | | | | | | | | | | | | | | CTS-Coverage-Bug: 184395281 Bug: 178007935 Tag: #feature Test: manual Change-Id: I5bc11ac13d9cbb8f76f422aa4aea8295ebec95b4
* | Merge "Makes BluetoothDevice#setAlias a public API" into sc-devRahul Sabnis2021-03-231-11/+21
|\ \
| * | Makes BluetoothDevice#setAlias a public APIRahul Sabnis2021-03-221-11/+21
| | | | | | | | | | | | | | | | | | | | | Tag: #feature Bug: 181093329 Test: atest BluetoothDeviceTest Change-Id: Ib94bedab5d6d4c63a19096f61187f58dd8937b55
* | | Merge "Add new @SystemApi for specifying AddressType and IRK" am: 2c15f0cbf3 ↵Treehugger Robot2021-03-221-0/+20
|\ \ \ | |/ / |/| / | |/ | | | | | | | | am: 1cac38b565 am: e826ebf682 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641559 Change-Id: Id8342097bc9fa720151a621342eab4d4813e0644
| * Add new @SystemApi for specifying AddressType and IRKMartin Brabham2021-03-201-0/+20
| | | | | | | | | | | | | | Bug: 178234318 Test: compiles and runs Tag: #feature Change-Id: Ib67e681af01260df98602003b2aca47963494c6f