Commit Graph

1593 Commits

Author SHA1 Message Date
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
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
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
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
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
Automerger Merge Worker
687ef90ac5 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
Change-Id: I96de10ac130e3737911c050e0a76e30602c85721
2020-02-10 22:57:46 +00:00
Rahul Sabnis
eaa088f14b BluetoothA2dpSink System APIs now require BLUETOOTH_ADMIN permission
Bug: 149216030
Test: Manual
Change-Id: Ib28c7f3133eb96c1ba0b43c8b140babde699d5f4
2020-02-10 14:02:25 -08:00
Lee Shombert
a6574308c7 Binder caches for Bluetooth
* 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
2020-02-10 11:07:18 -08:00
Lee Shombert
b26612a3a8 Merge "Binder cache for Bluetooth getState()." 2020-02-10 17:25:37 +00:00
Rahul Sabnis
b0a9a5dfac 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

Bug: 148966894
Test: Manual
Change-Id: I4a798b0a16ab839f2047fc58f21c420cc99b6db6
2020-02-07 17:21:21 -08:00
Rahul Sabnis
bdc220961d Require user pass in a non-null BluetoothDevice to all BluetoothA2dp
APIs, rename APIs as per API guidelines

Bug: 147287141
Test: Manual
Change-Id: If6475af6fa7feab84eed7d3edeb0d2e24c1ed925
2020-02-07 13:29:56 -08:00
Automerger Merge Worker
f01ecddd8c Merge "BluetoothAdapter#connectAllEnabledProfiles and BluetoothAdapter#disconnectAllEnabledProfiles updated to require BLUETOOTH_PRIVILEGED permission and update documentation to indicate connection and disconnection is asynchronous" am: 750ab04052 am: 1f65bc19d4 am: 08730cb3b2
Change-Id: I5f4c5445841de8ebb61a5197156e78b512068659
2020-02-06 05:19:47 +00:00
Automerger Merge Worker
1f65bc19d4 Merge "BluetoothAdapter#connectAllEnabledProfiles and BluetoothAdapter#disconnectAllEnabledProfiles updated to require BLUETOOTH_PRIVILEGED permission and update documentation to indicate connection and disconnection is asynchronous" am: 750ab04052
Change-Id: Ie1a3555e3ca5d6a137142d3693850d72184cd3b6
2020-02-06 04:46:01 +00:00
Rahul Sabnis
966cef37c2 BluetoothAdapter#connectAllEnabledProfiles and
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
2020-02-05 16:37:18 -08:00
Lee Shombert
38265345e8 Binder cache for Bluetooth getState().
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
2020-02-05 15:16:29 +00:00
Automerger Merge Worker
e7217d3eee Merge "Change data type of duration param from int representing seconds to long representing milliseconds in BluetoothAdapter#setScanMode" am: 6d4004fc61 am: cd3f28071e am: 9514b54cfd
Change-Id: I648f6be33a3b9ec4626fc991863df4645629d2a2
2020-02-05 01:14:26 +00:00
Automerger Merge Worker
cd3f28071e Merge "Change data type of duration param from int representing seconds to long representing milliseconds in BluetoothAdapter#setScanMode" am: 6d4004fc61
Change-Id: I3a222fe93c7cc4bfc0b967e51b633ceb0605c642
2020-02-05 00:50:59 +00:00
Rahul Sabnis
99507b5eb3 Change data type of duration param from int representing seconds to long
representing milliseconds in BluetoothAdapter#setScanMode

Bug: 144380530
Test: Manual
Change-Id: I76528478a64d22afefd4ec964d1a78295dd3c94f
2020-02-04 14:29:09 -08:00
Automerger Merge Worker
e2deab502f Merge "Add privileged permission to SystemApi BluetoothDevice#setAlias" am: 7a028c7f5b am: bbfcf7fc56 am: 8eebd377ae
Change-Id: I61d78666262095cd22f3fdef7bcc50e281ddc2a0
2020-02-02 00:02:43 +00:00
Automerger Merge Worker
4104f77d64 Merge "Add new API BluetoothAdapter#removeActiveDevice to replace calls to BluetoothAdapter#setActiveDevice with a null device" am: f0f3a0f48e am: 44d8a611c4 am: 96c736b92c
Change-Id: Id0be090915b319b8f38a624279cec31c9cfd62c1
2020-02-02 00:02:21 +00:00
Automerger Merge Worker
bbfcf7fc56 Merge "Add privileged permission to SystemApi BluetoothDevice#setAlias" am: 7a028c7f5b
Change-Id: I363ded95542c1402b6828d5475e04d2554c8d01e
2020-02-01 23:41:15 +00:00
Automerger Merge Worker
44d8a611c4 Merge "Add new API BluetoothAdapter#removeActiveDevice to replace calls to BluetoothAdapter#setActiveDevice with a null device" am: f0f3a0f48e
Change-Id: Ia5a08318ebdfdee7634a6cec492b36f35e143870
2020-02-01 23:37:45 +00:00
Treehugger Robot
7a028c7f5b Merge "Add privileged permission to SystemApi BluetoothDevice#setAlias" 2020-02-01 23:37:34 +00:00
Treehugger Robot
f0f3a0f48e Merge "Add new API BluetoothAdapter#removeActiveDevice to replace calls to BluetoothAdapter#setActiveDevice with a null device" 2020-02-01 23:27:10 +00:00
Automerger Merge Worker
e55cd0e21b Merge "Revert value of BluetoothDevice.ACTION_ALIAS_CHANGED back to android.bluetooth.device.action.ALIAS_CHANGED from android.bluetooth.action.ALIAS_CHANGED" am: ea711aba95 am: 8752cb4fc7 am: bab7bb92bf
Change-Id: I3e6e9f7dd0ae3472bc97e3b28fdb6af48cb8e091
2020-02-01 22:55:34 +00:00
Automerger Merge Worker
8752cb4fc7 Merge "Revert value of BluetoothDevice.ACTION_ALIAS_CHANGED back to android.bluetooth.device.action.ALIAS_CHANGED from android.bluetooth.action.ALIAS_CHANGED" am: ea711aba95
Change-Id: Ib585b2b8831e12ba8231704a99a47ceaf0da0e8e
2020-02-01 22:32:12 +00:00
Treehugger Robot
ea711aba95 Merge "Revert value of BluetoothDevice.ACTION_ALIAS_CHANGED back to android.bluetooth.device.action.ALIAS_CHANGED from android.bluetooth.action.ALIAS_CHANGED" 2020-02-01 22:21:27 +00:00
Rahul Sabnis
e75a016d1b Revert value of BluetoothDevice.ACTION_ALIAS_CHANGED back to
android.bluetooth.device.action.ALIAS_CHANGED from
android.bluetooth.action.ALIAS_CHANGED

