Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7208933 authored by Rongxuan Liu's avatar Rongxuan Liu
Browse files

Add address type to Bluetooth Device parcel

Bug: 265341075
Test: atest BluetoothDeviceTest
Change-Id: I23030458df645f465d2b4b5b9547acd64adb783b
parent 5c8c07b6
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1359,6 +1359,19 @@ public final class BluetoothDevice implements Parcelable, Attributable {
        this(address, ADDRESS_TYPE_PUBLIC);
    }

    /**
     * Create a new BluetoothDevice.
     *
     * @param in valid parcel
     * @throws RuntimeException Bluetooth is not available on this platform
     * @throws IllegalArgumentException address is invalid
     * @hide
     */
    @UnsupportedAppUsage
    /*package*/ BluetoothDevice(Parcel in) {
        this(in.readString(), in.readInt());
    }

    /** {@hide} */
    public void setAttributionSource(@NonNull AttributionSource attributionSource) {
        mAttributionSource = attributionSource;
@@ -1452,7 +1465,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {

    public static final @NonNull Creator<BluetoothDevice> CREATOR = new Creator<>() {
        public BluetoothDevice createFromParcel(Parcel in) {
            return new BluetoothDevice(in.readString());
            return new BluetoothDevice(in);
        }

        public BluetoothDevice[] newArray(int size) {
@@ -1463,6 +1476,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeString(mAddress);
        out.writeInt(mAddressType);
    }

    /**