Commit Graph

1579 Commits

Author SHA1 Message Date
Treehugger Robot
ab98549022 Merge "Bluetooth: MCE: Add new API to set message read status or deleted status" 2020-07-14 21:05:46 +00:00
weichinweng
f6ec2d07e2 Add debug log for set/remove active device.
Bug: 160746277
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: I3decaa102345d9e9485882cfeee2fae203264e25
2020-07-08 03:41:32 +00:00
Fei Zheng
bc5eaa9e36 Bluetooth: MCE: Add new API to set message read status or deleted status
Bug: 146314855
Test:
1. Pair with a remote device which address is like 00:01:02:03:04:05
2. On remote device allow MAP connection
3. Make sure there is at least 1 unread message in last week on remote device
4. adb shell am instrument -w -e mce_set_message_status_iterations 1 -e device_address
 00:01:02:03:04:05 -e class android.bluetooth.BluetoothStressTest#testMceSetMessageStatus
 com.android.bluetooth.tests/android.bluetooth.BluetoothTestRunner

Change-Id: I7a3e337142bc39a55c1bfd425e0966e1fb1b9a68
2020-06-26 07:27:35 +08:00
Makoto Onuki
a11035a7eb Remove unnecessarily @System/TestApi annotations
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.

Exempt-From-Owner-Approval: Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: I36e3562b72e64b51e4febd1d42a3bc8e4dc60988
2020-06-24 20:49:20 +00:00
Treehugger Robot
bdc57bef81 Merge "A2DP: Check AAC bitrate mode by its CodecSpecific1" 2020-06-22 17:22:54 +00:00
Treehugger Robot
434d64e4a1 Merge "BluetoothLeScanner: clarify the documentation for permission requirements for startScan" am: 9b128b9d1b
Change-Id: I39ded23183483f8791d8a6ea8b474b5c72a7b2eb
2020-05-18 17:07:02 +00:00
Treehugger Robot
9b128b9d1b Merge "BluetoothLeScanner: clarify the documentation for permission requirements for startScan" 2020-05-18 16:51:02 +00:00
Jakub Pawlowski
f4d2f6c50c BluetoothLeScanner: clarify the documentation for permission requirements for startScan
Bug: 145153879
Change-Id: I698952f67cfc97a33b703096cbba65129a91c220
2020-05-13 17:55:53 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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