diff options
| author | 2025-01-27 13:25:40 -0800 | |
|---|---|---|
| committer | 2025-01-27 13:25:40 -0800 | |
| commit | dd62d7fe40eabaf295ce9eacac9d74e39217a2fa (patch) | |
| tree | e21d1242bba34492d7aafbc2d7e96dd22d35200b /framework/java | |
| parent | 63e6cf519cac31f5d2be6ecd0bff37bca69691c3 (diff) | |
| parent | 86a00be94094dc8a7bf1c478831685a251d288ec (diff) | |
Merge "A2dp: relax getCodecStatus PRIVILEGED to allow cdm" into main am: c581cdaea7 am: 86a00be940
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3455239
Change-Id: I92ed10d938f8d0f863ea3dce46e465639d8fff77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'framework/java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothA2dp.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/framework/java/android/bluetooth/BluetoothA2dp.java b/framework/java/android/bluetooth/BluetoothA2dp.java index 5bcd0789ab..54f2c702aa 100644 --- a/framework/java/android/bluetooth/BluetoothA2dp.java +++ b/framework/java/android/bluetooth/BluetoothA2dp.java @@ -724,20 +724,23 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * Gets the current codec status (configuration and capability). * + * <p>This method requires the calling app to have the {@link + * android.Manifest.permission#BLUETOOTH_CONNECT} permission. Additionally, an app must either + * have the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} or be associated with the + * Companion Device manager (see {@link android.companion.CompanionDeviceManager#associate( + * AssociationRequest, android.companion.CompanionDeviceManager.Callback, Handler)}) + * * @param device the remote Bluetooth device. * @return the current codec status * @hide */ @SystemApi - @Nullable @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission @RequiresPermission( - allOf = { - BLUETOOTH_CONNECT, - BLUETOOTH_PRIVILEGED, - }) - public BluetoothCodecStatus getCodecStatus(@NonNull BluetoothDevice device) { + allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}, + conditional = true) + public @Nullable BluetoothCodecStatus getCodecStatus(@NonNull BluetoothDevice device) { if (DBG) Log.d(TAG, "getCodecStatus(" + device + ")"); verifyDeviceNotNull(device, "getCodecStatus"); final IBluetoothA2dp service = getService(); |