diff options
author | Steve Howard <showard@google.com> | 2010-09-17 16:45:58 -0700 |
---|---|---|
committer | Steve Howard <showard@google.com> | 2010-09-21 12:43:05 -0700 |
commit | d319729622da1893e895f2e35f41d01ecdca3705 (patch) | |
tree | 02994abdf2725061b798cb32339b044592cbf581 /tests/src/com | |
parent | 78f433c68f14dfba605ceb0e5f3dc54243efd2b2 (diff) | |
download | android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.tar.gz android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.tar.bz2 android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.zip |
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
Diffstat (limited to 'tests/src/com')
-rw-r--r-- | tests/src/com/android/providers/downloads/FakeSystemFacade.java | 5 | ||||
-rw-r--r-- | tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java | 1 |
2 files changed, 5 insertions, 1 deletions
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<Intent> mBroadcastsSent = new ArrayList<Intent>(); Map<Long,Notification> mActiveNotifications = new HashMap<Long,Notification>(); List<Notification> mCanceledNotifications = new ArrayList<Notification>(); @@ -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)); |