From 77ae4ac372b6e6358a9ed236942ea2f3d4e7937f Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Thu, 19 Apr 2012 16:41:53 +0200 Subject: [PATCH] Bug 746035 - Bail out of Profile Migration on errors. r=lucasr a=blocking-fennec --- mobile/android/base/ProfileMigrator.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/ProfileMigrator.java b/mobile/android/base/ProfileMigrator.java index 4725dadd20a..f77ee490845 100644 --- a/mobile/android/base/ProfileMigrator.java +++ b/mobile/android/base/ProfileMigrator.java @@ -275,7 +275,8 @@ public class ProfileMigrator { // Has migration run before? protected boolean hasMigrationRun() { - return areBookmarksMigrated() && (getMigratedHistoryEntries() > 0); + return areBookmarksMigrated() + && ((getMigratedHistoryEntries() > 0) || isHistoryMigrated()); } // Has migration entirely finished? @@ -578,6 +579,8 @@ public class ProfileMigrator { cursor.close(); } catch (SQLiteBridgeException e) { Log.e(LOGTAG, "Failed to get bookmark roots: ", e); + // Do not try again. + setMigratedBookmarks(); return; } } @@ -789,6 +792,8 @@ public class ProfileMigrator { cursor.close(); } catch (SQLiteBridgeException e) { Log.e(LOGTAG, "Failed to get history: ", e); + // Do not try again. + setMigratedHistory(); return; } @@ -1037,6 +1042,8 @@ public class ProfileMigrator { cursor.close(); } catch (SQLiteBridgeException e) { Log.e(LOGTAG, "Failed to get bookmarks: ", e); + // Do not try again. + setMigratedBookmarks(); return; }