summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/le
Commit message (Collapse)AuthorAgeFilesLines
* Migrating frameworks/base BT filesRoopa Sattiraju2022-01-1723-6556/+0
| | | | | | Bug: 206121418 Test: Compile Change-Id: Idb55371e9d678296fe46e5f4231ec2d12ec8b978
* Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Ashwini Oruganti2022-01-121-5/+5
|\
| * Revert "Migrate unsafe parcel APIs in framework-minus-apex"Bernardo Rufino2022-01-121-5/+5
| | | | | | | | | | | | | | | | This reverts commit 90bb3709dc75f7e44914222114752de5bce133d4. Reason for revert: b/214053959 Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
* | Merge "le advertisement address type settings" am: f28ab362fc am: 77cc19d668 ↵Md Shahriar Hossain Sajib2022-01-123-6/+125
|\ \ | | | | | | | | | | | | | | | | | | | | | am: 9770705ba0 am: a687f23cea Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1868844 Change-Id: I38abedb11bab4d7e496a8499c3d8018cf96214ae
| * | le advertisement address type settingsAndriy Naborskyy2022-01-063-6/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add api to request public or random address type for advertisements. bug: 155993389 Bug: 199827901 Tag: #feature Test: atest BluetoothInstrumentationTests Test: ACTS, SL4A, IOP and BCST, CTS, GTS Change-Id: I4a2b9918e0f0cc31649e3c1952d9ba34f78d337f
* | | Merge "Add scan result logs." am: 00d8163936 am: eb9fe6b5ec am: ecd5de9078 ↵Treehugger Robot2021-12-161-1/+12
|\| | | | | | | | | | | | | | | | | | | | | | | am: 8150ee9d3f Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1836926 Change-Id: I6e08007cbbe792f7a30ac9ed5aac8e3cc6758b51
| * | Merge "Add scan result logs."Treehugger Robot2021-12-161-1/+12
| |\ \
| | * | Add scan result logs.Mehmet Murat Sevim2021-10-151-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some GMSCore modules are missing some scan result despite the peer device is discovered by the Android BT stack. These logs will help debug such problems. Bug: 154942993 Bug: 199827901 Test: IOP and BCST Tag: #stability Change-Id: I6bd98df09ea2beb695aa9b4ac63bde307e77b182 (cherry picked from commit db952a889cd494e20836dbfef47c60e79f7990a9)
* | | | Merge "Migrate unsafe parcel APIs in framework-minus-apex"Bernardo Rufino2021-12-151-5/+5
|\ \ \ \ | |/ / / |/| | / | | |/ | |/|
| * | Migrate unsafe parcel APIs in framework-minus-apexBernardo Rufino2021-12-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Test: TH passes Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
* | | Copy attributable to BluetoothWilliam Escande2021-12-143-3/+3
|/ / | | | | | | | | | | | | | | | | | | 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
* | Added missing equals override in new Transport Data classesEtienne Ruffieux2021-12-072-3/+41
| | | | | | | | | | | | | | Tag: #feature Bug: 208904630 Test: atest Change-Id: I92cbd152eb063c866f7101040cb228036ae2c07a
* | Bluetooth: make it possible to advertise Transport Discovery DataJakub Pawlowski2021-11-184-5/+379
| | | | | | | | | | | | | | Bug: 159363165 Tag: #feature Test: called the API in test app, verified advertisement content Change-Id: I92fe0671717bda2de1be3ff022713133ad681ab6
* | Replaced BitUtils#maskedEquals hidden API callEtienne Ruffieux2021-10-252-4/+20
|/ | | | | | | | | | Added maskedEquals method to BluetoothLeUtils to prevent hidden API usage. Tag: #feature bug: 200200870 Test: Manual Change-Id: I7517cfef0b9e058e36d8d325f4a5ec653b1f804b
* Merge "Add implementation for IRK to parcelable functions." am: 400c21483c ↵Martin Brabham2021-07-291-1/+23
|\ | | | | | | | | | | | | | | am: 234cdb9d8a Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1780808 Change-Id: I3b58d01895182c3dc970589e453cbebf2bdf7c50
| * Add implementation for IRK to parcelable functions.Martin Brabham2021-07-291-1/+23
| | | | | | | | | | | | | | Bug: 194432570 Test: Manual test app; nRF connect Tag: #feature Change-Id: I54ac5e5f105d155a2d2fc826bf1f64cf34573ff9
| * Bluetooth: deprecate TruncatedFilter and ResultStorageDescriptorJakub Pawlowski2021-07-143-0/+9
| | | | | | | | | | | | | | | | | | It's not used anywhere, and the implementation actually never do anything. Bug: 192615539 Merged-In: Icf8906c972cf18d65a22d30c3a628fd54db59179 Change-Id: Icf8906c972cf18d65a22d30c3a628fd54db59179
| * Get rid of ResultStorageDescriptor in startScanJakub Pawlowski2021-07-141-15/+8
| | | | | | | | | | | | | | | | It's never used Bug: 192615539 Merged-In: Ia2d65def69b13150a20e8a2077c3fe630f8ec86e Change-Id: Ia2d65def69b13150a20e8a2077c3fe630f8ec86e
| * Update nullability checks to use Objects#requireNonNullRahul Sabnis2021-06-141-4/+4
| | | | | | | | | | | | | | | | | | | | instead of deprecated method in Preconditions class Tag: #feature Bug: 190767948 Test: Manual Merged-In: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e Change-Id: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
* | Bluetooth: deprecate TruncatedFilter and ResultStorageDescriptorJakub Pawlowski2021-07-143-0/+9
| | | | | | | | | | | | | | | | | | It's not used anywhere, and the implementation actually never do anything. Bug: 192615539 Merged-In: Icf8906c972cf18d65a22d30c3a628fd54db59179 Change-Id: Icf8906c972cf18d65a22d30c3a628fd54db59179
* | Get rid of ResultStorageDescriptor in startScanJakub Pawlowski2021-07-141-15/+8
| | | | | | | | | | | | | | | | It's never used Bug: 192615539 Merged-In: Ia2d65def69b13150a20e8a2077c3fe630f8ec86e Change-Id: Ia2d65def69b13150a20e8a2077c3fe630f8ec86e
* | Update nullability checks to use Objects#requireNonNullRahul Sabnis2021-06-141-3/+4
| | | | | | | | | | | | | | | | | | instead of deprecated method in Preconditions class Tag: #feature Bug: 190767948 Test: Manual Change-Id: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
* | More Binder call AttributionSource assignment.Jeff Sharkey2021-06-033-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "Bluetooth ScanFilter: Allow null in setDeviceAddress" am: 561b4c8aad ↵Treehugger Robot2021-05-121-0/+4
|\| | | | | | | | | | | | | | | am: 05c6b40a84 am: 32712787a0 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702025 Change-Id: I48df730d65443e2417acf24d563ef7d7ad780340
| * Bluetooth ScanFilter: Allow null in setDeviceAddressMyles Watson2021-05-101-0/+4
| | | | | | | | | | | | Bug: 187076761 Test: manual scan filter test Change-Id: I6456be4baab4b2a2b6d4607619ff92370b8b457d
| * Update docs to reflect LE batch scan report delay floorRahul Sabnis2021-04-201-5/+7
| | | | | | | | | | | | | | Tag: #feature Bug: 167340030 Test: Manual Change-Id: Ieeb0e6bccfc316fd4c8cdc40f6865b4185d6d9e8
* | Ensure privileged APIs require runtime permission.Jeff Sharkey2021-04-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Pass attribution source to BT APIs.Oli Lan2021-04-224-39/+53
| | | | | | | | | | | | | | | | | | | | | | 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
* | Update docs to reflect LE batch scan report delay floorRahul Sabnis2021-04-201-5/+7
| | | | | | | | | | | | | | Tag: #feature Bug: 167340030 Test: Manual Change-Id: Ieeb0e6bccfc316fd4c8cdc40f6865b4185d6d9e8
* | Add missing Bluetooth API permission enforcement.Jeff Sharkey2021-04-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I37a9e03ecdca6f7a6eb9d7f094e2f95a97036612
* | More Bluetooth API annotation updates.Jeff Sharkey2021-04-167-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a "BluetoothPermissionChecker" that ensures that all Bluetooth permission annotations are consistent. In addition, it verifies that all Bluetooth public APIs have been audited to be permission protected where relevant. 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. This change is only annotations and has no behavior changes. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: Ie80b15b058359bf1e9a6ee881b89cb3e5b584ca1
* | Refine BluetoothLeAdvertiser permissions.Jeff Sharkey2021-04-151-27/+12
| | | | | | | | | | | | | | | | | | | | | | | | Technically these APIs required both ADVERTISE and CONNECT, since internally it would attempt getting the device name as part of calculating packet lengths. These methods shouldn't require the CONNECT permission, so we add a getNameLengthForAdvertise() method internally to remove this dependency. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: I245417bfc26d6d3a4f8be14077c7f1d271b5959e
* | Update Bluetooth API annotations.Jeff Sharkey2021-04-144-29/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Pass AttributionSource to bluetooth scanning methods.Oli Lan2021-04-011-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | This passes the AttributionSource to AdapterService and GattService methods that perform scanning or discovery. Bug: 183203469 Test: atest GattServiceTest Test: atest AdapterServiceTest Test: atest CtsPermissionTestCases:android.permission.cts.NearbyDevicesPermissionTest Change-Id: Id68558624fbae69eac3a8613b9536eb6e0df75bf
* | Merge "ScanFilter.setDeviceAddress: Should send deviceAddress instead of ↵Jack He2021-03-231-1/+1
|\| | | | | | | | | | | | | | | mDeviceAddress to the next level" am: b4d4127efb am: c1d92b8ddd am: 7617088bd9 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649650 Change-Id: I1d0ba23462d69dbae4cde8eb6d6d271afd39797c
| * ScanFilter.setDeviceAddress: Should send deviceAddress instead of ↵Chen Chen2021-03-231-1/+1
| | | | | | | | | | | | | | | | | | mDeviceAddress to the next level Bug: 183409081 Test: build and run Change-Id: I2d25d21b0f143fc7362679e0094455c9132fda9d
* | Merge "Add new @SystemApi for specifying AddressType and IRK" am: bf516b9e11 ↵Treehugger Robot2021-03-221-5/+158
|\| | | | | | | | | | | | | | | am: 6ec4bd694b am: 48107ad1a3 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641559 Change-Id: Id8342097bc9fa720151a621342eab4d4813e0644
| * Merge "Add new @SystemApi for specifying AddressType and IRK"Treehugger Robot2021-03-211-5/+158
| |\
| | * Add new @SystemApi for specifying AddressType and IRKMartin Brabham2021-03-201-5/+158
| | | | | | | | | | | | | | | | | | | | | Bug: 178234318 Test: compiles and runs Tag: #feature Change-Id: Ib67e681af01260df98602003b2aca47963494c6f
* | | Merge "Le Scan: Add ambient discovery mode (1/2)" am: 4a47532570 am: ↵Chienyuan Huang2021-03-221-3/+20
|\| | | | | | | | | | | | | | | | | | | | | | | c1b4ca0ef5 am: fedc9228f3 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629277 Change-Id: I14fe563d36d9f63e2a39cb33599a8587a3dba73c
| * | Le Scan: Add ambient discovery mode (1/2)Chienyuan2021-03-161-3/+20
| |/ | | | | | | | | | | Bug: 177466875 Test: manual Change-Id: I4a5c8a0768903ef0838dcf55cf5cfba9a0a18eef
* | Implement per-field matching of ScanRecord.Jeff Sharkey2021-03-181-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of building out support for robustly matching Bluetooth LE devices in the wild, this change checks all "fields" contained in a ScanRecord against a given BytesMatcher. To support matching variable-length Eddystone beacons, this change also expands BytesMatcher to support both exact length and prefix based rules, which are then used with rules that verify that example Eddystone and iBeacon values can be detected with these rules: Eddystone: ⊆0016AAFE/00FFFFFF iBeacon: ⊆00FF4C0002/00FFFFFFFF Expands testing to confirm all newly added capabilities are working. Bug: 181812624 Test: atest BluetoothTests:android.bluetooth.le Test: atest FrameworksCoreTests:android.os.BytesMatcherTest Change-Id: I1cff8e08604436f4bba6f55aad64c3ce5969bf56
* | Merge "Fix comment typo in PeriodicAdvertisingParameters" am: d806639032 am: ↵Jakub Pawlowski2021-03-031-1/+1
|\| | | | | | | | | | | | | | | | | | | 5b746422d6 am: 81c2336e23 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614522 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1452acbb0e4ad1c72633a849441619cf82002c65
| * Fix comment typo in PeriodicAdvertisingParametersJakub Pawlowski2021-03-031-1/+1
| | | | | | | | | | | | | | Bug: 176967118 Test: m ds-docs-java Exempt-From-Owner-Approval: Docs-only change Change-Id: I1777ca23ba6f395eeb2ec98b970ccbf920661663
* | Merge "AdvertiseData: fix nullable collection" am: 0f12a22aa6 am: acb38137cd ↵Treehugger Robot2021-02-031-3/+3
|\| | | | | | | | | | | | | | | | | | | am: 5a1c256180 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1563681 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I6cad0419179b893a4b936ec03bc2f3ab9a92e5c5
| * AdvertiseData: fix nullable collectionAdrian Roos2021-01-281-3/+3
| | | | | | | | | | | | Bug: 152525509 Test: make checkapi Change-Id: Ia400cb2bda55b26594bc3a253612583134294edb
* | resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to masterJeff Sharkey2020-12-081-0/+4
|\| | | | | | | | | | | | | Bug: 174932174 Test: I solemnly swear I tested this conflict resolution. Exempt-From-Owner-Approval: refactoring with team leads buy-in Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
| * Improve OWNERS coverage across frameworks/base/.Jeff Sharkey2020-12-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As general background, OWNERS files expedite code reviews by helping code authors quickly find relevant reviewers, and they also ensure that stakeholders are involved in code changes in their areas. Some teams under frameworks/base/ have been using OWNERS files successfully for many years, and we're ready to expand them to cover more areas. Here's the historical coverage statistics for the last two years of changes before these new OWNERS changes land: -- 56% of changes are fully covered by OWNERS -- 17% of changes are partially covered by OWNERS -- 25% of changes have no OWNERS coverage Working closely with team leads, we've now identified clear OWNERS on a per-package basis, and we're using "include" directives whenever possible to to simplify future maintenance. With this extensive effort, we've now improved our coverage as follows: -- 98% of changes are fully covered by OWNERS -- 1% of changes are partially covered by OWNERS -- 1% of changes have no OWNERS coverage This specific change is automatically generated by a script from detailed ownership information confirmed by team leads. Bug: 174932174 Test: manual Exempt-From-Owner-Approval: refactoring with team leads buy-in Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
* | Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | | | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372