From 433b0ed9fef3e424563df70f22164508c970e4d5 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 3 Aug 2011 13:28:01 -0700 Subject: [PATCH] More whack-a-mole in AttachmentDownloadService Bug: 5115008 Change-Id: I6e5236e08331cfd6a9a11868d97bf5caaf68f6fe --- .../android/email/service/AttachmentDownloadService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/service/AttachmentDownloadService.java b/src/com/android/email/service/AttachmentDownloadService.java index e8b3c4d4e..9c16a7d81 100644 --- a/src/com/android/email/service/AttachmentDownloadService.java +++ b/src/com/android/email/service/AttachmentDownloadService.java @@ -336,9 +336,11 @@ public class AttachmentDownloadService extends Service implements Runnable { } // Don't prefetch if background downloading is disallowed - if (!mConnectivityManager.isBackgroundDataAllowed()) return; + EmailConnectivityManager ecm = mConnectivityManager; + if (ecm == null) return; + if (!ecm.isBackgroundDataAllowed()) return; // Don't prefetch unless we're on a WiFi network - if (mConnectivityManager.getActiveNetworkType() != ConnectivityManager.TYPE_WIFI) { + if (ecm.getActiveNetworkType() != ConnectivityManager.TYPE_WIFI) { return; } // Then, try opportunistic download of appropriate attachments