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

Commit 027afce1 authored by Alex Dadukin's avatar Alex Dadukin
Browse files

Fix BadParcelableException when transferInitiatorUserHandle is null

Bug: b/322119159
Test: atest SystemMediaRouter2Test
Change-Id: I23c18edf8c97d3258eab0b2666fe734ddd973534
parent 0c9359f2
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ public final class RoutingSessionInfo implements Parcelable {
        mControlHints = src.readBundle();
        mIsSystemSession = src.readBoolean();
        mTransferReason = src.readInt();
        mTransferInitiatorUserHandle = src.readParcelable(null, android.os.UserHandle.class);
        mTransferInitiatorUserHandle = UserHandle.readFromParcel(src);
        mTransferInitiatorPackageName = src.readString();
    }

@@ -417,11 +417,7 @@ public final class RoutingSessionInfo implements Parcelable {
        dest.writeBundle(mControlHints);
        dest.writeBoolean(mIsSystemSession);
        dest.writeInt(mTransferReason);
        if (mTransferInitiatorUserHandle != null) {
            mTransferInitiatorUserHandle.writeToParcel(dest, /* flags= */ 0);
        } else {
            dest.writeParcelable(null, /* flags= */ 0);
        }
        UserHandle.writeToParcel(mTransferInitiatorUserHandle, dest);
        dest.writeString(mTransferInitiatorPackageName);
    }