Commit Graph

1628 Commits

Author SHA1 Message Date
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
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
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
Rahul Sabnis
35bc5b5b28 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: I4d7d971af75bff8967fd807d34dad90c32e24eba
Change-Id: I4d7d971af75bff8967fd807d34dad90c32e24eba
2020-03-03 16:20:50 -08:00
Rahul Sabnis
5f9232f3f7 Update BluetoothDevice SystemApi permissions and disallow passing a null
pin to BluetoothDevice#setPin

Bug: 147428695
Test: Manual
Merged-In: I74613d61420babecf5f1976fe33a2e1a729b71a1
Change-Id: I74613d61420babecf5f1976fe33a2e1a729b71a1
2020-03-03 11:29:58 -08:00
Automerger Merge Worker
488355b206 Merge "Update BluetoothDevice SystemApi permissions and disallow passing a null pin to BluetoothDevice#setPin" into rvc-dev am: 1f9f5ddd1c
Change-Id: Ia6ca3eee69bf89161824cf6b428363e48b9a8e3e
2020-03-03 19:26:16 +00:00
TreeHugger Robot
1f9f5ddd1c Merge "Update BluetoothDevice SystemApi permissions and disallow passing a null pin to BluetoothDevice#setPin" into rvc-dev 2020-03-03 19:14:16 +00:00
Rahul Sabnis
82425166a8 Update BluetoothDevice SystemApi permissions and disallow passing a null
pin to BluetoothDevice#setPin

Bug: 147428695
Test: Manual
Change-Id: I74613d61420babecf5f1976fe33a2e1a729b71a1
2020-03-02 16:41:20 -08:00
TreeHugger Robot
4894b560a5 Merge "Add missing RequiresPermission annotations in BluetoothHidHost and BluetoothMap APIs, disallow null device input for setConnectionPolicy, getConnectionPolicy, and getConnectionState in BluetoothHidHost, and BluetoothMap implements AutoCloseable, its close() method is public, and utilizes a CloseGuard." into rvc-dev 2020-03-02 19:16:12 +00:00
Rahul Sabnis
946bf8834b Add missing RequiresPermission annotations in BluetoothHidHost and
BluetoothMap APIs, disallow null device input for setConnectionPolicy,
getConnectionPolicy, and getConnectionState in BluetoothHidHost, and
BluetoothMap implements AutoCloseable, its close() method is public, and
utilizes a CloseGuard.

Bug: 149238030
Test: Manual
Merged-In: I8add9e26afcaf1a988c15e3cc7f8c446491f0686
Change-Id: I8add9e26afcaf1a988c15e3cc7f8c446491f0686
2020-03-02 19:13:19 +00:00
Automerger Merge Worker
65d3f63d76 Merge "Sanitize Bluetooth device names without regex" am: 6bd37ba788 am: b8f0a92e0b
Change-Id: I044fa2a33359b90724e68f89b1762e0e2b3b196a
2020-03-01 03:47:30 +00:00
Automerger Merge Worker
b8f0a92e0b Merge "Sanitize Bluetooth device names without regex" am: 6bd37ba788
Change-Id: I97c50cc31e681e53cc74d76803e3e24566b7e5dd
2020-03-01 03:34:53 +00:00
Treehugger Robot
6bd37ba788 Merge "Sanitize Bluetooth device names without regex" 2020-03-01 03:21:38 +00:00
Dan Sandler
1add9f0bc2 Sanitize Bluetooth device names without regex
Saves a considerable amount of RAM.

Fixes: 145623858
Test: Pair with a simulated device with whitespace in the name
Change-Id: I1c8b00922534ee5941be6b14948c0941c5640862
2020-02-28 16:45:23 -08:00
Rahul Sabnis
7f6bfd9dc1 Update javadoc to reflect that BluetoothPbap#setConnectionPolicy returns
true on successfully setting the connection policy instead of on
disconnection. It also now indicates that if
BluetoothProfile#CONNECTION_POLICY_FORBIDDEN is passed in, the profile
will be disconnected.

Bug: 148966894
Test: Manual
Change-Id: I881c240fcbce0c8148625c35e6e88ab02ea7122f
2020-02-28 13:13:51 -08:00
Automerger Merge Worker
c4721f1fe4 Merge "Add missing RequiresPermission annotations in BluetoothHidHost and BluetoothMap APIs, disallow null device input for setConnectionPolicy, getConnectionPolicy, and getConnectionState in BluetoothHidHost, and BluetoothMap implements AutoCloseable, its close() method is public, and utilizes a CloseGuard." am: a9e6a280f8 am: 7e3f076b2c
Change-Id: I2932905cba9dfff800e705289bca07c48898791c
2020-02-26 18:14:24 +00:00
Automerger Merge Worker
7e3f076b2c Merge "Add missing RequiresPermission annotations in BluetoothHidHost and BluetoothMap APIs, disallow null device input for setConnectionPolicy, getConnectionPolicy, and getConnectionState in BluetoothHidHost, and BluetoothMap implements AutoCloseable, its close() method is public, and utilizes a CloseGuard." am: a9e6a280f8
Change-Id: Iee457f25ea65b2507986f7e111341fc9924f56e3
2020-02-26 18:01:50 +00:00
Rahul Sabnis
f9e92a836f Add missing RequiresPermission annotations in BluetoothHidHost and
BluetoothMap APIs, disallow null device input for setConnectionPolicy,
getConnectionPolicy, and getConnectionState in BluetoothHidHost, and
BluetoothMap implements AutoCloseable, its close() method is public, and
utilizes a CloseGuard.

