Commit Graph

1654 Commits

Author SHA1 Message Date
Hungyen Weng
bacc6cd08c Merge "Revert "BluetoothProfileConnecter now calls the ServiceListener'..."" into rvc-dev am: 1c85c4501b
Change-Id: I12ad1c145a368be02b68b83e4568149cc7703202
2020-05-04 07:04:23 +00:00
Hungyen Weng
ba5692ea72 Revert "BluetoothProfileConnecter now calls the ServiceListener'..."
Revert submission 11348591-btmap-close-gts

Reason for revert: Droidcop reverted the change due to test failure, Test failed. https://android-build.googleplex.com/builds/tests/view?invocationId=I05500004181087103&testResultId=TR42507671126333727

Reverted Changes:
I324b4ea66:BluetoothProfileConnecter now calls the ServiceLis...
I1427f1a86:Add GTS test for BluetoothMap#close

Bug: 155587865

Change-Id: I9a2645c7bbaec9fdf0c6f5972b08ba70cfe78741
2020-05-04 04:53:46 +00:00
Rahul Sabnis
5c59886603 Merge "BluetoothProfileConnecter now calls the ServiceListener's onServiceDisconnected method after unbinding the service" into rvc-dev am: 248896bf98
Change-Id: Ie116fbc7de03081640d4470c6d23e7b526136279
2020-05-03 05:33:17 +00:00
Rahul Sabnis
ee31c78cb8 BluetoothProfileConnecter now calls the ServiceListener's
onServiceDisconnected method after unbinding the service

Bug: 155120232
Test: atest BluetoothHostTest#testMapClose
Change-Id: I324b4ea6654261eb67d5ec184f6b3456ba3d1aa4
2020-05-01 15:39:47 -07:00
Philip P. Moltmann
e777a902f2 Merge "Set attributionTag for noteOp(WRITE_SETTINGS) calls" am: da8697a48b am: c5299c7c3a
Change-Id: I099944752fc3006c1e98750dd46dbebf5e50789f
2020-04-22 15:19:14 +00:00
Philip P. Moltmann
c5299c7c3a Merge "Set attributionTag for noteOp(WRITE_SETTINGS) calls" am: da8697a48b
Change-Id: I3ddd8954cf8443f549f7965cc43f2600bf92a80b
2020-04-22 15:09:28 +00:00
Philip P. Moltmann
6bb9c7bdc4 Set attributionTag for noteOp(WRITE_SETTINGS) calls
Test: atest FrameworksNetTests TetheringTests:TetheringServiceTest
Bug: 136595429
Merged-In: I33f787644c44d7b0e5ce17a433820cfcd985cdfb
Change-Id: Ic3d937e7bb5141798234ed5b2852c1f768e97495
2020-04-20 18:00:03 -07:00
Lee Shombert
9cd38fb1f3 Merge "Fix exception handling in getState() binder cache" into rvc-dev am: 6e17bc7fae
Change-Id: I802d4f142b71b215ef302a7a007e28d8a034f715
2020-04-16 16:07:19 +00:00
Lee Shombert
6d1fa6f65a Fix exception handling in getState() binder cache
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
2020-04-15 13:58:55 -07:00
TreeHugger Robot
6c78d1078b Merge "Revert "Fix exception handling in getState() binder cache"" into rvc-dev am: 58de85c41e
Change-Id: I1c5ba5ca6864051581a594551b12015c462462bf
2020-04-09 00:11:45 +00:00
Lee Shombert
2a8802d2ca Revert "Fix exception handling in getState() binder cache"
This reverts commit 81a3e1c578.

Bug: b/153505953

Change-Id: I58c46e534ccadf332d10fff8f99c85ad24340c27
2020-04-08 21:12:52 +00:00
Lee Shombert
e46da26d89 Merge "Fix exception handling in getState() binder cache" into rvc-dev am: 773cc6249e
Change-Id: I6ae7601efafdca3df5f1bdc6897a2796d3ef7fa8
2020-04-07 16:25:31 +00:00
Lee Shombert
81a3e1c578 Fix exception handling in getState() binder cache
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
2020-04-06 18:07:33 -07:00
Treehugger Robot
10a2b079b0 Merge "Independent methods to enable/disable BLE mode" am: bb3874364f am: df9658720b
Change-Id: Ie3373dda0c8d92aafdbf85d228d5596e584720ef
2020-03-30 01:52:54 +00:00
Treehugger Robot
d378d8fcd1 Merge "Independent methods to enable/disable BLE mode" am: bb3874364f am: df9658720b
Change-Id: I0cdfc70669f8a08f47895c2642a119b71551b619
2020-03-30 01:52:40 +00:00
Ugo Yu
f845259eec Independent methods to enable/disable BLE mode
* 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
2020-03-30 09:38:54 +08:00
Treehugger Robot
bb3874364f Merge "Independent methods to enable/disable BLE mode" 2020-03-30 01:20:19 +00:00
Treehugger Robot
3e831d99fc Merge "BluetoothHearingAid System APIs now throw an exception if a null BluetoothDevice is passed in" am: 364534c3d2 am: 7563cf27cf
Change-Id: I556936b79c86cb960b17a2b864c05351a7894eaf
2020-03-26 10:41:01 +00:00
Treehugger Robot
364534c3d2 Merge "BluetoothHearingAid System APIs now throw an exception if a null BluetoothDevice is passed in" 2020-03-26 10:07:30 +00:00
Rahul Sabnis
eb5712abd2 BluetoothHearingAid System APIs now throw an exception if a null
BluetoothDevice is passed in

