diff options
author | Jeff Sharkey <jsharkey@android.com> | 2021-06-03 09:26:53 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2021-06-03 12:14:17 -0600 |
commit | 98f3044ce87c7ab9d2a0efbfb8ef6a16872262df (patch) | |
tree | 2f734517e7538b0509c34657c49522518d51f4a1 /framework/java/android/bluetooth/le/ScanResult.java | |
parent | 0cc9fe2cb3763a0f76e3d6078724edc73c3a9a40 (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/le/ScanResult.java')
-rw-r--r-- | framework/java/android/bluetooth/le/ScanResult.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/le/ScanResult.java b/framework/java/android/bluetooth/le/ScanResult.java index 57dad1a025..5228456284 100644 --- a/framework/java/android/bluetooth/le/ScanResult.java +++ b/framework/java/android/bluetooth/le/ScanResult.java @@ -16,8 +16,11 @@ package android.bluetooth.le; +import android.annotation.NonNull; import android.annotation.Nullable; import android.bluetooth.BluetoothDevice; +import android.content.Attributable; +import android.content.AttributionSource; import android.os.Parcel; import android.os.Parcelable; @@ -26,7 +29,7 @@ import java.util.Objects; /** * ScanResult for Bluetooth LE scan. */ -public final class ScanResult implements Parcelable { +public final class ScanResult implements Parcelable, Attributable { /** * For chained advertisements, inidcates tha the data contained in this @@ -195,6 +198,11 @@ public final class ScanResult implements Parcelable { return 0; } + /** {@hide} */ + public void setAttributionSource(@NonNull AttributionSource attributionSource) { + Attributable.setAttributionSource(mDevice, attributionSource); + } + /** * Returns the remote Bluetooth device identified by the Bluetooth device address. */ |