From b63e70f179e01b3a4e944b7b15c6a585c07d492d Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Thu, 7 Aug 2014 11:34:55 -0700 Subject: [PATCH] Skip null/empty account types b/16730607 Change-Id: I6b3207edbf3dc841dd2222e92f69d270a0caf773 (cherry picked from commit 1381d4083bbfdf046eceac081420ab3fa7a1ae81) --- src/com/android/email/provider/EmailProvider.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index abf60d54d..096bcf712 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -1614,7 +1614,10 @@ public class EmailProvider extends ContentProvider // Find all possible account types final Set accountTypes = new HashSet(3); for (final EmailServiceInfo info : infos) { - accountTypes.add(info.accountType); + if (!TextUtils.isEmpty(info.accountType)) { + // accountType will be empty for the gmail stub entry + accountTypes.add(info.accountType); + } } // Find all accounts we own final List amAccounts = new ArrayList(); @@ -1626,11 +1629,7 @@ public class EmailProvider extends ContentProvider int restoredCount = 0; for (final android.accounts.Account amAccount : amAccounts) { String jsonString = null; - try { jsonString = am.getUserData(amAccount, ACCOUNT_MANAGER_JSON_TAG); - } catch (SecurityException e) { - LogUtils.e(TAG, e, "catching exception"); - } if (TextUtils.isEmpty(jsonString)) { continue; }