Bug 746035 - Bail out of Profile Migration on errors. r=lucasr a=blocking-fennec

This commit is contained in:
Gian-Carlo Pascutto 2012-04-19 16:41:53 +02:00
parent 6a3028b06f
commit 5ffd111fe1

View File

@ -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;
}