OSDN Git Service

Update Bluetooth API annotations.
authorJeff Sharkey <jsharkey@android.com>
Fri, 9 Apr 2021 21:10:23 +0000 (15:10 -0600)
committerJeff Sharkey <jsharkey@android.com>
Thu, 15 Apr 2021 01:09:16 +0000 (19:09 -0600)
commit66c18f5405539bbe3a430057563d4707e7ba9dd8
treeed2e18d300b52899dc9fa6cb9170673e6409785d
parentc3eb4ad0326927080ad031b58ea20def727bd320
Update Bluetooth API annotations.

Recent work has introduced a new "Nearby devices" runtime permission
which protects all existing Bluetooth APIs; we've done this by
defining a <split-permission> to convert the old BLUETOOTH and
BLUETOOTH_ADMIN permissions into one of three new permissions:

* BLUETOOTH_ADVERTISE: Required to be able to advertise to nearby
                       Bluetooth devices.
* BLUETOOTH_CONNECT:   Allows applications to connect to paired
                       bluetooth devices.
* BLUETOOTH_SCAN:      Required to be able to discover and pair
                       nearby Bluetooth devices.

At its core, this change begins updating the Bluetooth APIs to have
correct @RequiresPermission indicating which permission is actually
enforced internally.  To ensure alignment across Binder, the newly
added "RequiresPermissionChecker" Error Prone checker was used to
discover any inconsistencies, ensuring correctness from server-side
enforcement up through to the public APIs.

In addition, since developers will continue building apps for both
modern and legacy platforms, this change introduces new auto-doc
annotations which will emit helpful consistent documentation
describing the behavior of older devices that are still using the
old permission model.

Bug: 183626724
Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true
Change-Id: I16880d3f8edee8123cb512a9d8898ceccbe576f3
20 files changed:
binder/android/bluetooth/IBluetooth.aidl
binder/android/bluetooth/IBluetoothA2dp.aidl
binder/android/bluetooth/IBluetoothA2dpSink.aidl
binder/android/bluetooth/IBluetoothAvrcpTarget.aidl
binder/android/bluetooth/IBluetoothGatt.aidl
binder/android/bluetooth/IBluetoothHeadset.aidl
binder/android/bluetooth/IBluetoothHeadsetClient.aidl
binder/android/bluetooth/IBluetoothHearingAid.aidl
binder/android/bluetooth/IBluetoothHidDevice.aidl
binder/android/bluetooth/IBluetoothHidHost.aidl
binder/android/bluetooth/IBluetoothLeAudio.aidl
binder/android/bluetooth/IBluetoothManager.aidl
binder/android/bluetooth/IBluetoothMap.aidl
binder/android/bluetooth/IBluetoothMapClient.aidl
binder/android/bluetooth/IBluetoothPan.aidl
binder/android/bluetooth/IBluetoothPbap.aidl
binder/android/bluetooth/IBluetoothPbapClient.aidl
binder/android/bluetooth/IBluetoothSap.aidl
binder/android/bluetooth/IBluetoothSocketManager.aidl
binder/android/bluetooth/IBluetoothVolumeControl.aidl