Bug: 146158681
Test: Manual
Change-Id: Ie247568ff3e5a750d74f22636aca69e3e74a55f5
2020-01-31 10:38:02 -08:00
Automerger Merge Worker
0b440628dd Merge "Add BLUETOOTH_PRIVILEGED permission to SystemApi BluetoothHidDevice#setConnectionPolicy" am: 3c57a25b4f am: 5404d58320 am: 8acee1db54
Change-Id: Idaab46acf3e38332bcbf4606de39a4656e3339d5
2020-01-31 16:56:25 +00:00
Automerger Merge Worker
5404d58320 Merge "Add BLUETOOTH_PRIVILEGED permission to SystemApi BluetoothHidDevice#setConnectionPolicy" am: 3c57a25b4f
Change-Id: I37da24b0dd04118a937378414412ee17acf79c70
2020-01-31 16:38:55 +00:00
Automerger Merge Worker
bcaee6a571 Merge "Add api BluetoothAdapter.getMostRecentlyConnectedDevices() to be able to get connected devices ordered by how recently they were connected" am: 4f833efcbb am: 802c49bb00 am: b551d0f9f4
Change-Id: I49225d84e7ae60cb042d31479623b19bce7608fb
2020-01-31 16:27:10 +00:00
Automerger Merge Worker
802c49bb00 Merge "Add api BluetoothAdapter.getMostRecentlyConnectedDevices() to be able to get connected devices ordered by how recently they were connected" am: 4f833efcbb
Change-Id: I5bd4a18d9f66d8a7cf59b4d7d6c0c725be2b269e
2020-01-31 16:10:50 +00:00
Rahul Sabnis
e6f17155da Add new API BluetoothAdapter#removeActiveDevice to replace calls to
BluetoothAdapter#setActiveDevice with a null device

Bug: 147428526
Test: Manual
Change-Id: I838448a504515d5a8b1eec254ccc1d9414239475
2020-01-30 16:59:02 -08:00
Rahul Sabnis
f93a469cec Add BLUETOOTH_PRIVILEGED permission to SystemApi
BluetoothHidDevice#setConnectionPolicy

Bug: 148597061
Test: Manual
Change-Id: I03875cb71483d3d6e18795324a7fbea6681fb9b0
2020-01-30 13:49:35 -08:00
Rahul Sabnis
98c6c7c4c9 Add privileged permission to SystemApi BluetoothDevice#setAlias
Bug: 144792904
Test: Manual
Change-Id: Ie11109736bb0eb4cd0f06c38db44805c0169ac5f
2020-01-30 12:02:17 -08:00
Rahul Sabnis
791dedb43f Add api BluetoothAdapter.getMostRecentlyConnectedDevices() to be able to
get connected devices ordered by how recently they were connected

Bug: 130984590
Test: Manual
Change-Id: Ie5d0c7a8e6bc5daad5ff14064b0c65b7c4c5e6b0
2020-01-29 11:53:10 -08:00
Automerger Merge Worker
8c45fefa83 Merge "Bluetooth LE COC: Delete unused testing API" am: 25983a0972 am: dfe0273968 am: e8383fd5fc
Change-Id: I336a04270cbce29fb8998474f28d0dea8eadd9d2
2020-01-25 00:29:55 +00:00
Hansong Zhang
dfe0273968 Merge "Bluetooth LE COC: Delete unused testing API"
am: 25983a0972

Change-Id: Iba4797930d442399b4078705b30eef07855dabee
2020-01-24 16:22:26 -08:00
Hansong Zhang
a0b7355a6f Bluetooth LE COC: Delete unused testing API
Some methods are for SL4A test only, and now they have been migrated.

Test: compile
Change-Id: I86e22814fc9a3fd296c359804a465b9ead4d926f
2020-01-24 21:26:07 +00:00
Automerger Merge Worker
c7e29fe189 Merge "Use @ConnectionPolicy annotation more consistently in classes with methods setConnectionPolicy and getConnectionPolicy" am: 4328fba884 am: f38016bdef am: 0f355e6ae7
Change-Id: I7777fcd80d3be4d7a523f5d296e602391949fe16
2020-01-24 07:58:44 +00:00