diff options
author | John Reck <jreck@google.com> | 2011-12-02 17:57:33 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-02 17:57:33 -0800 |
commit | f4a12db4592e1de9b900cc787be89bf4fc6018f5 (patch) | |
tree | efea39c4f0641994e897dd791c9b1f1e2277925b /src | |
parent | f5e7577bca687038dd5a24ef78fa9fb279a2f32b (diff) | |
parent | 31ae2cc171ed6355d958ea05501ce6e7ef0ad223 (diff) | |
download | packages_apps_browser-f4a12db4592e1de9b900cc787be89bf4fc6018f5.zip packages_apps_browser-f4a12db4592e1de9b900cc787be89bf4fc6018f5.tar.gz packages_apps_browser-f4a12db4592e1de9b900cc787be89bf4fc6018f5.tar.bz2 |
am 31ae2cc1: Switch BP1->2 upgrade to best effort
* commit '31ae2cc171ed6355d958ea05501ce6e7ef0ad223':
Switch BP1->2 upgrade to best effort
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/provider/BrowserProvider2.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/browser/provider/BrowserProvider2.java index 06c8e16..06ace20 100644 --- a/src/com/android/browser/provider/BrowserProvider2.java +++ b/src/com/android/browser/provider/BrowserProvider2.java @@ -518,18 +518,21 @@ public class BrowserProvider2 extends SQLiteContentProvider { null, null, null); if (c != null) { while (c.moveToNext()) { + String url = c.getString(0); + if (TextUtils.isEmpty(url)) + continue; // We require a valid URL ContentValues values = new ContentValues(); - values.put(Bookmarks.URL, c.getString(0)); + values.put(Bookmarks.URL, url); values.put(Bookmarks.TITLE, c.getString(1)); values.put(Bookmarks.DATE_CREATED, c.getInt(4)); values.put(Bookmarks.POSITION, 0); values.put(Bookmarks.PARENT, FIXED_ID_ROOT); ContentValues imageValues = new ContentValues(); - imageValues.put(Images.URL, c.getString(0)); + imageValues.put(Images.URL, url); imageValues.put(Images.FAVICON, c.getBlob(2)); imageValues.put(Images.TOUCH_ICON, c.getBlob(3)); - db.insertOrThrow(TABLE_IMAGES, Images.THUMBNAIL, imageValues); - db.insertOrThrow(TABLE_BOOKMARKS, Bookmarks.DIRTY, values); + db.insert(TABLE_IMAGES, Images.THUMBNAIL, imageValues); + db.insert(TABLE_BOOKMARKS, Bookmarks.DIRTY, values); } c.close(); } @@ -547,12 +550,15 @@ public class BrowserProvider2 extends SQLiteContentProvider { if (c != null) { while (c.moveToNext()) { ContentValues values = new ContentValues(); - values.put(History.URL, c.getString(0)); + String url = c.getString(0); + if (TextUtils.isEmpty(url)) + continue; // We require a valid URL + values.put(History.URL, url); values.put(History.TITLE, c.getString(1)); values.put(History.VISITS, c.getInt(2)); values.put(History.DATE_LAST_VISITED, c.getLong(3)); values.put(History.DATE_CREATED, c.getLong(4)); - db.insertOrThrow(TABLE_HISTORY, History.FAVICON, values); + db.insert(TABLE_HISTORY, History.FAVICON, values); } c.close(); } |