summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/providers/downloads/DownloadInfo.java')
-rw-r--r--src/com/android/providers/downloads/DownloadInfo.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadInfo.java b/src/com/android/providers/downloads/DownloadInfo.java
index c94dd6c2..8996eded 100644
--- a/src/com/android/providers/downloads/DownloadInfo.java
+++ b/src/com/android/providers/downloads/DownloadInfo.java
@@ -16,6 +16,9 @@
package com.android.providers.downloads;
+import static android.provider.Downloads.Impl.VISIBILITY_VISIBLE;
+import static android.provider.Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED;
+
import static com.android.providers.downloads.Constants.TAG;
import android.app.DownloadManager;
@@ -247,6 +250,19 @@ public class DownloadInfo {
}
/**
+ * Return if this download is visible to the user while running.
+ */
+ public boolean isVisible() {
+ switch (mVisibility) {
+ case VISIBILITY_VISIBLE:
+ case VISIBILITY_VISIBLE_NOTIFY_COMPLETED:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
* Add random fuzz to the given delay so it's anywhere between 1-1.5x the
* requested delay.
*/