summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebIconDatabase.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-01-21 14:03:30 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-21 14:03:30 -0800
commit398a589ccea744556732b25097412dbb22c51271 (patch)
treec823f245f206ecd67a9bdc648cf57a95652584dd /core/java/android/webkit/WebIconDatabase.java
parentdc54a8c742e96d6ea8ef3e18c0f2ee1235899599 (diff)
parentbf8af78973a798719b3241966a12bfc324990a5b (diff)
Merge "DO NOT MERGE - Create db path if it doesn't exit" into gingerbread
Diffstat (limited to 'core/java/android/webkit/WebIconDatabase.java')
-rw-r--r--core/java/android/webkit/WebIconDatabase.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebIconDatabase.java b/core/java/android/webkit/WebIconDatabase.java
index bb9ec4888299..54dfab366d57 100644
--- a/core/java/android/webkit/WebIconDatabase.java
+++ b/core/java/android/webkit/WebIconDatabase.java
@@ -24,6 +24,7 @@ import android.os.Message;
import android.provider.Browser;
import android.util.Log;
+import java.io.File;
import java.util.HashMap;
import java.util.Vector;
@@ -194,13 +195,16 @@ public final class WebIconDatabase {
/**
* Open a the icon database and store the icons in the given path.
* @param path The directory path where the icon database will be stored.
- * @return True if the database was successfully opened or created in
- * the given path.
*/
public void open(String path) {
if (path != null) {
+ // Make the directories and parents if they don't exist
+ File db = new File(path);
+ if (!db.exists()) {
+ db.mkdirs();
+ }
mEventHandler.postMessage(
- Message.obtain(null, EventHandler.OPEN, path));
+ Message.obtain(null, EventHandler.OPEN, db.getAbsolutePath()));
}
}