diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-06-15 11:18:46 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-06-17 16:34:50 -0700 |
commit | 961024389b3782936a40a7d090d670290bb66c3c (patch) | |
tree | 7188814c93d784118a5efea428eb203418f88575 /tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java | |
parent | 1fec3e68161dce11cc6995c8c3de50d6ca37f2e7 (diff) | |
download | android_packages_providers_DownloadProvider-961024389b3782936a40a7d090d670290bb66c3c.tar.gz android_packages_providers_DownloadProvider-961024389b3782936a40a7d090d670290bb66c3c.tar.bz2 android_packages_providers_DownloadProvider-961024389b3782936a40a7d090d670290bb66c3c.zip |
Teach DownloadManager about network policy.
Now network access is determined by using getActiveNetworkInfoForUid()
which uses BLOCKED to indicate that network should be rejected for
the requesting UID. While download in progress, watch for any policy
changes that should trigger pause.
Also check NetworkInfo.isConnected() for correctness.
Change-Id: I1efa79823f15ecc3fa088a6719da1b770c64b255
Diffstat (limited to 'tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java')
-rw-r--r-- | tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java index 64c19530..f2a26f12 100644 --- a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java +++ b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java @@ -441,11 +441,12 @@ public class PublicApiFunctionalTest extends AbstractPublicApiTest { } public void testBasicConnectivityChanges() throws Exception { + // without connectivity, download immediately pauses + mSystemFacade.mActiveNetworkType = null; + enqueueResponse(HTTP_OK, FILE_CONTENT); Download download = enqueueRequest(getRequest()); - // without connectivity, download immediately pauses - mSystemFacade.mActiveNetworkType = null; download.runUntilStatus(DownloadManager.STATUS_PAUSED); // connecting should start the download |