Bug 896735 - Create download directory for updates if it does not exist. r=snorp, a=sledru
authorEugen Sawin <esawin@mozilla.com>
Tue, 30 Sep 2014 21:23:36 +0200
changeset 218112 ec71591f0d376299bddcd9836e1da10655a7f7d9
parent 218111 c714cf54833c0a4b57ab641d3aec7b78011c420a
child 218113 bc87917b3b953afd921f20b11ada3264c7a110bc
push idunknown
push userunknown
push dateunknown
reviewerssnorp, sledru
bugs896735
milestone34.0a2
Bug 896735 - Create download directory for updates if it does not exist. r=snorp, a=sledru
mobile/android/base/updater/UpdateService.java
--- a/mobile/android/base/updater/UpdateService.java
+++ b/mobile/android/base/updater/UpdateService.java
@@ -430,16 +430,17 @@ public class UpdateService extends Inten
         pkg.delete();
         Log.i(LOGTAG, "deleted update package: " + path);
 
         return true;
     }
 
     private File downloadUpdatePackage(UpdateInfo info, boolean overwriteExisting) {
         File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
+        path.mkdirs();
         String fileName = new File(info.url.getFile()).getName();
         File downloadFile = new File(path, fileName);
 
         if (!overwriteExisting && info.buildID.equals(getLastBuildID()) && downloadFile.exists()) {
             // The last saved buildID is the same as the one for the current update. We also have a file
             // already downloaded, so it's probably the package we want. Verify it to be sure and just
             // return that if it matches.