diff options
author | Tony Mantler <nicoya@google.com> | 2014-08-07 15:36:20 -0700 |
---|---|---|
committer | Tony Mantler <nicoya@google.com> | 2014-08-07 15:36:20 -0700 |
commit | 4c865846856cd7530fb51e244a9971a3d5e1fcd8 (patch) | |
tree | fd421255d49c01df98cd530d59196ebc8c620dce /src/com/android/email/service | |
parent | f1789afa535b113047ef20623d79fdfb257537aa (diff) | |
download | android_packages_apps_Email-4c865846856cd7530fb51e244a9971a3d5e1fcd8.tar.gz android_packages_apps_Email-4c865846856cd7530fb51e244a9971a3d5e1fcd8.tar.bz2 android_packages_apps_Email-4c865846856cd7530fb51e244a9971a3d5e1fcd8.zip |
Don't return a protocol for a null account type
b/16735532
Change-Id: Ie83709fe3a9942ef946cf86f853b3d6565dc5799
Diffstat (limited to 'src/com/android/email/service')
-rw-r--r-- | src/com/android/email/service/EmailServiceUtils.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/email/service/EmailServiceUtils.java b/src/com/android/email/service/EmailServiceUtils.java index a7a9c27f2..a2cda8d50 100644 --- a/src/com/android/email/service/EmailServiceUtils.java +++ b/src/com/android/email/service/EmailServiceUtils.java @@ -46,6 +46,7 @@ import android.provider.CalendarContract.SyncState; import android.provider.ContactsContract; import android.provider.ContactsContract.RawContacts; import android.provider.SyncStateContract; +import android.support.annotation.Nullable; import android.text.TextUtils; import com.android.email.R; @@ -651,8 +652,11 @@ public class EmailServiceUtils { * @param accountType sync adapter service name * @return protocol name or null */ - public static String getProtocolFromAccountType(final Context context, + public static @Nullable String getProtocolFromAccountType(final Context context, final String accountType) { + if (TextUtils.isEmpty(accountType)) { + return null; + } final Map <String, EmailServiceInfo> serviceInfoMap = getServiceMap(context); String protocol = null; for (final EmailServiceInfo info : serviceInfoMap.values()) { |