aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le
Commit message (Collapse)AuthorAgeFilesLines
* Reuse SynchronousResultReceivers instead of creating new.Etienne Ruffieux2022-06-224-21/+21
| | | | | | | | Bug: 217366135 Tag: #feature Test: manual Ignore-AOSP-First: to be chery-picked Change-Id: If8ae530a284151888a3f89a51d2c58f2a5cd3644
* Update API docs to state that the IRK must be supplied in little endianRahul Sabnis2022-06-061-5/+4
| | | | | | | | | | byte order Tag: #feature Bug: 233217148 Test: Manual (docs change) Ignore-AOSP-First: Android T docs change Change-Id: I5cab17003c22329744341235bb053cb55b4f7989
* Update API docs to indicate that BT addresses are to be provided in bigRahul Sabnis2022-05-261-35/+38
| | | | | | | | | | endian. Tag: #feature Bug: 233217148 Test: Manual (docs change) Ignore-AOSP-First: Android T docs change Change-Id: Iee36345088c886d5b43120bb10d8ddf52133de07
* Add javadoc block for each constant of AD type filterChienyuan2022-03-251-2/+170
| | | | | | | Bug: 218875964 Tag: #feature Test: atest CtsBluetoothTestCases:android.bluetooth.cts.ScanFilterTest Change-Id: I8a0e06ac56978b2c8027943e9345669c95cfcfec
* Defined value for AD type filterChienyuan2022-03-172-28/+149
| | | | | | | | Bug:218875964 Tag: #feature Test: atest CtsBluetoothTestCases:android.bluetooth.cts.ScanFilterTest Change-Id: Ia8411e181bb88dc7afd2c88fe7340168f5ee46f9
* Fix after API_reviewWilliam Escande2022-03-081-7/+20
| | | | | | | | | | | | | | | | | | * isMandatoryCodec is now public * SCAN_FAILED_OUT_OF_HARDWARE/SCANNING_TOO_FREQUENTLY is now public with a IntDef (method using the value are changed accordingly) * Update doc for EXTRA_BATTERY_LEVEL and EXTRA_PAIRING_INITIATOR and ACTION_CONNECTION_STATE_CHANGED * Add Autoclosable to BluetoothSap to remove the NotCloseable * BluetoothClass.Device.PERI* are now public Bug: 222725037 Fix: 221851154 Test: Build + TH Tag: #refactor CTS-Coverage-Bug: 222539659 Merged-In: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0 Change-Id: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
* API Changes needed for apex to buildWilliam Escande2022-02-141-0/+3
| | | | | | | | | | | internal cherry-pick Bug: 216476895 Test: Compile Tag: #refactor Change-Id: I09108622038b174104457ca18ac6ec7949978f66 Merged-In: I09108622038b174104457ca18ac6ec7949978f66 CTS-Coverage-Bug: 217352944
* Update parcel read for ScanFilterWilliam Escande2022-02-031-9/+8
| | | | | | | | | | | | | | | The writeToParcel is always writing 2 int for the `mAdvertisingDataType` and the `mAdvertisingData == null ? 0 : 1` Changed the constructor(Parcel) to do the same thing in same order Tag: #stability Fix: 217567811 Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testScanFilter' Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testStartScanPendingIntent' Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testStartScanPendingIntent_nullnull' Test: atest 'CtsBluetoothTestCases:android.bluetooth.cts.BluetoothLeScanTest#testBatchScan' Change-Id: Ie0d4d54bc74db73694c21b3f5ec646ddda8b0ec3
* LE Scanner: Add AD TYPE filter APIsChienyuan2022-02-022-22/+153
| | | | | | | | | Bug: 206906726 Test: build pass Tag: #feature Change-Id: I2d1911b0ba6d5b7ef4e32400ec557182330dd0bb Merged-In: I2d1911b0ba6d5b7ef4e32400ec557182330dd0bb (cherry picked from commit 1ca8dbd7445978fbf99e8ed34aa65f619b028959)
* Remove allowBlocking from BluetoothManagerServiceWilliam Escande2022-02-015-43/+120
| | | | | | | | | | | | | | | Since Bluetooth is becoming a mainline module, it can no longer call the allowBlocking hidden api. Instead, corresponding aidl are moved to be oneway and use a synchronous data to handle the return value. also: aosp/1927380 for similar work on all bluetooth profiles BluetoothGatt will be done next Bug: 211851706 Test: build + start bt Tag: #refactor Change-Id: I715cc2d8f2ae42be6d1099cd73095d37fa9e30f4 Merged-In: I715cc2d8f2ae42be6d1099cd73095d37fa9e30f4
* Merge "Periodic sync and PAST implementation"Treehugger Robot2022-01-272-0/+92
|\
| * Periodic sync and PAST implementationSubramanian Srinivasan2022-01-242-0/+92
| | | | | | | | | | | | | | | | | | Bug: 208222454 Test: compile Tag: #feature sponsor: siyuanh@ Change-Id: I443958d5fd61fe00f7de5c755aca98c5087b9a1d
* | Removes unnecessary owners file inRahul Sabnis2022-01-251-4/+0
| | | | | | | | | | | | | | | | | | | | packages/modules/Bluetooth/framework/java/android/bluetooth/le. Tag: #feature Bug: 196026708 Test: Manual Merged-In: I1c981819cb1e9b03d585ec36026ca10f5108b3a9 Change-Id: I1c981819cb1e9b03d585ec36026ca10f5108b3a9
* | BLE scan time optimizationKai Shi2022-01-241-0/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | BLE scan time optimization to reduce scan latency: 1)Reduce scan interval and window for low power, balanced and ambient scan modes. Balanced and ambient modes now have effectively the same settings. 2)Add screen off and screen off balanced modes with longer interval for the internal use. 3)For regular apps: Foregroud: original scan mode. Background + screen on: low power mode. Screen off: screen off mode. For foreground service: Screen on: original scan mode. Scree off: fall back to screen off/screen off balanced mode unless it requests low latency mode. 4)When App requests a new scan without recent request, its scan mode is upgraded temporarily for 6 seconds (configurable). Tag: #feature Bug: 214595841 Test: Run scan in low power, low latency and balanced scan modes with filtered and unfiltered settings both continuously and periodically. Make sure the scan mode is set correctly during screen on/off transition and background/foreground transition. Tested with multiple scan clients from both test app and other service apps. Change-Id: I291a1a80f24d431b681aae485692241dfb474c5a
* 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."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 f204effb5cc6f1cc8e5e3f75ef343db3bd339b67)
* | 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: fbd4f102c6 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: d828a59648 am: 833b8108c9 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: 278dd2a3ca am: 3a54633855 am: 78d19cf089 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: 2c15f0cbf3 ↵Treehugger Robot2021-03-221-5/+158
|\| | | | | | | | | | | | | | | am: 1cac38b565 am: e826ebf682 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: 9e15e5a37b am: ↵Chienyuan Huang2021-03-221-3/+20
|\| | | | | | | | | | | | | | | | | | | | | | | 91ef442293 am: a1390b2c58 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: c87a6fd581 am: ↵Jakub Pawlowski2021-03-031-1/+1
|\| | | | | | | | | | | | | | | | | | | 6a1ec2d700 am: 5ff9d22b48 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614522 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1452acbb0e4ad1c72633a849441619cf82002c65