summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorDmitry Dementyev <dementyev@google.com>2019-04-09 17:55:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-09 17:55:13 +0000
commitcdec79367dc2f9d091a5bbf0a2fb5a77af171cf7 (patch)
tree934af661fe2874d9fa81eabc748b5fffb1a27717 /core/java
parent16f6a30c9d4be55f625e8ef4475e360dae8ea04a (diff)
parent32e85796389f57e2539c28f9e670277ab610459a (diff)
Merge "Check that Account Parcel has name and type." into qt-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/accounts/Account.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/accounts/Account.java b/core/java/android/accounts/Account.java
index 26377642f2f9..c822d20445ec 100644
--- a/core/java/android/accounts/Account.java
+++ b/core/java/android/accounts/Account.java
@@ -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) {