summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothGatt.java
Commit message (Collapse)AuthorAgeFilesLines
* Migrating frameworks/base BT filesRoopa Sattiraju2022-01-171-1848/+0
| | | | | | Bug: 206121418 Test: Compile Change-Id: Idb55371e9d678296fe46e5f4231ec2d12ec8b978
* Reduce blocking time when waiting for CharacteristicWrite queue to clearJohanna Ye2021-12-231-1/+1
| | | | | | | | up. Bug: 200073240 Test: manual build Change-Id: I62070a5789809c363dba3cb4f0d007d17e3a9ef8
* BluetoothGatt: Deprecate unsupported methodsHyundo Moon2021-12-011-4/+6
| | | | | | Bug: 207452114 Test: make update-api -j && make -j; Change-Id: Ic0534c1e25f9e35fae96886002e5ff1dd33f9fd4
* Deprecate GATT callbacks and methods that were not memory safe andRahul Sabnis2021-11-051-63/+152
| | | | | | | | | | | replace with memory safe versions. Tag: #feature Bug: 195157393 Test: Manual CTS-Coverage-Bug: 205190062 Merged-In: I5ae604ec20febcf646bfe6a8f866b218448349c1 Change-Id: I5ae604ec20febcf646bfe6a8f866b218448349c1
* Merge changes Icabed06e,I25bc13c6 am: afce05e2e5 am: 9de9c7f693Treehugger Robot2021-08-101-0/+3
|\ | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1683328 Change-Id: I50a17e3b0a1d0da3794db7704585a7d1df3af14e
| * Merge changes Icabed06e,I25bc13c6Treehugger Robot2021-08-101-0/+3
| |\ | | | | | | | | | | | | | | | * changes: Bluetooth: Add Media Control Profile Bluetooth: Add GATT_INSUFFICIENT_AUTHORIZATION error code
| | * Bluetooth: Add GATT_INSUFFICIENT_AUTHORIZATION error codeJakub Tyszkowski2021-08-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 150670922 Sponsor: jpawlowski@ Tag: #feature Test: compilation Change-Id: I25bc13c658caba48cc37b0f1f253a77fd1336b29
| * | Fix long characteristic write concurrency bug.Johanna Ye2021-07-011-6/+52
| |/ | | | | | | | | | | | | | | | | | | Tag: #stability Test: Bramble (pixel phone) with test app Bug: 169559728 Ignore-AOSP-First: Current security annotation parity Merged-In: I3e3a5ff0965c1ca4f79e70e6163bc5d6917edbd1 Change-Id: Ia2d821c5d34d8d035fbbb0b33b9bf4fc8c08b354
* | Merge "Fix long characteristic write concurrency bug." into sc-dev-plus-aospJohanna Ye2021-07-091-6/+52
|\ \
| * | Fix long characteristic write concurrency bug.Johanna Ye2021-07-021-7/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tag: #stability Test: ADT3 with test app Bug: 169559728 Ignore-AOSP-First: Current security annotation parity Merged-In: I3e3a5ff0965c1ca4f79e70e6163bc5d6917edbd1 Change-Id: I3e3a5ff0965c1ca4f79e70e6163bc5d6917edbd1
* | | Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40 ↵Johanna Ye2021-06-291-6/+18
|\ \ \ | |/ / |/| / | |/ | | | | | | | | am: 8e9787fdb1 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221 Change-Id: I3ecb6ae4c51c4a843be0eb265825966c8afb42ae
| * Add synchronization to all mDeviceBusy state changes.Johanna Ye2021-06-291-6/+18
| | | | | | | | | | | | | | Tag: #stability Test: make Bug: 169559728 Change-Id: I5c1b926a4c774b4bc5f24a9aaa66aa5f7780e121
* | Pass attribution source to BT APIs.Oli Lan2021-04-221-31/+42
| | | | | | | | | | | | | | | | | | | | | | 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
* | More Bluetooth API annotation updates.Jeff Sharkey2021-04-161-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Update Bluetooth API annotations.Jeff Sharkey2021-04-141-38/+75
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* gatt: Allow to set eatt supportŁukasz Rymanowski2021-01-111-1/+20
| | | | | | | | | | | With this patch it is possible to enable eatt_support as a GATT Client or GATT Server. Tag: #feature Bug: 159786353 Test: manually verified against device supporting EATT Sponsor: jpawlowski@ Change-Id: I6835a2bbd1b0ab9d6d64ee2bac5dfc96c0563afd
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-3/+3
| | | | | | | | | | | 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 Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
* Expose service changed event to application (2/3)HsingYuan Lo2020-09-241-0/+25
| | | | | | | | | Handle service changed event from GattService Bug: 154056389 Tag: #feature Test: test service changed scenario Change-Id: If56dcbd7cf17b23c88cceb9c67c5d75b21320965
* Update language to comply with Android's inclusive language guidanceJeff Sharkey2020-09-141-2/+2
| | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference Test: none Bug: 168334533 Exempt-From-Owner-Approval: docs updates Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-101-1/+1
| | | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I6ab53570aca580fbee1fcc927871caa09780f58f Merged-In: I6ab53570aca580fbee1fcc927871caa09780f58f
* DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) intoXin Li2019-02-141-1/+1
|\ | | | | | | | | | | | | stage-aosp-master Bug: 124234733 Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
| * docs: fixing errors found with lint checkerkopriva2018-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | through /bluetooth directory amending through /content directory Test: make ds-docs Bug: 117494359 Change-Id: I751e15d60f0b9cc441998b27560050bf62994fef Exempt-From-Owner-Approval: Docs-only change
| * Fix spelling errors in BluetoothGatt documentationStanley Tng2018-05-041-7/+7
| | | | | | | | | | | | | | | | | | Correct "paramter" to "parameter". Correct "connectoin" to connection. Bug: 79198797 Test: Compile Change-Id: I98646eec66da2aaa6f74ae2db35ea914c6a105a1 (cherry picked from commit 505c05839b8b28c5c465c2a537cf3da8a2004e63)
| * Add min_ce/max_ce parameters to requestLeConnectionUpdate()Stanley Tng2018-04-121-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | Add new test parameters, min_ce and max_ce, to the SL4A tests for LE Connection-oriented Channel (CoC) feature. This CL passes these 2 parameters to native stack. Test: Run cmd: act.py -c $MY_SL4A_CONFIG -tc BleCoc2ConnTest Bug: 77528723 Change-Id: I9d3d74f671772014209f8114c2d1b8ba606c54d5 (cherry picked from commit 148dd5bf861ad2caac0c53a53ee5154bfa413405)
* | Move some members to the "Q blacklist".Mathew Inwood2018-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e (cherry picked from commit 8c854f86a477fbbee38092f449333e1425e5cd7e)
* | Synchronize on a static final object to lock mDeviceBusyAjay Panicker2018-10-171-12/+13
| | | | | | | | | | | | | | | | Synchronizing on a field doesn't lock the object in a predictable way. Bug: 63389270 Test: Compile Change-Id: Idd3111bc94d32bc4bb320a5c25da37fe68276337
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.bluetooth.le android.bluetooth This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ifcf24c0617acd7facc0e03f30a95c3a6b09b205c Merged-In: I88a1311e27c5f9a5f9d1035db76034f86f650efc
* | Fix spelling errors in BluetoothGatt documentationStanley Tng2018-05-031-7/+7
| | | | | | | | | | | | | | | | Correct "paramter" to "parameter". Correct "connectoin" to connection. Bug: 79198797 Test: Compile Change-Id: I98646eec66da2aaa6f74ae2db35ea914c6a105a1
* | Add min_ce/max_ce parameters to requestLeConnectionUpdate()Stanley Tng2018-04-031-8/+10
|/ | | | | | | | | | | Add new test parameters, min_ce and max_ce, to the SL4A tests for LE Connection-oriented Channel (CoC) feature. This CL passes these 2 parameters to native stack. Test: Run cmd: act.py -c $MY_SL4A_CONFIG -tc BleCoc2ConnTest Bug: 77528723 Change-Id: I9d3d74f671772014209f8114c2d1b8ba606c54d5
* Add function to update LE connection parametersStanley Tng2018-02-011-0/+32
| | | | | | | | | | | As part of new SL4A tests for LE CoC to measure data throughput performance, this commit will add a function to enable the CoC Facade to modify the LE Connection Parameters especially the Connection Intervals. Test: Ran the new ACTS Tests for LE CoC Bug: 70683224 Change-Id: Ie071b09a44d68fe063198a39eb788c434b092442
* Fix included service parsing (3/3)Jakub Pawlowski2017-09-141-4/+2
| | | | | | Bug: 65637368 Test: sl4a GattIncludedServiceTest Change-Id: Idb967df9d5064b0532db7f5c250f677d1dbbc54c
* Bluetooth: fix typo in commentJakub Pawlowski2017-09-141-1/+1
| | | | | Test: none Change-Id: I48c674049df88285268145d4140870eb4ab79a62
* Bluetooth: thread-safe callback invocationJakub Pawlowski2017-09-131-29/+43
| | | | | | Bug: 65596701 Test: manual Change-Id: I92a436328a3070ea842e8e652891e485406c2ed7
* Bluetooth: fix GATT race conditions when using HandlerJakub Pawlowski2017-09-131-5/+3
| | | | | | Bug: 65596701 Test: manual Change-Id: Id703cea0543626bdd5a583da95615b650bbcc331
* Fix checkstyle errors (2/2)Jack He2017-08-241-31/+29
| | | | | | | | | | | | | | | | | | | | | | | | | * Manual style corrections with IDE assistance * Variable name refactors are done through IDE * Corrected general style errors such as: - "final private var" -> "private final var" - "&&", "+", "||" should not be at the end of line - Non-static private variable should be like "mVar" - Private static variable should be like "sVar" - Code file should always end with newline - Inherited methods should be annotated with @Override and no @hide tags - Public methods should always have a JavaDoc entry - "int[] array" is preferred over "int array[]" - private methods should be accessed without "this." when there is no name collisions. - "boolean ? true : false" -> boolean - "boolean ? false : true" -> !boolean - "boolean == true" OR "boolean != false" -> boolean - "boolean != true" OR "boolean == false" -> !boolean Bug: 63596319 Test: make checkbuild, no functional changes Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
* Fix checkstyle errors (1/2)Jack He2017-08-241-486/+542
| | | | | | | | * Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
* Merge "GATT: Expose opportunistic client API to Java"Jack He2017-07-111-4/+6
|\ | | | | | | | | | | am: 782ba0aca8 Change-Id: If29bc145c1947f2e10472565ae753696e8057dd1
| * GATT: Expose opportunistic client API to JavaJack He2017-07-111-4/+6
| | | | | | | | | | | | | | | | | | | | | | * Allow Java based programs to create an opportunistic GATT client * Such client does not hold a GATT connection. It automatically disconnects when no other GATT connections are active for the remote device. Bug: 63347806 Test: make, run battery service Change-Id: Ib9333817d7f17a1fa3ddacfa51c680890bac19ec
* | Merge "Discover primary service by UUID for PTS tests (4/4)" am: abb732fc40 ↵Jakub Pawlowski2017-05-161-1/+25
|\| | | | | | | | | | | | | | | am: 7e80b882b7 am: 23105d57d5 Change-Id: I764d8b206940a39906c6793fef24e6d5b19a8589
| * Discover primary service by UUID for PTS tests (4/4)Jakub Pawlowski2017-05-161-1/+25
| | | | | | | | | | | | Bug: 38123054 Test: manual Change-Id: I89e088e60f4325f1ece59d22efda0c907a3b716a
| * Fix Bluetooth GATT API default handler assignmentRuben Brunk2017-05-051-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Restores previous behaviour where GATT callbacks are invoked on the binder thread and not the calling process main looper thread. This fixes performance regressions as well as some NetworkOnMainThreadException's for some applications. Bug: 37544152 Bug: 37871717 Test: Covered by prior API tests. Change-Id: Id8ab705dd4d7f00030e6ac29e056dde5180670e9 (cherry picked from commit 6bdc550e27e2c4e7b32bb91085eaac898d7d1156)
| * Fix NPE when accessing mCallback in BluetoothGattJakub Pawlowski2017-04-271-16/+47
| | | | | | | | | | | | | | | | | | This issue was introduced in commit 4eab49652e48159fd37f827d30b822f2f187551e. Bug: 37710354 Test: none Change-Id: I2d985ce97c44d4e096713e156e57437f44ea3ddb
| * Bluetooth: Add handler parameter to connectGattJakub Pawlowski2017-04-251-71/+97
| | | | | | | | | | | | Bug: 37544152 Test: sl4a GattReadTest GattWriteTest Change-Id: I043dfefaafe9f3700418f2c855c52aac3644310f
| * Read by UUID for PTS tests (1/5)Jakub Pawlowski2017-04-181-0/+35
| | | | | | | | | | | | | | | | Add a hidden api for reading characteristic by UUID for PTS. Bug: 35150313 Test: sl4a GattReadTest.byUuid Change-Id: Ice4076d99e4694d20374ba0fdcae74d5ae841147
| * Bluetooth 5 PHY simplificationJakub Pawlowski2017-04-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having PHY_LE_* constants defined in four different places, with one value being different than others is misleading. Leave just PHY_LE_* definitions in BluetoothDevice, and add PHY_LE*_MASK for the mask used in PHY update API. This patch also removes need to translate PHY value between PHY update request and event, as mask is used for request, and the value is returned in event. Bug: 30622771 Test: manual Change-Id: I897effa1204a024465d55501c83c542566c4d37c
| * Bluetooth API spelling fixes ("wether" -> "whether")Jakub Pawlowski2017-03-281-1/+1
| | | | | | | | | | | | Bug: 30622771 Test: manual Change-Id: I01c8b18d0057f2fd6e477ce2ca0b779321b6c0e6
* | Fix Bluetooth GATT API default handler assignmentRuben Brunk2017-05-031-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Restores previous behaviour where GATT callbacks are invoked on the binder thread and not the calling process main looper thread. This fixes performance regressions as well as some NetworkOnMainThreadException's for some applications. Bug: 37544152 Bug: 37871717 Test: Covered by prior API tests. Change-Id: Id8ab705dd4d7f00030e6ac29e056dde5180670e9
* | Fix NPE when accessing mCallback in BluetoothGattJakub Pawlowski2017-04-271-16/+47
| | | | | | | | | | | | | | | | | | | | This issue was introduced in commit 4eab49652e48159fd37f827d30b822f2f187551e. Bug: 37710354 Test: none Change-Id: I2d985ce97c44d4e096713e156e57437f44ea3ddb (cherry picked from commit 0e4ac75f2e291305a493796186d44a081926f3a8)
* | Read by UUID for PTS tests (1/5)Jakub Pawlowski2017-04-271-0/+35
| | | | | | | | | | | | | | | | | | Add a hidden api for reading characteristic by UUID for PTS. Bug: 35150313 Test: sl4a GattReadTest.byUuid Change-Id: Ice4076d99e4694d20374ba0fdcae74d5ae841147 (cherry picked from commit de74891d1c603326691678ec301c80b4525bc4ef)
* | Bluetooth: Add handler parameter to connectGattJakub Pawlowski2017-04-251-71/+97
| | | | | | | | | | | | | | Bug: 37544152 Test: sl4a GattReadTest GattWriteTest Change-Id: I043dfefaafe9f3700418f2c855c52aac3644310f (cherry picked from commit 4eab49652e48159fd37f827d30b822f2f187551e)