summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothHearingAid.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/BluetoothHearingAid.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/BluetoothHearingAid.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothHearingAid.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHearingAid.java b/framework/java/android/bluetooth/BluetoothHearingAid.java
index 3ff2ebd86b..183f4d55bd 100644
--- a/framework/java/android/bluetooth/BluetoothHearingAid.java
+++ b/framework/java/android/bluetooth/BluetoothHearingAid.java
@@ -28,6 +28,7 @@ import android.bluetooth.annotations.RequiresLegacyBluetoothAdminPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothPermission;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
+import android.content.Attributable;
import android.content.AttributionSource;
import android.content.Context;
import android.os.Binder;
@@ -248,7 +249,7 @@ public final class BluetoothHearingAid implements BluetoothProfile {
final IBluetoothHearingAid service = getService();
try {
if (service != null && isEnabled()) {
- return BluetoothDevice.setAttributionSource(
+ return Attributable.setAttributionSource(
service.getConnectedDevices(mAttributionSource), mAttributionSource);
}
if (service == null) Log.w(TAG, "Proxy not attached to service");
@@ -271,7 +272,7 @@ public final class BluetoothHearingAid implements BluetoothProfile {
final IBluetoothHearingAid service = getService();
try {
if (service != null && isEnabled()) {
- return BluetoothDevice.setAttributionSource(
+ return Attributable.setAttributionSource(
service.getDevicesMatchingConnectionStates(states, mAttributionSource),
mAttributionSource);
}
@@ -363,7 +364,8 @@ public final class BluetoothHearingAid implements BluetoothProfile {
final IBluetoothHearingAid service = getService();
try {
if (service != null && isEnabled()) {
- return service.getActiveDevices(mAttributionSource);
+ return Attributable.setAttributionSource(
+ service.getActiveDevices(mAttributionSource), mAttributionSource);
}
if (service == null) Log.w(TAG, "Proxy not attached to service");
return new ArrayList<>();