Merge "Check that Account Parcel has name and type." into qt-dev

This commit is contained in:
Dmitry Dementyev
2019-04-09 17:55:13 +00:00
committed by Android (Google) Code Review

View File

@@ -93,6 +93,12 @@ public class Account implements Parcelable {
public Account(Parcel in) {
this.name = in.readString();
this.type = in.readString();
if (TextUtils.isEmpty(name)) {
throw new android.os.BadParcelableException("the name must not be empty: " + name);
}
if (TextUtils.isEmpty(type)) {
throw new android.os.BadParcelableException("the type must not be empty: " + type);
}
this.accessId = in.readString();
if (accessId != null) {
synchronized (sAccessedAccounts) {