diff options
| author | Suprabh Shukla <suprabh@google.com> | 2017-05-23 12:26:29 -0700 |
|---|---|---|
| committer | Suprabh Shukla <suprabh@google.com> | 2017-05-23 19:37:15 +0000 |
| commit | 83b66b2289a103cc6563cc54f9d54632fd64bffb (patch) | |
| tree | ea7ea0c9f77e51333a416c70964634a5cfd1ebdd /core/java/android/content/SyncAdaptersCache.java | |
| parent | 7f0309dd00cfad2abb0ca96ffd7b45fd7aa25a0a (diff) | |
Validating non-empty authority and accountType
Code was check for null but empty strings are also not allowed.
Test: Manually installed the app causing the bootloop before the fix.
Rebooted the device to force schedule a sync and observed no crash.
Fixes: 19893917
Change-Id: If13aa0ac4cb3358da4b8e2bc62cb277d5248edaa
Diffstat (limited to 'core/java/android/content/SyncAdaptersCache.java')
| -rw-r--r-- | core/java/android/content/SyncAdaptersCache.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/content/SyncAdaptersCache.java b/core/java/android/content/SyncAdaptersCache.java index ddbdb8a7a559..ccd799407308 100644 --- a/core/java/android/content/SyncAdaptersCache.java +++ b/core/java/android/content/SyncAdaptersCache.java @@ -20,6 +20,7 @@ import android.content.pm.RegisteredServicesCache; import android.content.pm.XmlSerializerAndParser; import android.content.res.Resources; import android.content.res.TypedArray; +import android.text.TextUtils; import android.util.ArrayMap; import android.util.AttributeSet; import android.util.SparseArray; @@ -63,7 +64,7 @@ public class SyncAdaptersCache extends RegisteredServicesCache<SyncAdapterType> sa.getString(com.android.internal.R.styleable.SyncAdapter_contentAuthority); final String accountType = sa.getString(com.android.internal.R.styleable.SyncAdapter_accountType); - if (authority == null || accountType == null) { + if (TextUtils.isEmpty(authority) || TextUtils.isEmpty(accountType)) { return null; } final boolean userVisible = |
