summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothA2dpSink.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2021-06-03 09:26:53 -0600
committerJeff Sharkey <jsharkey@android.com>2021-06-03 12:14:17 -0600
commit98f3044ce87c7ab9d2a0efbfb8ef6a16872262df (patch)
tree2f734517e7538b0509c34657c49522518d51f4a1 /framework/java/android/bluetooth/BluetoothA2dpSink.java
parent0cc9fe2cb3763a0f76e3d6078724edc73c3a9a40 (diff)
More Binder call AttributionSource assignment.
Since developers can use a BluetoothDevice object can make remote calls, it needs to have an accurate AttributionSource. Previous CLs had updated many places where these BluetoothDevice instances were passed across Binder interfaces, but this change updates several remaining locations which had been missed. Introduces new "Attributable" marker interface to offer consistent tooling when applying AttributionSource updates. Bug: 187097694 Test: atest BluetoothInstrumentationTests Change-Id: Icad3b9726591f0fbad58a493cefa5a0af7648280
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothA2dpSink.java')
-rwxr-xr-xframework/java/android/bluetooth/BluetoothA2dpSink.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothA2dpSink.java b/framework/java/android/bluetooth/BluetoothA2dpSink.java
index c0a2aa3db4..2dd63a0263 100755
--- a/framework/java/android/bluetooth/BluetoothA2dpSink.java
+++ b/framework/java/android/bluetooth/BluetoothA2dpSink.java
@@ -27,6 +27,7 @@ import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothAdminPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothPermission;
import android.compat.annotation.UnsupportedAppUsage;
+import android.content.Attributable;
import android.content.AttributionSource;
import android.content.Context;
import android.os.Binder;
@@ -206,7 +207,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile {
final IBluetoothA2dpSink service = getService();
if (service != null && isEnabled()) {
try {
- return BluetoothDevice.setAttributionSource(
+ return Attributable.setAttributionSource(
service.getConnectedDevices(mAttributionSource), mAttributionSource);
} catch (RemoteException e) {
Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
@@ -230,7 +231,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile {
final IBluetoothA2dpSink service = getService();
if (service != null && isEnabled()) {
try {
- return BluetoothDevice.setAttributionSource(
+ return Attributable.setAttributionSource(
service.getDevicesMatchingConnectionStates(states, mAttributionSource),
mAttributionSource);
} catch (RemoteException e) {