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

Commit 06959ab5 authored by Yixiao Luo's avatar Yixiao Luo Committed by Android (Google) Code Review
Browse files

Merge "[SERAPHIC][TIAF] StreamEventResponse with null data parameter will...

Merge "[SERAPHIC][TIAF] StreamEventResponse with null data parameter will cause a null-pointer crash." into tm-dev
parents c20089e4 a92a92fc
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -63,8 +63,12 @@ public final class StreamEventResponse extends BroadcastInfoResponse implements
        mEventId = source.readInt();
        mNptMillis = source.readLong();
        int dataLength = source.readInt();
        if (dataLength > 0) {
            mData = new byte[dataLength];
            source.readByteArray(mData);
        } else {
            mData = null;
        }
    }

    /**
@@ -100,7 +104,11 @@ public final class StreamEventResponse extends BroadcastInfoResponse implements
        super.writeToParcel(dest, flags);
        dest.writeInt(mEventId);
        dest.writeLong(mNptMillis);
        if (mData != null && mData.length > 0) {
            dest.writeInt(mData.length);
            dest.writeByteArray(mData);
        } else {
            dest.writeInt(0);
        }
    }
}