Skip null/empty account types

b/16730607

Change-Id: I6b3207edbf3dc841dd2222e92f69d270a0caf773
This commit is contained in:
Tony Mantler 2014-08-07 11:34:55 -07:00
parent 34aae3cbc4
commit 1381d4083b
1 changed files with 4 additions and 5 deletions

View File

@ -1614,7 +1614,10 @@ public class EmailProvider extends ContentProvider
// Find all possible account types
final Set<String> accountTypes = new HashSet<String>(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<android.accounts.Account> amAccounts = new ArrayList<android.accounts.Account>();
@ -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;
}