From d319729622da1893e895f2e35f41d01ecdca3705 Mon Sep 17 00:00:00 2001 From: Steve Howard Date: Fri, 17 Sep 2010 16:45:58 -0700 Subject: Implement dialogs for wifi required + recommended limits. This change extends the original work to add a size limit over which wifi is required to download a file. First, this change adds a second size limit, over which wifi is recommended but not required. The user has the option to bypass this limit. Second, this change implements dialogs shown to the user when either limit is exceeded. These dialogs are shown by the background download manager service when a download is started and found to be over the limit (and wifi is not connected). I'm including one small fix to the unit tests needed from the previous change. Change-Id: Ia0f0acaa7b0d00e98355925c3446c0472048df10 --- tests/src/com/android/providers/downloads/FakeSystemFacade.java | 5 +++++ .../src/com/android/providers/downloads/PublicApiFunctionalTest.java | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/src/com/android/providers') diff --git a/tests/src/com/android/providers/downloads/FakeSystemFacade.java b/tests/src/com/android/providers/downloads/FakeSystemFacade.java index d80bd4ad..5263015c 100644 --- a/tests/src/com/android/providers/downloads/FakeSystemFacade.java +++ b/tests/src/com/android/providers/downloads/FakeSystemFacade.java @@ -18,6 +18,7 @@ public class FakeSystemFacade implements SystemFacade { Integer mActiveNetworkType = ConnectivityManager.TYPE_WIFI; boolean mIsRoaming = false; Long mMaxBytesOverMobile = null; + Long mRecommendedMaxBytesOverMobile = null; List mBroadcastsSent = new ArrayList(); Map mActiveNotifications = new HashMap(); List mCanceledNotifications = new ArrayList(); @@ -43,6 +44,10 @@ public class FakeSystemFacade implements SystemFacade { return mMaxBytesOverMobile ; } + public Long getRecommendedMaxBytesOverMobile() { + return mRecommendedMaxBytesOverMobile ; + } + @Override public void sendBroadcast(Intent intent) { mBroadcastsSent.add(intent); diff --git a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java index 554cc1ea..6c81bc65 100644 --- a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java +++ b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java @@ -536,7 +536,6 @@ public class PublicApiFunctionalTest extends AbstractPublicApiTest { public void testEmptyFields() throws Exception { Download download = enqueueRequest(getRequest()); - assertNull(download.getStringField(DownloadManager.COLUMN_LOCAL_URI)); assertEquals("", download.getStringField(DownloadManager.COLUMN_TITLE)); assertEquals("", download.getStringField(DownloadManager.COLUMN_DESCRIPTION)); assertNull(download.getStringField(DownloadManager.COLUMN_MEDIA_TYPE)); -- cgit v1.2.3