From 36aef9fb7434bb9fa01dc28038358a4d411a4f00 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 2 Aug 2011 11:44:41 -0700 Subject: [PATCH] Add logging to v21->v22 upgrade; small cleanup Change-Id: I6659998a3ad2490c923061aab5328469c3222e25 --- .../android/email/provider/AccountBackupRestore.java | 3 --- src/com/android/email/provider/EmailProvider.java | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/com/android/email/provider/AccountBackupRestore.java b/src/com/android/email/provider/AccountBackupRestore.java index f9217fb2b..cb615618a 100644 --- a/src/com/android/email/provider/AccountBackupRestore.java +++ b/src/com/android/email/provider/AccountBackupRestore.java @@ -39,9 +39,6 @@ import android.content.Context; * impossible to test in the wild. */ public class AccountBackupRestore { - // We only need to do this once, so prevent extra work by remembering this... - private static boolean sBackupsChecked = false; - /** * Backup user Account and HostAuth data into our backup database * diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 0a4b33c40..f4c060fd0 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2442,8 +2442,9 @@ outer: */ private static final String[] V21_ACCOUNT_PROJECTION = - new String[] {AccountColumns.HOST_AUTH_KEY_RECV}; + new String[] {AccountColumns.HOST_AUTH_KEY_RECV, AccountColumns.DISPLAY_NAME}; private static final int V21_ACCOUNT_RECV = 0; + private static final int V21_ACCOUNT_NAME = 1; private static final String[] V21_HOSTAUTH_PROJECTION = new String[] {HostAuthColumns.PROTOCOL, HostAuthColumns.LOGIN, HostAuthColumns.PASSWORD}; @@ -2481,7 +2482,12 @@ outer: if (hostAuthCursor.moveToFirst()) { String protocol = hostAuthCursor.getString(V21_HOSTAUTH_PROTOCOL); // If this is a pop3 or imap account, create the account manager account - if ("imap".equals(protocol) || "pop3".equals(protocol)) { + if (HostAuth.SCHEME_IMAP.equals(protocol) || + HostAuth.SCHEME_POP3.equals(protocol)) { + if (Email.DEBUG) { + Log.d(TAG, "Create AccountManager account for " + protocol + + "account: " + accountCursor.getString(V21_ACCOUNT_NAME)); + } createAccountManagerAccount(accountManagerContext, hostAuthCursor.getString(V21_HOSTAUTH_LOGIN), hostAuthCursor.getString(V21_HOSTAUTH_PASSWORD));