Bug: 149238489
Test: Manual
Merged-In: I594f558bfe1e286bf74dd8dc3db4c8497fd0a025
Change-Id: I594f558bfe1e286bf74dd8dc3db4c8497fd0a025
2020-03-25 13:50:36 -07:00
TreeHugger Robot
e228bc0b61 Merge "BluetoothHearingAid System APIs now throw an exception if a null BluetoothDevice is passed in" into rvc-dev am: fc099117fc
Change-Id: I1f8863a291515441a410f1c5339b7eb3eef46cda
2020-03-25 13:42:54 +00:00
Ugo Yu
644a6d52a6 Independent methods to enable/disable BLE mode
* 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
2020-03-25 17:47:19 +08:00
Rahul Sabnis
4a55841ae5 BluetoothHearingAid System APIs now throw an exception if a null
BluetoothDevice is passed in

Bug: 149238489
Test: Manual
Change-Id: I594f558bfe1e286bf74dd8dc3db4c8497fd0a025
2020-03-24 17:57:30 -07:00
Treehugger Robot
4afaf9bf2a Merge "Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth SystemApis and for hidden connect/disconnect APIs." am: c1cae420a2 am: 123b8d34b7
Change-Id: Idfb00e82b630fb83ec70b277178ca08115d938cb
2020-03-22 08:56:44 +00:00
Rahul Sabnis
115bebfea3 Merge "Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth SystemApis and for hidden connect/disconnect APIs." into rvc-dev am: bd91b5360f
Change-Id: I342a5b035d9ded41e1a850553148c7b184f8a46c
2020-03-21 07:02:55 +00:00
Rahul Sabnis
8bc55739e7 Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth 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
2020-03-21 04:14:29 +00:00
Rahul Sabnis
2c71d16ced Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth 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
2020-03-21 04:10:15 +00:00
TreeHugger Robot
8f8d351bb8 Merge "BluetoothHearingAid#getHiSyncId now consistently uses the term HiSyncId (removed all references to CustomerId) and added link to explain what the HiSyncId represents" into rvc-dev 2020-03-21 03:00:32 +00:00
TreeHugger Robot
922833a430 Merge "Update permissions of BluetoothPan System APIs and re-hide some APIs that do not need to be System APIs." into rvc-dev 2020-03-20 16:55:47 +00:00
Rahul Sabnis
6a5d8e4b55 Update permissions of BluetoothPan System APIs and re-hide some APIs
that do not need to be System APIs.

Bug: 146045934
Test: Manual
Merged-In: Ic6325fde05294eb0266fee25f4b3e7098749a287
Change-Id: Ic6325fde05294eb0266fee25f4b3e7098749a287
2020-03-20 01:44:50 -07:00
Rahul Sabnis
b3ba6a4ee7 BluetoothHearingAid#getHiSyncId now consistently uses the term HiSyncId
(removed all references to CustomerId) and added link to explain what
the HiSyncId represents

Bug: 149238489
Test: Manual
Merged-In: I4ff2a8d46f3fc5d06a29829a69a27a0c15e466f8
Change-Id: I4ff2a8d46f3fc5d06a29829a69a27a0c15e466f8
2020-03-20 01:42:16 -07:00
Rahul Sabnis
c62712e98e Add error code for BluetoothDevice#getBatteryLevel to represent
Bluetooth is off

Bug: 147428695
Test: Manual
Merged-In: I07c2fa49954632da6aa6a93706883e4cdfd32fa6
Change-Id: I07c2fa49954632da6aa6a93706883e4cdfd32fa6
2020-03-20 01:38:06 -07:00
weichinweng
a5ed3c8016 Fix bluetooth can't turn off during network reset (2/3)
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 e547073e75)
2020-03-20 04:11:43 +00:00
Treehugger Robot
74c07d06c8 Merge "BluetoothHearingAid#getHiSyncId now consistently uses the term HiSyncId (removed all references to CustomerId) and added link to explain what the HiSyncId represents" am: e8640349ed am: 55bb6e2275
Change-Id: I677945e30762425ad600ef6f56c05fd402f2cefa
2020-03-19 20:29:49 +00:00
Treehugger Robot
e8640349ed Merge "BluetoothHearingAid#getHiSyncId now consistently uses the term HiSyncId (removed all references to CustomerId) and added link to explain what the HiSyncId represents" 2020-03-19 20:01:07 +00:00
Rahul Sabnis
3c7e8444f5 BluetoothHearingAid#getHiSyncId now consistently uses the term HiSyncId
(removed all references to CustomerId) and added link to explain what
the HiSyncId represents

