diff options
author | Grace Kloba <klobag@google.com> | 2009-09-14 10:47:07 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2009-09-14 10:47:07 -0700 |
commit | b6e164c779881cf68768224bd67a8d949be0618a (patch) | |
tree | 2d8f23ba70ed8ec0750f0c50ed467619df368aac /core/java/android/webkit/WebViewDatabase.java | |
parent | 714ec1360cde8b1cbf6e6b8572256e4100f11560 (diff) | |
download | frameworks_base-b6e164c779881cf68768224bd67a8d949be0618a.zip frameworks_base-b6e164c779881cf68768224bd67a8d949be0618a.tar.gz frameworks_base-b6e164c779881cf68768224bd67a8d949be0618a.tar.bz2 |
Per suggestion in http://b/issue?id=2062340, update the UNIQUE in the
httpauth table.
Diffstat (limited to 'core/java/android/webkit/WebViewDatabase.java')
-rw-r--r-- | core/java/android/webkit/WebViewDatabase.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java index 4e76254..6e10811 100644 --- a/core/java/android/webkit/WebViewDatabase.java +++ b/core/java/android/webkit/WebViewDatabase.java @@ -39,7 +39,7 @@ public class WebViewDatabase { // log tag protected static final String LOGTAG = "webviewdatabase"; - private static final int DATABASE_VERSION = 9; + private static final int DATABASE_VERSION = 10; // 2 -> 3 Modified Cache table to allow cache of redirects // 3 -> 4 Added Oma-Downloads table // 4 -> 5 Modified Cache table to support persistent contentLength @@ -48,6 +48,7 @@ public class WebViewDatabase { // 6 -> 7 Change cache localPath from int to String // 7 -> 8 Move cache to its own db // 8 -> 9 Store both scheme and host when storing passwords + // 9 -> 10 Update httpauth table UNIQUE private static final int CACHE_DATABASE_VERSION = 3; // 1 -> 2 Add expires String // 2 -> 3 Add content-disposition @@ -256,6 +257,20 @@ public class WebViewDatabase { + DATABASE_VERSION + ", which will destroy old data"); } boolean justPasswords = 8 == oldVersion && 9 == DATABASE_VERSION; + boolean justAuth = 9 == oldVersion && 10 == DATABASE_VERSION; + if (justAuth) { + mDatabase.execSQL("DROP TABLE IF EXISTS " + + mTableNames[TABLE_HTTPAUTH_ID]); + mDatabase.execSQL("CREATE TABLE " + mTableNames[TABLE_HTTPAUTH_ID] + + " (" + ID_COL + " INTEGER PRIMARY KEY, " + + HTTPAUTH_HOST_COL + " TEXT, " + HTTPAUTH_REALM_COL + + " TEXT, " + HTTPAUTH_USERNAME_COL + " TEXT, " + + HTTPAUTH_PASSWORD_COL + " TEXT," + " UNIQUE (" + + HTTPAUTH_HOST_COL + ", " + HTTPAUTH_REALM_COL + + ") ON CONFLICT REPLACE);"); + return; + } + if (!justPasswords) { mDatabase.execSQL("DROP TABLE IF EXISTS " + mTableNames[TABLE_COOKIES_ID]); @@ -302,8 +317,8 @@ public class WebViewDatabase { + HTTPAUTH_HOST_COL + " TEXT, " + HTTPAUTH_REALM_COL + " TEXT, " + HTTPAUTH_USERNAME_COL + " TEXT, " + HTTPAUTH_PASSWORD_COL + " TEXT," + " UNIQUE (" - + HTTPAUTH_HOST_COL + ", " + HTTPAUTH_REALM_COL + ", " - + HTTPAUTH_USERNAME_COL + ") ON CONFLICT REPLACE);"); + + HTTPAUTH_HOST_COL + ", " + HTTPAUTH_REALM_COL + + ") ON CONFLICT REPLACE);"); } // passwords mDatabase.execSQL("CREATE TABLE " + mTableNames[TABLE_PASSWORD_ID] |