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

Commit 45919a32 authored by William Escande's avatar William Escande
Browse files

Errorprone: AndroidFrameworkEfficientParcelable

Recommended to use 'item.writeToParcel()' to improve efficiency;
saves overhead of Parcelable class name

Test: m Bluetooth
Bug: 344658662
Flag: Exempt, enforce error in the futur
Change-Id: I023b567dfaec8397cf9692454e16158de1189d3a
parent 73c37d4a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -326,6 +326,7 @@ android_app {
            "-Xep:AlmostJavadoc:ERROR",
            "-Xep:AlreadyChecked:ERROR",
            "-Xep:AndroidFrameworkBinderIdentity:ERROR",
            "-Xep:AndroidFrameworkEfficientParcelable:ERROR",
            "-Xep:AndroidFrameworkEfficientStrings:ERROR",
            "-Xep:AndroidFrameworkRequiresPermission:ERROR",
            "-Xep:BadImport:ERROR",
+6 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.bluetooth.hfpclient;

import static android.bluetooth.BluetoothUtils.writeStringToParcel;

import android.bluetooth.BluetoothDevice;
import android.os.Parcel;
import android.os.Parcelable;
@@ -276,7 +278,7 @@ public final class HfpClientCall implements Parcelable {
                @Override
                public HfpClientCall createFromParcel(Parcel in) {
                    return new HfpClientCall(
                            (BluetoothDevice) in.readParcelable(null),
                            BluetoothDevice.CREATOR.createFromParcel(in),
                            in.readInt(),
                            UUID.fromString(in.readString()),
                            in.readInt(),
@@ -294,11 +296,11 @@ public final class HfpClientCall implements Parcelable {

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable(mDevice, 0);
        mDevice.writeToParcel(out, flags);
        out.writeInt(mId);
        out.writeString(mUUID.toString());
        writeStringToParcel(out, mUUID.toString());
        out.writeInt(mState);
        out.writeString(mNumber);
        writeStringToParcel(out, mNumber);
        out.writeInt(mMultiParty ? 1 : 0);
        out.writeInt(mOutgoing ? 1 : 0);
        out.writeInt(mInBandRing ? 1 : 0);