summaryrefslogtreecommitdiff
path: root/core/java/android/app/DownloadManager.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-06-16 15:07:48 -0700
committerJeff Sharkey <jsharkey@android.com>2011-06-17 16:49:21 -0700
commitfdfef57f498e3021a34342538aef9f1c7ccbae78 (patch)
tree612e86ac458b3b99c6a527544c26d4993dad8051 /core/java/android/app/DownloadManager.java
parent5bfa752f71cf7e6a5e7490d48eaef4054f99bebc (diff)
Notify policy listeners about metered ifaces.
Currently, kernel definition of metered networks is applied at the interface level. This change maintain list of those metered ifaces and notifies policy listeners, like ConnectivityService. (This gives us a consistent picture of when a network would be blocked.) Bug: 4601393 Change-Id: I277d5ca96ab967a1c1c3f1da8f9587557cd6d74c
Diffstat (limited to 'core/java/android/app/DownloadManager.java')
-rw-r--r--core/java/android/app/DownloadManager.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java
index 28559cc5029a..ad8d41fafb4f 100644
--- a/core/java/android/app/DownloadManager.java
+++ b/core/java/android/app/DownloadManager.java
@@ -226,6 +226,14 @@ public class DownloadManager {
public final static int ERROR_FILE_ALREADY_EXISTS = 1009;
/**
+ * Value of {@link #COLUMN_REASON} when the download has failed because of
+ * {@link NetworkPolicyManager} controls on the requesting application.
+ *
+ * @hide
+ */
+ public final static int ERROR_BLOCKED = 1010;
+
+ /**
* Value of {@link #COLUMN_REASON} when the download is paused because some network error
* occurred and the download manager is waiting before retrying the request.
*/
@@ -249,14 +257,6 @@ public class DownloadManager {
public final static int PAUSED_UNKNOWN = 4;
/**
- * Value of {@link #COLUMN_REASON} when the download has been paused because
- * of {@link NetworkPolicyManager} controls on the requesting application.
- *
- * @hide
- */
- public final static int PAUSED_BY_POLICY = 5;
-
- /**
* Broadcast intent action sent by the download manager when a download completes.
*/
public final static String ACTION_DOWNLOAD_COMPLETE = "android.intent.action.DOWNLOAD_COMPLETE";
@@ -804,7 +804,6 @@ public class DownloadManager {
parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_TO_RETRY));
parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_FOR_NETWORK));
parts.add(statusClause("=", Downloads.Impl.STATUS_QUEUED_FOR_WIFI));
- parts.add(statusClause("=", Downloads.Impl.STATUS_PAUSED_BY_POLICY));
}
if ((mStatusFlags & STATUS_SUCCESSFUL) != 0) {
parts.add(statusClause("=", Downloads.Impl.STATUS_SUCCESS));
@@ -1275,9 +1274,6 @@ public class DownloadManager {
case Downloads.Impl.STATUS_QUEUED_FOR_WIFI:
return PAUSED_QUEUED_FOR_WIFI;
- case Downloads.Impl.STATUS_PAUSED_BY_POLICY:
- return PAUSED_BY_POLICY;
-
default:
return PAUSED_UNKNOWN;
}
@@ -1316,6 +1312,9 @@ public class DownloadManager {
case Downloads.Impl.STATUS_FILE_ALREADY_EXISTS_ERROR:
return ERROR_FILE_ALREADY_EXISTS;
+ case Downloads.Impl.STATUS_BLOCKED:
+ return ERROR_BLOCKED;
+
default:
return ERROR_UNKNOWN;
}
@@ -1333,7 +1332,6 @@ public class DownloadManager {
case Downloads.Impl.STATUS_WAITING_TO_RETRY:
case Downloads.Impl.STATUS_WAITING_FOR_NETWORK:
case Downloads.Impl.STATUS_QUEUED_FOR_WIFI:
- case Downloads.Impl.STATUS_PAUSED_BY_POLICY:
return STATUS_PAUSED;
case Downloads.Impl.STATUS_SUCCESS: