summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andrei Popescu <andreip@google.com> 2009-08-06 14:08:27 +0100
committer Andrei Popescu <andreip@google.com> 2009-08-06 14:46:59 +0100
commitbf70afa2121644391eb197245bd875b72bd6404c (patch)
treea93895e5ba5e799c006146e61e486e7de11d0e09
parentc7279e9cbd2689c6686e152bb030d796d741ffce (diff)
Do not merge
Fix for 1900694: create the full path to the Gears permission database file so SQLite can actually create the database on the device
-rw-r--r--core/java/android/webkit/GearsPermissionsManager.java8
-rw-r--r--core/java/android/webkit/WebSettings.java1
2 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/webkit/GearsPermissionsManager.java b/core/java/android/webkit/GearsPermissionsManager.java
index e70e44968620..6549cb8fb0aa 100644
--- a/core/java/android/webkit/GearsPermissionsManager.java
+++ b/core/java/android/webkit/GearsPermissionsManager.java
@@ -139,7 +139,13 @@ class GearsPermissionsManager {
file = new File(file.getAbsolutePath() + File.separator
+ GEARS_DATABASE_DIR + File.separator + GEARS_DATABASE_FILE);
// Remember whether or not we need to create the LocationAccess table.
- boolean needToCreateTables = !file.exists();
+ boolean needToCreateTables = false;
+ if (!file.exists()) {
+ needToCreateTables = true;
+ // Create the path or else SQLiteDatabase.openOrCreateDatabase()
+ // may throw on the device.
+ file.getParentFile().mkdirs();
+ }
// If the database file does not yet exist and the system location
// setting says that the Gears origins need to be removed from the
// location permission table, it means that we don't actually need
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index c5012f1a5ebf..a038b55995ac 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -199,6 +199,7 @@ public class WebSettings {
switch (msg.what) {
case SYNC:
synchronized (WebSettings.this) {
+ checkGearsPermissions();
if (mBrowserFrame.mNativeFrame != 0) {
nativeSync(mBrowserFrame.mNativeFrame);
}