diff options
author | Geremy Condra <gcondra@google.com> | 2013-04-04 17:48:09 -0700 |
---|---|---|
committer | repo sync <gcondra@google.com> | 2013-04-05 13:17:07 -0700 |
commit | aa3c81e49791429a92282c752c89575cf5c01cb6 (patch) | |
tree | f0966723abadd8254e504ae604675c0b921b87e2 | |
parent | 5feceebb892d4cb5777cea3c6174b206705d456b (diff) | |
download | frameworks_base-aa3c81e49791429a92282c752c89575cf5c01cb6.zip frameworks_base-aa3c81e49791429a92282c752c89575cf5c01cb6.tar.gz frameworks_base-aa3c81e49791429a92282c752c89575cf5c01cb6.tar.bz2 |
Fix crash in ConfigUpdater when the target dir doesn't exist.
Change-Id: I44ee0e3791938da0bf890fb38cd886330c0ee01d
-rw-r--r-- | services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java index d603cfa..c94f7c1 100644 --- a/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java +++ b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java @@ -226,8 +226,6 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { FileOutputStream out = null; File tmp = null; try { - // create the temporary file - tmp = File.createTempFile("journal", "", dir); // create the parents for the destination file File parent = file.getParentFile(); parent.mkdirs(); @@ -235,6 +233,8 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { if (!parent.exists()) { throw new IOException("Failed to create directory " + parent.getCanonicalPath()); } + // create the temporary file + tmp = File.createTempFile("journal", "", dir); // mark tmp -rw-r--r-- tmp.setReadable(true, false); // write to it |