summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-09-17 16:45:58 -0700
committerSteve Howard <showard@google.com>2010-09-21 12:43:05 -0700
commitd319729622da1893e895f2e35f41d01ecdca3705 (patch)
tree02994abdf2725061b798cb32339b044592cbf581 /tests
parent78f433c68f14dfba605ceb0e5f3dc54243efd2b2 (diff)
downloadandroid_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.zip
android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.tar.gz
android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.tar.bz2
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')
-rw-r--r--tests/src/com/android/providers/downloads/FakeSystemFacade.java5
-rw-r--r--tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java1
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 d80bd4a..5263015 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 554cc1e..6c81bc6 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));