Can not continue to download after powering on the phone
Benson Huang [Thu, 15 Jan 2015 01:58:45 +0000 (09:58 +0800)]
    1. Launch chrome and open www.baidu.com -> Choose "software"
    in the site navigation -> Tap "games" option, choose one apk
    to download -> During downloading, power off the phone -> Power
    on the phone and check, it can't continue to download apk.

    The fix is to add one condition for retrying to download when
    IO exception happens (i.e. Failed to open for writing:
    java.io.FileNotFoundException).

    Bug 18834618

    Review: https://partner-android-review.git.corp.google.com/#/c/193436

Signed-off-by: Benson Huang <benson.huang@mediatek.com>

Change-Id: I2f975ff7ffedfc4136fb250dcb5ef8fdca4a367d

src/com/android/providers/downloads/DownloadThread.java

index 2493ada..c75e419 100644 (file)
@@ -859,6 +859,7 @@ public class DownloadThread implements Runnable {
             case STATUS_HTTP_DATA_ERROR:
             case HTTP_UNAVAILABLE:
             case HTTP_INTERNAL_ERROR:
+            case STATUS_FILE_ERROR:
                 return true;
             default:
                 return false;