From f238ad7746d04d641f55bbed3461ba87a2ba4aeb Mon Sep 17 00:00:00 2001 From: Attila Bodis Date: Tue, 26 Jan 2010 14:52:32 -0800 Subject: [PATCH] b/2383073 Add fine-grained status codes for failed downloads. Introduces new download status codes (STATUS_DEVICE_NOT_FOUND_ERROR and STATUS_INSUFFICIENT_SPACE_ERROR) to allow apps to show more accurate and informative error messages upon failed downloads. --- core/java/android/provider/Downloads.java | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/core/java/android/provider/Downloads.java b/core/java/android/provider/Downloads.java index 6bf09b5925281..08ab166c65712 100644 --- a/core/java/android/provider/Downloads.java +++ b/core/java/android/provider/Downloads.java @@ -517,6 +517,8 @@ public final class Downloads { /** * This download couldn't be completed because of a storage issue. * Typically, that's because the filesystem is missing or full. + * Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} + * and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate. * @hide */ public static final int STATUS_FILE_ERROR = 492; @@ -557,6 +559,21 @@ public final class Downloads { */ public static final int STATUS_TOO_MANY_REDIRECTS = 497; + /** + * This download couldn't be completed due to insufficient storage + * space. Typically, this is because the SD card is full. + * @hide + */ + public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498; + + /** + * This download couldn't be completed because no external storage + * device was found. Typically, this is because the SD card is not + * mounted. + * @hide + */ + public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499; + /** * This download is visible but only shows in the notifications * while it's in progress. @@ -1019,6 +1036,8 @@ public final class Downloads { /** * This download couldn't be completed because of a storage issue. * Typically, that's because the filesystem is missing or full. + * Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} + * and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate. */ public static final int STATUS_FILE_ERROR = 492; @@ -1053,6 +1072,19 @@ public final class Downloads { */ public static final int STATUS_TOO_MANY_REDIRECTS = 497; + /** + * This download couldn't be completed due to insufficient storage + * space. Typically, this is because the SD card is full. + */ + public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498; + + /** + * This download couldn't be completed because no external storage + * device was found. Typically, this is because the SD card is not + * mounted. + */ + public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499; + /** * This download is visible but only shows in the notifications * while it's in progress.