summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothGattServer.java
AgeCommit message (Collapse)Author
2022-07-26Merge TP1A.220624.020Deyao Ren
Change-Id: I357db3da652d8ce93bb26a00d0f123fae1b7c64c
2022-06-30Revert "Revert "Reuse SynchronousResultReceivers instead of creating new.""Neha Jain
This reverts commit dd85e91cea26c7f706af36c852e79d5b4ca1f173. Bug: 217366135 Reason for revert: Need this to fix a crash bug in tm-dev Change-Id: I2a94c278edc0681c5b8af6ea0a0171b71d72c650 (cherry picked from commit dbaf406ccb0ed887d4e93057c9ec0d3457f14457) Merged-In: I2a94c278edc0681c5b8af6ea0a0171b71d72c650
2022-06-29Revert "Reuse SynchronousResultReceivers instead of creating new."Neha Jain
This reverts commit 02dcbe72b3564559eaa9c2e2714824e4aac6f18c. Reason for revert: Causing builds to fail b/237471430 Change-Id: I6165d838abf312085050359377f67a68a5f8b51a (cherry picked from commit f5dd42bbd05e68f7763ccaa9fae5642acc4ceba1) Merged-In: I6165d838abf312085050359377f67a68a5f8b51a
2022-06-29Reuse SynchronousResultReceivers instead of creating new.Etienne Ruffieux
Bug: 217366135 Tag: #feature Test: manual Ignore-AOSP-First: to be chery-picked Change-Id: If8ae530a284151888a3f89a51d2c58f2a5cd3644 (cherry picked from commit 02dcbe72b3564559eaa9c2e2714824e4aac6f18c) Merged-In: If8ae530a284151888a3f89a51d2c58f2a5cd3644
2022-04-14Add Enhanced connection update SDK APIsSubramanian Srinivasan
Add support for following ECU support. 1. Enhanced connection update SDK APIs support. 2. Enhanced connection update support in Bluetooth apk and stack. CRs-Fixed: 3127801 Change-Id: I29a8d10aad4c797f7b082297dabaa3049bad5462
2022-03-17Address API council feedback on GATT API changes.Rahul Sabnis
This CL also updates the permission enforcement mechanism for GATT APIs so it now throws a SecurityException on new APIs as well as on older APIs called by apps targeting T+. Tag: #feature Bug: 217742355 Test: Manual Change-Id: I87fe2ffd088cbce4a9887538964e73f3f5198157
2022-02-01Remove allowBlocking from BluetoothManagerServiceWilliam Escande
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
2021-11-16Create memory safe overload ofRahul Sabnis
BluetoothGattServer#notifyCharacteristicChanged Tag: #feature Bug: 195157393 Test: Manual CTS-Coverage-Bug: 205190062 Change-Id: I27a59a1dac73f10f5a25c0f40d399a265544e577
2021-04-23More AttributionSource plumbing.Jeff Sharkey
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
2021-04-22Pass attribution source to BT APIs.Oli Lan
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
2021-04-16More Bluetooth API annotation updates.Jeff Sharkey
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
2021-04-14Update Bluetooth API annotations.Jeff Sharkey
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
2021-01-11gatt: Allow to set eatt supportŁukasz Rymanowski
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
2018-10-09docs: fixing errors found with lint checkerkopriva
through /bluetooth directory amending through /content directory Test: make ds-docs Bug: 117494359 Change-Id: I751e15d60f0b9cc441998b27560050bf62994fef Exempt-From-Owner-Approval: Docs-only change
2018-04-18Clarify API doc for BluetoothGattServer::addServiceStanley Tng
Clarify that the caller has to wait for onServiceAdded callback before calling BluetoothGattServer::addService again. Bug: 72717069 Test: Compile Change-Id: I20b031c724ba64bfd71cf10e58e587f69e4a2555 (cherry picked from commit 4b5cf4856064efbc018c0f2b4d6d3ff199403ee0)
2017-08-24Fix checkstyle errors (2/2)Jack He
* 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
2017-08-24Fix checkstyle errors (1/2)Jack He
* Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
2017-04-12Bluetooth 5 PHY simplificationJakub Pawlowski
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
2017-03-28Bluetooth API spelling fixes ("wether" -> "whether")Jakub Pawlowski
Bug: 30622771 Test: manual Change-Id: I01c8b18d0057f2fd6e477ce2ca0b779321b6c0e6
2017-03-27Bluetooth GATT callback naming fix "Ext" -> "" (1/2)Jakub Pawlowski
Gatt callback don't need the "Ext" postfix, as it was removed from new API. Test: manual Bug: 30622771 Change-Id: I54596ffdcb818343cc313123266cfa16291c6236
2017-03-24Expose connection update callback (4/4)Jakub Pawlowski
Test: manual Bug: 30622771 Change-Id: I56a3c42814249abc33e95e84ce092c2d8df65434
2017-03-22BluetoothGattCallbackExt removalJakub Pawlowski
New methods should be added to BluetoothGattCallback, instead of creating Ext class. Test: manual Bug: 30622771 Change-Id: I2567df5baace6bd2d2f30c36d2f62056408ca5d0
2017-03-08Bluetooth 5 PHY selection APIJakub Pawlowski
Bug: 30622771 Test: manual Change-Id: I50262a56a70466439f9700549c3c0e7bd49e2e8d (cherry picked from commit db5a87d50db9d4b3d642603f6c329b83ee5851f6)
2016-09-28Remove unused mContext from BluetoothGatt[Server]. am: 59d15654a5Jeremy Klein
am: 81648f4cee Change-Id: I11c459514e54bb486f3a90a1b0390453fc48b857
2016-09-28Remove unused mContext from BluetoothGatt[Server].Jeremy Klein
All that this member variable is doing right now is leaking a reference to a context without any benefit. Bug: 31752040 Bug: 31710795 Change-Id: If2241422533318b866340e8dcc9f5fbd9518349c
2016-08-04Fix bad index usageJakub Pawlowski
Bug: 27999121 Change-Id: Ie2ba6f71bbf6f789a3c1016ba2f0051b809ac87e
2016-08-02GATT Server refactoring (2/4)Jakub Pawlowski
Bug: 27999121 Change-Id: Ia5f91298a4b01b62adebc8adc30f27f757259588
2014-11-26Add server-side callback for change in MTU (4/4)Andre Eisenbach
When a client requests to update the LE transport MTU, the server currently does not get notified and can therefor not properly size notifications appropriate to the current MTU. Bug: 18388114 Change-Id: I515bfc2cc9846490d57de71860f41ea9a61fa243
2014-09-24Remove remanents of onConnectionCongested in framworkPrerepa Viswanadham
Bug:17289507 Change-Id: Ia28c39822141edd0e4dc3f623b8c2f280fc5f943
2014-09-11Remove onConnectionCongested callbackPrerepa Viswanadham
Bug:17289507 Change-Id: I49fd99d320084c618dcec756b832fb3b6a6aec51
2014-08-14Prevent crash in Gatt service due to null pointer inPrerepa Viswanadham
BluetoothGattCharacteristic from framework Bug 16899517 Change-Id: Ib30ddefee07c2953f9a7faeb4eaa823feeebdc8f
2014-07-18Reduce GATT logging outputAndre Eisenbach
Change-Id: Iefdf101ac849e45bf50c55ce5999364f5fbd24a4
2014-07-01LE: Fix GATT server documentation to reflect API updatesAndre Eisenbach
Change-Id: I21100dd55a7bf9e85a07742f571d5743bad5ece1
2014-06-27LE: Add notification sent and congestion callbacks (3/4)Andre Eisenbach
This change introduces two new callbacks for applications to better handle LE notification flow control and transport congestion. The notification callback is invoked when the remote platform confirms an indication or when a local notification has been passed to the controller. No new notifications should be sent until a callback is received. Congestion callbacks are triggered when a GATT operation cannot be sent to the local Bluetooth controller. Repeatedly calling writeCharacteristic() for example will eventually trigger a congestion callback. Applications cannot send additional data until a further callback is received, indicating that the congestion has cleared up. Also made server callbacks "oneway" in the AIDL definition file. Change-Id: I7fa3324712205c79efce58e5e3df8b80a265a442
2014-05-06Add transport param to Connect APIsGanesh Ganapathi Batta
Support for passing preferred transport for GATT connections as part of Connect APIs Change-Id: I93938dce519b8fa12de41d7e8690dc9355ce2dc5
2013-12-19BLE peripheral mode (3/4): Add peripheral mode API.Wei Wang
Change-Id: Id9d2f566b6d9ed0fffe73b67efad2e3d045360b4 Conflicts: core/java/android/bluetooth/BluetoothAdapter.java core/java/android/bluetooth/BluetoothGatt.java
2013-11-20Remove unused imports from frameworks/base.John Spurlock
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-05-30am 0efb9774: am b2a6d621: Merge "Update javadoc to give app write better ↵Matthew Xie
guidence" into jb-mr2-dev * commit '0efb97742ab64e01a9e7d9a9ee52d12e2f8b38d7': Update javadoc to give app write better guidence
2013-05-30Update javadoc to give app write better guidenceMatthew Xie
Update javadoc of close methods of GATT cliet and server Update javadoc of BluetoothAdapter bug 8963528 Change-Id: I45ec618fd495225ed11a6171f33bfdc218397d4c
2013-05-13BluetoothGatt: Print stack trace if an exception occurs in a callbackMike Lockwood
Change-Id: Iaaaaca8347197aae5c7fcecb2325ef4836969434
2013-04-10Make BluetoothGattServer.close() publicAndre Eisenbach
This functino is needed for applications to un-register from the Bluetooth stack. bug 8591003 Change-Id: Id05f592245d1d90791d34c3617aadac67bc6502c
2013-04-03Fix minor LE descriptor permissions issueAndre Eisenbach
Change-Id: Idded482a08f17a1373adf3e3a51709ff585d4f24
2013-03-28Unhide Bluetooth Low Energy public APIsMatthew Xie
Updated API headers. Add BluetoothManager to be retrieved by context.getSystemService(Context.BLUETOOTH_SERVICE). LE scan functions are placed in BluetoothAdapter The GATT API are device driven instead of a profile-driver. bug 8450158 Change-Id: I424a4cedaac3ef8120a05996500008dd210d2553
2013-03-12Fixed 32 bit characteristic value assignmentAndre Eisenbach
Also fixed link in comment. Change-Id: I27223b8aadae2fc7c8037abc6396760e23f6f161
2013-02-27Initial version of BLE support for BluedroidGanesh Ganapathi Batta
The API classes are hidden for now. Will unhide after API console approval. Change-Id: I8283dd562fd6189fdd15c866ef2efb8bbdbc4109