aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "Remove listenUsingEncryptedRfcommOn & listenUsingScoOn" am: ↵Zach Johnson2020-08-201-46/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 22399aae26 am: 573f9d5f47 am: bfc789080d am: ad4f261011 am: edd6895fce Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404838 Change-Id: I20e64adddf20667dc2abbfd5582a8cb34e3f0285
| * | | Merge "Remove listenUsingEncryptedRfcommOn & listenUsingScoOn" am: ↵Zach Johnson2020-08-201-46/+0
| |\| | | | |/ | |/| | | | | | | | | | | | | | | | 22399aae26 am: 573f9d5f47 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404838 Change-Id: Idcfc40762221d456374fdf7ee3f96123a137a793
| | * Remove listenUsingEncryptedRfcommOn & listenUsingScoOnZach Johnson2020-08-191-46/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | both are hidden and not @UnsupportedAppUsage, so are safe to remove Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I58acb4160207fc0eeaeb7875bfd61f3bd442ad9a
* | | Merge "Add debug log for set/remove active device." am: cbb4cd1f8c am: ↵Treehugger Robot2020-07-091-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | 61663adad4 am: 85ac3ae6b4 am: b29ad7579d am: 4e57a36b7f Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1351257 Change-Id: I66e6f219b8e4ab98a62eea2cd64de027f0810f0f
| * | Merge "Add debug log for set/remove active device." am: cbb4cd1f8c am: ↵Treehugger Robot2020-07-091-0/+4
| |\| | | | | | | | | | | | | | | | | | | | | | 61663adad4 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1351257 Change-Id: I55b4b2f1296628228d36ed4259f08178b1a01d56
| | * Add debug log for set/remove active device.weichinweng2020-07-081-0/+4
| | | | | | | | | | | | | | | | | | | | | Bug: 160746277 Test: atest BluetoothInstrumentationTests Tag: #feature Change-Id: I3decaa102345d9e9485882cfeee2fae203264e25
| | * Merge "Independent methods to enable/disable BLE mode" am: 83aafb9c63 am: ↵Treehugger Robot2020-03-301-30/+7
| | |\ | | | | | | | | | | | | | | | | | | | | 6858bc6ae4 Change-Id: I0cdfc70669f8a08f47895c2642a119b71551b619
| | | * Merge "Independent methods to enable/disable BLE mode"Treehugger Robot2020-03-301-30/+7
| | | |\
| | | | * Independent methods to enable/disable BLE modeUgo Yu2020-03-251-30/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use IBluetoothManager.enableBle() and disableBle() to toggle BLE only mode instead of updateBleAppCount() then enable(). * Fix BluetoothAdapter.disableBle sometime won't disable Bluetooth. * Add active log if Bluetooth is disabled via disableBle(). Bug: 139454316 Test: enableBle() -> disableBle() and check Bluetooth is OFF. Change-Id: I173d5fed1b47ff68a6504741e25754e65cbd1455
| | * | | Merge "Add BLUETOOTH_PRIVILEGED permission as a requirement for all new ↵Treehugger Robot2020-03-221-8/+7
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | Bluetooth SystemApis and for hidden connect/disconnect APIs." am: c1cae420a2 am: ae1eb3734f Change-Id: Idfb00e82b630fb83ec70b277178ca08115d938cb
| | | * | Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth ↵Rahul Sabnis2020-03-211-8/+7
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SystemApis and for hidden connect/disconnect APIs. Hide some APIs that were previously marked as @UnsupportedAppUsage and re-add annotation as changing the permissions for these SystemApis would break the unsupported app contract that was previously there. Therefore, we're choosing to hide them until we have a good story on how to deal with them next release. Bug: 148689314 Test: Manual Merged-In: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a Change-Id: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a
| | * / Fix bluetooth can't turn off during network reset (2/3)weichinweng2020-03-201-3/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove disable Bluetooth action from AdapterService and move to BluetoothManagerService. Add factory reset reason into Bluetooth enable/disable reason list. Bug: 110181479 Test: manual Change-Id: I4bff3c3bb75fbb0d1e13c459c0d9d3fd3b8b3195 Merged-In: I4bff3c3bb75fbb0d1e13c459c0d9d3fd3b8b3195 (cherry picked from commit e18a909013a8f521a0876ab5fd67c2ec8d151323)
* | / Create a binder cache for IBluetooth.getConnectionStateLee Shombert2020-06-081-3/+37
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 157935587 This adds a binder cache for the IBluetooth.getConnectionState() method. There is no change in bluetooth functionality. Each atest is run twice. Once with the code to be committed and once with a special build that sets PropertyInvalidatedCache DEBUG and VERIFY to true. In the latter case, the test passes if the atest passes and if there are no errors from the cache verification. Tag: #feature Test: atest BluetoothInstrumentationTests Test results are Passed: 479, Failed: 0, Ignored: 4, Assumption Failed: 75 Change-Id: I2946297ffab557877dc7ec56206834d7c3776662
* | Fix exception handling in getState() binder cacheLee Shombert2020-04-151-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 153103051 A binder cache recompute() function cannot compute a result based on any data that is not known to the binder server. If the code depends on local data that can change, then invalidation will not work properly. The original getState() method returned OFF if the bluetooth service was unavailable. This computation now occurs in the getStateInternal() method, outside of the binder cache query() method. The recompute() method converts RemoteExceptions to RuntimeExceptions. Then, the conversion is reversed in getStateInternal(). This double conversion is needed because the cache recompute() method has no throw spec. Test: Create a debug image that enables binder cache VERIFY. Run the following tests: * atest BluetoothInstrumentationTests * atest PtsChreTestCases * atest UserLifecycleTests * manual testing connecting to bluetooth devices and toggling airplane mode. No cache inconsistencies found. No test failures seen. Change-Id: I93b9742587c4eb695d9a11fc6ab145f6a40a0ece
* | Revert "Fix exception handling in getState() binder cache"Lee Shombert2020-04-081-23/+9
| | | | | | | | | | | | | | | | This reverts commit 96914087869e5c82dc88fd2b114854b1589ce276. Bug: b/153505953 Change-Id: I58c46e534ccadf332d10fff8f99c85ad24340c27
* | Fix exception handling in getState() binder cacheLee Shombert2020-04-061-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 153103051 A binder cache query function cannot compute a result based on any data that is not known to the binder server. If the code depends on local data that can change, then invalidation will not work properly. The getState() method returns OFF if the bluetooth service is unavailable. This computation now occurs in the getState() method, outside of the binder cache query() method. The query method converts RemoteExceptions to RuntimeExceptions. Then, the conversion is reversed in getState(). This double conversion is needed because the cache query() method has no throw spec. Test: Run 'atest BluetoothInstrumentationTests' with a special debug image that enables binder cache VERIFY. The test found no cache inconsistencies. Change-Id: I80db86f66d8b51fa94207824c8b15972a9066ef5
* | Independent methods to enable/disable BLE modeUgo Yu2020-03-301-30/+7
| | | | | | | | | | | | | | | | | | | | | | * Use IBluetoothManager.enableBle() and disableBle() to toggle BLE only mode instead of updateBleAppCount() then enable(). * Fix BluetoothAdapter.disableBle sometime won't disable Bluetooth. * Add active log if Bluetooth is disabled via disableBle(). Bug: 139454316 Test: enableBle() -> disableBle() and check Bluetooth is OFF. Change-Id: I173d5fed1b47ff68a6504741e25754e65cbd1455
* | Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth ↵Rahul Sabnis2020-03-211-8/+7
| | | | | | | | | | | | | | | | | | | | SystemApis and for hidden connect/disconnect APIs. Hide some APIs that were previously marked as @UnsupportedAppUsage and re-add annotation as changing the permissions for these SystemApis would break the unsupported app contract that was previously there. Therefore, we're choosing to hide them until we have a good story on how to deal with them next release. Bug: 148689314 Test: Manual Change-Id: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a
* | Rename featureId -> attributionTagPhilip P. Moltmann2020-03-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the core functionality this changes everything including aidl's and field names: - Context - ContentProvider - AppOps* - Package parsing For the rest, this is a shallow change to only change to the changed APIs. This keeps the change small-ish Exempt-From-Owner-Approval: Rename Fixes: 148792795 Test: TH Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
* | Fix bluetooth can't turn off during network reset (2/3)weichinweng2020-03-091-3/+4
| | | | | | | | | | | | | | | | | | | | Remove disable Bluetooth action from AdapterService and move to BluetoothManagerService. Add factory reset reason into Bluetooth enable/disable reason list. Bug: 110181479 Test: manual Change-Id: I4bff3c3bb75fbb0d1e13c459c0d9d3fd3b8b3195
* | Binder caches for BluetoothLee Shombert2020-02-101-22/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A cache for isOffloadedFilteringSupported(). * A cache for getProfileConnectionState(). Bug: 140788621 Test: A special build that puts the PropertyInvalidatedCache in verification mode was loaded on the device. Then one iteration of MPTS was executed. No cache inconsistencies were found and no SELinux violations (associated with the binder cache) were found. The number of cache misses was approximately 15% of the total binder calls. A second test was run in which bluetooth headphones were connected and disconnected. Then bluetooth itself was disabled and then enabled. The caches were invalidated as expected and no errors were uncovered. Change-Id: Icfad1071725e2d1e320fd252a49f0c4ae8ce6ad0
* | Merge "Binder cache for Bluetooth getState()."Lee Shombert2020-02-101-24/+34
|\ \
| * | Binder cache for Bluetooth getState().Lee Shombert2020-02-051-24/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 140788621 Test: A special build that puts the PropertyInvalidatedCache in verification mode was loaded on the device. Then one iteration of MPTS was executed. No cache inconsistencies were found and no SELinux violations (associated with the binder cache) were found. The number of cache misses was approximately 3% of the total binder calls. All binder calls went through the cache. Repeated the test with a work profile installed (to provide a second user ID). Change-Id: I2f1d0b6d61dedc5d1badb06a20c5932eca415904
* | | Merge "BluetoothAdapter#connectAllEnabledProfiles and ↵Automerger Merge Worker2020-02-061-6/+14
|\ \ \ | |/ / |/| / | |/ | | | | BluetoothAdapter#disconnectAllEnabledProfiles updated to require BLUETOOTH_PRIVILEGED permission and update documentation to indicate connection and disconnection is asynchronous" am: 750ab04052 am: 9d808a1233 am: 458782b1d0 Change-Id: I5f4c5445841de8ebb61a5197156e78b512068659
| * BluetoothAdapter#connectAllEnabledProfiles andRahul Sabnis2020-02-051-6/+14
| | | | | | | | | | | | | | | | | | | | BluetoothAdapter#disconnectAllEnabledProfiles updated to require BLUETOOTH_PRIVILEGED permission and update documentation to indicate connection and disconnection is asynchronous Bug: 147321746 Test: Manual Change-Id: I961f02a539a247b1397ce4f478b9dc804d9973ab
* | Merge "Change data type of duration param from int representing seconds to ↵Automerger Merge Worker2020-02-051-10/+23
|\| | | | | | | | | | | long representing milliseconds in BluetoothAdapter#setScanMode" am: 6d4004fc61 am: 33375d0091 am: 02ca316570 Change-Id: I648f6be33a3b9ec4626fc991863df4645629d2a2
| * Change data type of duration param from int representing seconds to longRahul Sabnis2020-02-041-10/+23
| | | | | | | | | | | | | | | | representing milliseconds in BluetoothAdapter#setScanMode Bug: 144380530 Test: Manual Change-Id: I76528478a64d22afefd4ec964d1a78295dd3c94f
* | Merge "Add new API BluetoothAdapter#removeActiveDevice to replace calls to ↵Automerger Merge Worker2020-02-021-4/+51
|\| | | | | | | | | | | BluetoothAdapter#setActiveDevice with a null device" am: 1956590f8c am: 252d2639bf am: 271161a77f Change-Id: Id0be090915b319b8f38a624279cec31c9cfd62c1
| * Add new API BluetoothAdapter#removeActiveDevice to replace calls toRahul Sabnis2020-01-301-4/+51
| | | | | | | | | | | | | | | | BluetoothAdapter#setActiveDevice with a null device Bug: 147428526 Test: Manual Change-Id: I838448a504515d5a8b1eec254ccc1d9414239475
* | Merge "Add api BluetoothAdapter.getMostRecentlyConnectedDevices() to be able ↵Automerger Merge Worker2020-01-311-0/+27
|\| | | | | | | | | | | to get connected devices ordered by how recently they were connected" am: 4f833efcbb am: 3007e729f3 am: 7ad6f1f1e2 Change-Id: I49225d84e7ae60cb042d31479623b19bce7608fb
| * Add api BluetoothAdapter.getMostRecentlyConnectedDevices() to be able toRahul Sabnis2020-01-291-0/+27
| | | | | | | | | | | | | | | | get connected devices ordered by how recently they were connected Bug: 130984590 Test: Manual Change-Id: Ie5d0c7a8e6bc5daad5ff14064b0c65b7c4c5e6b0
* | Merge "Bluetooth LE COC: Delete unused testing API" am: 25983a0972 am: ↵Automerger Merge Worker2020-01-251-25/+0
|\| | | | | | | | | | | a55000a6ab am: 2db15b953a Change-Id: I336a04270cbce29fb8998474f28d0dea8eadd9d2
| * Bluetooth LE COC: Delete unused testing APIHansong Zhang2020-01-241-25/+0
| | | | | | | | | | | | | | Some methods are for SL4A test only, and now they have been migrated. Test: compile Change-Id: I86e22814fc9a3fd296c359804a465b9ead4d926f
* | Merge "Add error log to BluetoothAdapter.factoryReset() and make ↵Automerger Merge Worker2020-01-221-1/+2
|\| | | | | | | | | | | BluetoothAdapter.getUuids() marked with @Nullable" am: a74b5a7942 am: 8dc9510941 am: 500f1832c9 Change-Id: Ib5c91460b57d58fad612c6bab74009b9282485bd
| * Merge "Add error log to BluetoothAdapter.factoryReset() and make ↵Treehugger Robot2020-01-221-1/+2
| |\ | | | | | | | | | BluetoothAdapter.getUuids() marked with @Nullable"
| | * Add error log to BluetoothAdapter.factoryReset() and makeRahul Sabnis2020-01-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | BluetoothAdapter.getUuids() marked with @Nullable Bug: 144765076 Test: Manual Change-Id: I2a38fbb2256177ad29e2739ccbec8c13aae9df6a
| * | 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
* | Merge "Support PBAP for get/close profile proxy" am: c5458e75d9 am: ↵Automerger Merge Worker2020-01-101-0/+7
|\| | | | | | | | | | | 635c740258 am: d440adecf1 Change-Id: Icd8f45c4d19b92e9249240625ed392dd8f2cdaa4
| * Support PBAP for get/close profile proxyChienyuan2020-01-081-0/+7
| | | | | | | | | | | | | | Bug: 147078847 Test: manual Change-Id: Iabcf9ab81b052be8f6f7388843681450a1cd7da4
* | Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-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
* | Pipe featureId from app to noteOp in BT codePhilip P. Moltmann2019-12-141-1/+1
|/ | | | | | Test: atest CtsAppOpsTestCases (Now with canary test for this code) Bug: 136595429 Change-Id: I90bb6b017da4f03038fce76760a860390b727f00
* Pipe featureId from app to noteOp in BT codePhilip P. Moltmann2019-12-131-2/+12
| | | | | | | | | | | | | | | FeatureIds are not yet available, hence in BTManager we assume always a "null" featureId. The effect of this change is that for apps that opt into using featureIds, they will have one BluetoothAdapter per feature, not one per process as before. In my testing this caused no problem. Most apps won't use featureIds, hence for most apps there is no change in behavior. Test: used bluetooth Bug: 136595429 Change-Id: Ic40326ea331c60f764f213bb2673cb4c49a81604
* Merge changes from topics "merge BT bond", "parameterize BT enable", "remove ↵Zach Johnson2019-12-061-12/+1
|\ | | | | | | | | | | | | | | | | BT isEnabled" * changes: Collapse the implementations of BluetoothDevice.createBond Call parameterized version of IBluetooth.enable Implement isEnabled in terms of getState
| * Implement isEnabled in terms of getStateZach Johnson2019-11-261-12/+1
| | | | | | | | | | | | Bug: 145171640 Test: compile & check everything works normally Change-Id: I169e220ab83546d76317e518652c66c9bd2229a2
* | Merge "Rename priority to connection policy in bluetooth apis"Treehugger Robot2019-12-041-0/+45
|\ \
| * | Rename priority to connection policy in bluetooth apisRahul Sabnis2019-12-021-0/+45
| |/ | | | | | | | | | | Bug: 145005327 Test: Manual Change-Id: I43ad57feb7dd70f39005ad7a01bc7dac6fb7b639
* / Add SystemApi to setActiveDevice in BluetoothAdapterRahul Sabnis2019-12-021-0/+66
|/ | | | | | Bug: 145004683 Test: Manual Change-Id: I70f46bb0153a8a0f3755dc2b3e26e556bd092daa
* Create systemapis to connect/disconnect all bt profilesRahul Sabnis2019-11-151-0/+50
| | | | | | Bug: 143495377 Test: Manual Change-Id: I80d816083ef568df319afddfd4557ef74d37d16f
* Refactor BluetoothAdapter APIs used by SettingsRahul Sabnis2019-11-041-14/+37
| | | | | | Bug: 143238544 Test: Manual Change-Id: Ia831d2b4b628b746493602857bcb54b585f13e12
* Include BLE<->SPP transition states in isLeEnabledDan Harms2019-08-071-1/+4
| | | | | | Fixes: 138997297 Test: Start scan while in transition and observe no exceptions Change-Id: Ib8b05c30c3db8e398194572a179028647e703a9f