summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothGattServer.java
Commit message (Collapse)AuthorAgeFilesLines
* Migrating frameworks/base BT filesRoopa Sattiraju2022-01-171-954/+0
| | | | | | Bug: 206121418 Test: Compile Change-Id: Idb55371e9d678296fe46e5f4231ec2d12ec8b978
* Create memory safe overload ofRahul Sabnis2021-11-161-11/+67
| | | | | | | | | | BluetoothGattServer#notifyCharacteristicChanged Tag: #feature Bug: 195157393 Test: Manual CTS-Coverage-Bug: 205190062 Change-Id: I27a59a1dac73f10f5a25c0f40d399a265544e577
* More AttributionSource plumbing.Jeff Sharkey2021-04-231-7/+8
| | | | | | | | | | | | | | | | 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-12/+18
| | | | | | | | | | | 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-0/+12
| | | | | | | | | | | | | | | | | | 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-21/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* docs: fixing errors found with lint checkerkopriva2018-10-091-2/+2
| | | | | | | | | | | | | through /bluetooth directory amending through /content directory Test: make ds-docs Bug: 117494359 Change-Id: I751e15d60f0b9cc441998b27560050bf62994fef Exempt-From-Owner-Approval: Docs-only change
* Clarify API doc for BluetoothGattServer::addServiceStanley Tng2018-04-181-1/+5
| | | | | | | | | | 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)
* Fix checkstyle errors (2/2)Jack He2017-08-241-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | * 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-326/+347
| | | | | | | | * Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
* 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
* Bluetooth GATT callback naming fix "Ext" -> "" (1/2)Jakub Pawlowski2017-03-271-2/+2
| | | | | | | | | Gatt callback don't need the "Ext" postfix, as it was removed from new API. Test: manual Bug: 30622771 Change-Id: I54596ffdcb818343cc313123266cfa16291c6236
* Expose connection update callback (4/4)Jakub Pawlowski2017-03-241-9/+34
| | | | | | Test: manual Bug: 30622771 Change-Id: I56a3c42814249abc33e95e84ce092c2d8df65434
* BluetoothGattCallbackExt removalJakub Pawlowski2017-03-221-9/+9
| | | | | | | | | New methods should be added to BluetoothGattCallback, instead of creating Ext class. Test: manual Bug: 30622771 Change-Id: I2567df5baace6bd2d2f30c36d2f62056408ca5d0
* Bluetooth 5 PHY selection APIJakub Pawlowski2017-03-081-9/+87
| | | | | | | Bug: 30622771 Test: manual Change-Id: I50262a56a70466439f9700549c3c0e7bd49e2e8d (cherry picked from commit db5a87d50db9d4b3d642603f6c329b83ee5851f6)
* Remove unused mContext from BluetoothGatt[Server]. am: adc26ec1b4Jeremy Klein2016-09-281-3/+1
|\ | | | | | | | | | | am: 140e5cce70 Change-Id: I11c459514e54bb486f3a90a1b0390453fc48b857
| * Remove unused mContext from BluetoothGatt[Server].Jeremy Klein2016-09-281-3/+1
| | | | | | | | | | | | | | | | | | 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
* | Fix bad index usageJakub Pawlowski2016-08-041-1/+1
| | | | | | | | | | Bug: 27999121 Change-Id: Ie2ba6f71bbf6f789a3c1016ba2f0051b809ac87e
* | GATT Server refactoring (2/4)Jakub Pawlowski2016-08-021-103/+92
|/ | | | | Bug: 27999121 Change-Id: Ia5f91298a4b01b62adebc8adc30f27f757259588
* Add server-side callback for change in MTU (4/4)Andre Eisenbach2014-11-261-0/+18
| | | | | | | | | 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
* Remove remanents of onConnectionCongested in framworkPrerepa Viswanadham2014-09-241-19/+0
| | | | | Bug:17289507 Change-Id: Ia28c39822141edd0e4dc3f623b8c2f280fc5f943
* Remove onConnectionCongested callbackPrerepa Viswanadham2014-09-111-1/+2
| | | | | | Bug:17289507 Change-Id: I49fd99d320084c618dcec756b832fb3b6a6aec51
* Prevent crash in Gatt service due to null pointer inPrerepa Viswanadham2014-08-141-0/+6
| | | | | | | | BluetoothGattCharacteristic from framework Bug 16899517 Change-Id: Ib30ddefee07c2953f9a7faeb4eaa823feeebdc8f
* Reduce GATT logging outputAndre Eisenbach2014-07-181-8/+9
| | | | Change-Id: Iefdf101ac849e45bf50c55ce5999364f5fbd24a4
* LE: Fix GATT server documentation to reflect API updatesAndre Eisenbach2014-07-011-5/+5
| | | | Change-Id: I21100dd55a7bf9e85a07742f571d5743bad5ece1
* LE: Add notification sent and congestion callbacks (3/4)Andre Eisenbach2014-06-271-0/+36
| | | | | | | | | | | | | | | | | | | 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
* Add transport param to Connect APIsGanesh Ganapathi Batta2014-05-061-2/+4
| | | | | | | Support for passing preferred transport for GATT connections as part of Connect APIs Change-Id: I93938dce519b8fa12de41d7e8690dc9355ce2dc5
* BLE peripheral mode (3/4): Add peripheral mode API.Wei Wang2013-12-191-1/+1
| | | | | | | | Change-Id: Id9d2f566b6d9ed0fffe73b67efad2e3d045360b4 Conflicts: core/java/android/bluetooth/BluetoothAdapter.java core/java/android/bluetooth/BluetoothGatt.java
* Remove unused imports from frameworks/base.John Spurlock2013-11-201-9/+0
| | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* am 0fdb05a7: am b190890a: Merge "Update javadoc to give app write better ↵Matthew Xie2013-05-301-0/+3
|\ | | | | | | | | | | | | guidence" into jb-mr2-dev * commit '0fdb05a770ce3ea0bd7f6ee9bae2283a38284607': Update javadoc to give app write better guidence
| * Update javadoc to give app write better guidenceMatthew Xie2013-05-301-0/+3
| | | | | | | | | | | | | | | | Update javadoc of close methods of GATT cliet and server Update javadoc of BluetoothAdapter bug 8963528 Change-Id: I45ec618fd495225ed11a6171f33bfdc218397d4c
* | BluetoothGatt: Print stack trace if an exception occurs in a callbackMike Lockwood2013-05-131-7/+7
|/ | | | Change-Id: Iaaaaca8347197aae5c7fcecb2325ef4836969434
* Make BluetoothGattServer.close() publicAndre Eisenbach2013-04-101-2/+2
| | | | | | | | This functino is needed for applications to un-register from the Bluetooth stack. bug 8591003 Change-Id: Id05f592245d1d90791d34c3617aadac67bc6502c
* Fix minor LE descriptor permissions issueAndre Eisenbach2013-04-031-2/+3
| | | | Change-Id: Idded482a08f17a1373adf3e3a51709ff585d4f24
* Unhide Bluetooth Low Energy public APIsMatthew Xie2013-03-281-309/+99
| | | | | | | | | | 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
* Fixed 32 bit characteristic value assignmentAndre Eisenbach2013-03-121-2/+2
| | | | | | Also fixed link in comment. Change-Id: I27223b8aadae2fc7c8037abc6396760e23f6f161
* Initial version of BLE support for BluedroidGanesh Ganapathi Batta2013-02-271-0/+900
The API classes are hidden for now. Will unhide after API console approval. Change-Id: I8283dd562fd6189fdd15c866ef2efb8bbdbc4109