From 50591a7be4fe59cc7063acddcb1f61833ba2f100 Mon Sep 17 00:00:00 2001 From: James Lemieux Date: Wed, 13 Aug 2014 16:21:30 -0700 Subject: [PATCH] End of Life screen for Email b/16843301 This introduces a new build target: EmailGoogleTombstone. Building with a tapas line that includes that target will produce EmailGoogleTombstone.apk. The apk includes the EmailProvider and AttachmentProvider (for migration to Gmail) and an activity that explains to the user where to find their email data. Change-Id: Ib8192b46d9017e04f5c99f5c8e509531198eec07 --- res/values/constants.xml | 6 ++++++ src/com/android/email/provider/EmailProvider.java | 15 ++++++++------- src/com/android/email2/ui/MailActivityEmail.java | 15 +++++++++------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/res/values/constants.xml b/res/values/constants.xml index e25d009ed..74ce82f68 100644 --- a/res/values/constants.xml +++ b/res/values/constants.xml @@ -30,4 +30,10 @@ false + + + true + + + true \ No newline at end of file diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 0c93109ae..174a9e49a 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -104,7 +104,6 @@ import com.android.emailcommon.service.IEmailService; import com.android.emailcommon.service.SearchParams; import com.android.emailcommon.utility.AttachmentUtilities; import com.android.emailcommon.utility.EmailAsyncTask; -import com.android.emailcommon.utility.IntentUtilities; import com.android.emailcommon.utility.Utility; import com.android.ex.photo.provider.PhotoContract; import com.android.mail.preferences.MailPrefs; @@ -378,12 +377,14 @@ public class EmailProvider extends ContentProvider private final Set mDelayedSyncRequests = new HashSet(); private static void reconcileAccountsAsync(final Context context) { - EmailAsyncTask.runAsyncParallel(new Runnable() { - @Override - public void run() { - AccountReconciler.reconcileAccounts(context); - } - }); + if (context.getResources().getBoolean(R.bool.reconcile_accounts)) { + EmailAsyncTask.runAsyncParallel(new Runnable() { + @Override + public void run() { + AccountReconciler.reconcileAccounts(context); + } + }); + } } public static Uri uiUri(String type, long id) { diff --git a/src/com/android/email2/ui/MailActivityEmail.java b/src/com/android/email2/ui/MailActivityEmail.java index fae8101c0..97249993d 100644 --- a/src/com/android/email2/ui/MailActivityEmail.java +++ b/src/com/android/email2/ui/MailActivityEmail.java @@ -28,6 +28,7 @@ import android.os.Bundle; import com.android.email.NotificationController; import com.android.email.Preferences; +import com.android.email.R; import com.android.email.provider.EmailProvider; import com.android.email.service.AttachmentService; import com.android.email.service.EmailServiceUtils; @@ -84,12 +85,14 @@ public class MailActivityEmail extends com.android.mail.ui.MailActivity { * UI thread (or lifecycle entry points.) */ public static void setServicesEnabledAsync(final Context context) { - EmailAsyncTask.runAsyncParallel(new Runnable() { - @Override - public void run() { - setServicesEnabledSync(context); - } - }); + if (context.getResources().getBoolean(R.bool.enable_services)) { + EmailAsyncTask.runAsyncParallel(new Runnable() { + @Override + public void run() { + setServicesEnabledSync(context); + } + }); + } } /**