Bug: 149238030
Test: Manual
Change-Id: I8add9e26afcaf1a988c15e3cc7f8c446491f0686
2020-02-25 12:03:48 -08:00
Automerger Merge Worker
25ca788a9c Merge "Update javadoc to reflect that BluetoothPbap#setConnectionPolicy returns true on successfully setting the connection policy instead of on disconnection. It also now indicates that if BluetoothProfile#CONNECTION_POLICY_FORBIDDEN is passed in, the profile will be disconnected." am: a09e9e4fe1 am: 4b67009cb2
Change-Id: I2c45ced103eb119e1a8e57b9d78c9f221decd3ae
2020-02-25 10:16:08 +00:00
Automerger Merge Worker
4b67009cb2 Merge "Update javadoc to reflect that BluetoothPbap#setConnectionPolicy returns true on successfully setting the connection policy instead of on disconnection. It also now indicates that if BluetoothProfile#CONNECTION_POLICY_FORBIDDEN is passed in, the profile will be disconnected." am: a09e9e4fe1
Change-Id: I576a4f4f233f2e84d623d739090141e862db38d8
2020-02-25 09:56:24 +00:00
Rahul Sabnis
746e713d80 Update javadoc to reflect that BluetoothPbap#setConnectionPolicy returns
true on successfully setting the connection policy instead of on
disconnection. It also now indicates that if
BluetoothProfile#CONNECTION_POLICY_FORBIDDEN is passed in, the profile
will be disconnected.

Bug: 148966894
Test: Manual
Change-Id: I881c240fcbce0c8148625c35e6e88ab02ea7122f
2020-02-24 13:28:30 -08:00
Lee Shombert
9202f4dbd3 Binder cache for Bluetooth getBondState()
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
10% of the total binder calls.  Then the phone was cycled through bluetooth
pairing and unpairing events.

Change-Id: Ia494f0ad58b889130052e5beb3bec6d1011508ef
2020-02-19 01:04:44 +00:00
Zach Johnson
c425dc2958 Merge "Revert "Require user pass in a non-null BluetoothDevice to all B..."" 2020-02-12 21:39:47 +00:00
Daniel Chapin
45fefe0f65 Revert "Require user pass in a non-null BluetoothDevice to all B..."
Revert "Pass in active device to all BluetoothA2dp APIs in packa..."

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

Revert submission 10253996-bt-a2dp-no-null

Reason for revert: b/149361880
Reverted Changes:
If43934374: Pass in active device to all BluetoothA2dp APIs in...
I22dd1ca36: Make sure calls to BluetoothA2dp APIs pass non-nul...
If6475af6f: Require user pass in a non-null BluetoothDevice to...
I9d0e2c89c: Pass in active device to all BluetoothA2dp APIs in...
I1faa6174d: Need to now pass in active device instead of null ...
I69a941a7e: Pass in active device to all BluetoothA2dp APIs in...

Change-Id: I297bda68da5023fd832201c485554d6bff05fa78
2020-02-12 17:16:10 +00:00
TreeHugger Robot
ed1e5bb875 Merge "Require user pass in a non-null BluetoothDevice to all BluetoothA2dp APIs, rename APIs as per API guidelines" 2020-02-11 02:36:51 +00:00
Automerger Merge Worker
2de8671a67 Merge "BluetoothA2dpSink System APIs now require BLUETOOTH_ADMIN permission" am: 88fba38a1c am: 940853b36f am: 87adc2705f
Change-Id: I315fc5ad3a124b3d38b4104c8afb35557d440b84
2020-02-10 23:53:01 +00:00
Automerger Merge Worker
940853b36f Merge "BluetoothA2dpSink System APIs now require BLUETOOTH_ADMIN permission" am: 88fba38a1c
Change-Id: If1599cabe081cd259051ffd36e2a597443919de7
2020-02-10 23:29:58 +00:00
Automerger Merge Worker
c592b3d042 Merge "Update BluetoothPbap class description to indicate how to create an instance of the class, add intdef to return value of BluetoothPbap#getConnectionState, and move all SystemApis to require the BLUETOOTH_PRIVILEGED permission" am: cc89e59203 am: 687ef90ac5 am: ccc1ad01e8
Change-Id: Ie7d5fb2def3e86d488150cc271e788e346f2ac76
2020-02-10 23:29:19 +00:00
Treehugger Robot
88fba38a1c Merge "BluetoothA2dpSink System APIs now require BLUETOOTH_ADMIN permission" 2020-02-10 23:16:52 +00:00