diff options
| author | 2010-11-05 18:12:04 +0000 | |
|---|---|---|
| committer | 2010-11-05 18:12:04 +0000 | |
| commit | d145ca7669e1945745c69663ed2a7778f1319b4b (patch) | |
| tree | 930efc8b8f9a56d2a04ae4fb5827950fea92c859 | |
| parent | 91460d7f49e92e13e2acccdf8be10934e9e770fe (diff) | |
| parent | 1cde3fbf8f0c6cf712ce4abb0d11c0de792b470a (diff) | |
Merge "address couple of review comments"
| -rw-r--r-- | core/java/android/app/DownloadManager.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java index 08ccab6c6e03..01414fa7c03a 100644 --- a/core/java/android/app/DownloadManager.java +++ b/core/java/android/app/DownloadManager.java @@ -352,6 +352,17 @@ public class DownloadManager { private int mAllowedNetworkTypes = ~0; // default to all network types allowed private boolean mIsVisibleInDownloadsUi = true; private boolean mScannable = false; + /** if a file is designated as a MediaScanner scannable file, the following value is + * stored in the database column {@link Downloads.Impl#COLUMN_MEDIA_SCANNED}. + */ + private static final int SCANNABLE_VALUE_YES = 0; + // value of 1 is stored in the above column by DownloadProvider after it is scanned by + // MediaScanner + /** if a file is designated as a file that should not be scanned by MediaScanner, + * the following value is stored in the database column + * {@link Downloads.Impl#COLUMN_MEDIA_SCANNED}. + */ + private static final int SCANNABLE_VALUE_NO = 2; /** * This download is visible but only shows in the notifications @@ -605,7 +616,8 @@ public class DownloadManager { Downloads.Impl.DESTINATION_CACHE_PARTITION_PURGEABLE); } // is the file supposed to be media-scannable? - values.put(Downloads.Impl.COLUMN_MEDIA_SCANNED, (mScannable) ? 0 : 2); + values.put(Downloads.Impl.COLUMN_MEDIA_SCANNED, (mScannable) ? SCANNABLE_VALUE_YES : + SCANNABLE_VALUE_NO); if (!mRequestHeaders.isEmpty()) { encodeHttpHeaders(values); @@ -899,7 +911,7 @@ public class DownloadManager { * by any app to access the downloaded file. * * @param id the id of the downloaded file. - * @return the {@link Uri} for the given downloaded file id, if donload was successful. null + * @return the {@link Uri} for the given downloaded file id, if download was successful. null * otherwise. */ public Uri getUriForDownloadedFile(long id) { @@ -919,7 +931,7 @@ public class DownloadManager { Downloads.Impl.COLUMN_DESTINATION); int destination = cursor.getInt(indx); // TODO: if we ever add API to DownloadManager to let the caller specify - // non-external storage for a donloaded file, then the following code + // non-external storage for a downloaded file, then the following code // should also check for that destination. if (destination == Downloads.Impl.DESTINATION_CACHE_PARTITION || destination == Downloads.Impl.DESTINATION_CACHE_PARTITION_NOROAMING || |