diff options
author | Dmitry Dementyev <dementyev@google.com> | 2019-04-08 16:13:21 -0700 |
---|---|---|
committer | Anis Assi <anisassi@google.com> | 2020-11-12 11:45:14 -0800 |
commit | 5fc52d15c4ab6a7f04961c5fba5464b55617f1ec (patch) | |
tree | ecaf838abd708b272096ad62a9f7d94c9060be30 | |
parent | cc9d76a77e05505d6f8d5ebd77afffe928bf4c3f (diff) | |
download | base-5fc52d15c4ab6a7f04961c5fba5464b55617f1ec.tar.gz |
Check that Account Parcel has name and type.
Bug: 129287265
Test: manual
Change-Id: I8431eb27cc4c6dfd3048b28ff635474f14433308
(cherry picked from commit 32e85796389f57e2539c28f9e670277ab610459a)
(cherry picked from commit 0992000acea457142cb2b715a106057d6cee9166)
-rw-r--r-- | core/java/android/accounts/Account.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/accounts/Account.java b/core/java/android/accounts/Account.java index b6e85f18a695..3f90f36fb2a1 100644 --- a/core/java/android/accounts/Account.java +++ b/core/java/android/accounts/Account.java @@ -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) { |