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 /src/com/android/providers/downloads/SystemFacade.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 'src/com/android/providers/downloads/SystemFacade.java')
-rw-r--r-- | src/com/android/providers/downloads/SystemFacade.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/providers/downloads/SystemFacade.java b/src/com/android/providers/downloads/SystemFacade.java index ed0d3306..a1e4098c 100644 --- a/src/com/android/providers/downloads/SystemFacade.java +++ b/src/com/android/providers/downloads/SystemFacade.java @@ -4,6 +4,7 @@ package com.android.providers.downloads; import android.app.Notification; import android.content.Intent; import android.content.pm.PackageManager.NameNotFoundException; +import android.net.NetworkInfo; interface SystemFacade { @@ -13,10 +14,10 @@ interface SystemFacade { public long currentTimeMillis(); /** - * @return Network type (as in ConnectivityManager.TYPE_*) of currently active network, or null - * if there's no active connection. + * @return Currently active network, or null if there's no active + * connection. */ - public Integer getActiveNetworkType(); + public NetworkInfo getActiveNetworkInfo(int uid); /** * @see android.telephony.TelephonyManager#isNetworkRoaming |