Merge "Fix NPE" into qt-dev

This commit is contained in:
Julia Reynolds
2022-09-22 18:37:39 +00:00
committed by Android (Google) Code Review
2 changed files with 27 additions and 3 deletions

View File

@@ -94,8 +94,11 @@ public final class NotificationChannelGroup implements Parcelable {
} else {
mId = null;
}
mName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
mName = getTrimmedString(mName.toString());
if (in.readByte() != 0) {
mName = getTrimmedString(in.readString());
} else {
mName = "";
}
if (in.readByte() != 0) {
mDescription = getTrimmedString(in.readString());
} else {
@@ -121,7 +124,12 @@ public final class NotificationChannelGroup implements Parcelable {
} else {
dest.writeByte((byte) 0);
}
TextUtils.writeToParcel(mName.toString(), dest, flags);
if (mName != null) {
dest.writeByte((byte) 1);
dest.writeString(mName.toString());
} else {
dest.writeByte((byte) 0);
}
if (mDescription != null) {
dest.writeByte((byte) 1);
dest.writeString(mDescription);