Merge "Check that Account Parcel has name and type." into oc-dev am: 3349eaa9e8 am: 01f2d401c9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12999920

Change-Id: I0e4803e7aafd730b9e21e49dc350ee51eedf42d8
This commit is contained in:
TreeHugger Robot
2020-11-10 19:56:49 +00:00
committed by Automerger Merge Worker

View File

@@ -88,6 +88,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) {