Bug: 149238489
Test: Manual
Change-Id: I4ff2a8d46f3fc5d06a29829a69a27a0c15e466f8
2020-03-19 11:44:54 -07:00
Rahul Sabnis
cd3bee95ed Revert "Revert "Require user pass in a non-null BluetoothDevice ..."
Revert "Revert "Pass in active device to all BluetoothA2dp APIs ..."

Revert "Revert "Pass in active device to all BluetoothA2dp APIs ..."

Revert submission 10303287-revert-10253996-bt-a2dp-no-null-FQRXACWPIA

Reason for revert: Fixing breakage
Reverted Changes:
I4d9f2f819:Revert "Make sure calls to BluetoothA2dp APIs pass...
I771ca0d57:Revert "Need to now pass in active device instead ...
I76529c7a1:Revert "Pass in active device to all BluetoothA2dp...
I297bda68d:Revert "Require user pass in a non-null BluetoothD...
I525327959:Revert "Pass in active device to all BluetoothA2dp...
I1d8660b11:Revert "Pass in active device to all BluetoothA2dp...

Bug: 147287141
Test: Manual
Merged-In: I91ee6878cac1b84bd289278a1b965658a26fe4db
Merged-In: I4d7d971af75bff8967fd807d34dad90c32e24eba
Change-Id: I4d7d971af75bff8967fd807d34dad90c32e24eba
2020-03-18 11:10:24 -07:00
Philip P. Moltmann
12ac3f406f Rename featureId -> attributionTag
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
2020-03-12 19:26:10 +00:00
Philip P. Moltmann
aea50fc06a Rename featureId -> attributionTag
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
2020-03-12 11:47:51 -07:00
Automerger Merge Worker
fb2afb3d86 Merge "Update permissions of BluetoothPan System APIs and re-hide some APIs that do not need to be System APIs." am: 365caf6f04 am: a05c58f38d
Change-Id: I823c0912de5d688d76566f0a8dd4f61f5229b487
2020-03-10 21:07:26 +00:00
Automerger Merge Worker
20f320904f Merge "Add error code for BluetoothDevice#getBatteryLevel to represent Bluetooth is off" am: 1bb18d83eb am: 4e85f7bb92
Change-Id: Id96fc34f2d766829d18ee79c7f260b43ef95f434
2020-03-10 21:01:50 +00:00
Treehugger Robot
365caf6f04 Merge "Update permissions of BluetoothPan System APIs and re-hide some APIs that do not need to be System APIs." 2020-03-10 19:13:52 +00:00
Treehugger Robot
1bb18d83eb Merge "Add error code for BluetoothDevice#getBatteryLevel to represent Bluetooth is off" 2020-03-10 17:28:27 +00:00
Automerger Merge Worker
9a0299c3b5 Merge "Fix bluetooth can't turn off during network reset (2/3)" into rvc-dev am: d7e8b96042
Change-Id: I5d93e5d83fa8e0de7e99b70ddf30676385616fb8
2020-03-10 03:09:01 +00:00
Rahul Sabnis
d479374757 Update permissions of BluetoothPan System APIs and re-hide some APIs
that do not need to be System APIs.

Bug: 146045934
Test: Manual
Change-Id: Ic6325fde05294eb0266fee25f4b3e7098749a287
2020-03-09 16:58:34 -07:00
weichinweng
e547073e75 Fix bluetooth can't turn off during network reset (2/3)
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
2020-03-09 05:09:08 +00:00
Rahul Sabnis
ded588641b Add error code for BluetoothDevice#getBatteryLevel to represent
Bluetooth is off

Bug: 147428695
Test: Manual
Change-Id: I07c2fa49954632da6aa6a93706883e4cdfd32fa6
2020-03-06 18:04:15 -08:00
Automerger Merge Worker
0d3c3b96b0 Merge "Revert "Revert "Require user pass in a non-null BluetoothDevice ..."" into rvc-dev am: 77864d6771
Change-Id: Id16e90dfbcd5bd9f639f8acadb589614b0075841
2020-03-05 19:33:47 +00:00
TreeHugger Robot
77864d6771 Merge "Revert "Revert "Require user pass in a non-null BluetoothDevice ..."" into rvc-dev 2020-03-05 19:15:30 +00:00
Automerger Merge Worker
a1b84782c5 Merge "Update BluetoothDevice SystemApi permissions and disallow passing a null pin to BluetoothDevice#setPin" am: 5f1daae19f
Change-Id: I4204ee9c10101d99fc8e4bad4ee44fc431f2cb9f
2020-03-04 19:28:11 +00:00