Bug 792212 - Don't attempt to migrate profiles if using a custom profile;r=gbrown

It seems that doing so triggers a race condition which can result in the fennec
reftests failing, if the shared preferences associated with profile migration or
the gecko application is not correctly initialized. This is more or less a band
aid solution, but it addresses the problem until we can find the root cause.
This commit is contained in:
William Lachance 2012-09-28 22:52:11 -04:00
parent 6ba91c2842
commit c061bf878d
2 changed files with 7 additions and 3 deletions

View File

@ -156,6 +156,7 @@ abstract public class GeckoApp
public static int mOrientation;
private boolean mIsRestoringActivity;
private String mCurrentResponse = "";
public static boolean sIsUsingCustomProfile = false;
private PromptService mPromptService;
private Favicons mFavicons;
@ -1554,6 +1555,7 @@ abstract public class GeckoApp
if (profileName == null)
profileName = "default";
}
GeckoApp.sIsUsingCustomProfile = true;
}
if (profileName != null || profilePath != null) {
mProfile = GeckoProfile.get(this, profileName, profilePath);
@ -2252,7 +2254,8 @@ abstract public class GeckoApp
ProfileMigrator profileMigrator = new ProfileMigrator(app);
// Do a migration run on the first start after an upgrade.
if (!profileMigrator.hasMigrationRun()) {
if (!GeckoApp.sIsUsingCustomProfile &&
!profileMigrator.hasMigrationRun()) {
// Show the "Setting up Fennec" screen if this takes
// a while.
final SetupScreen setupScreen = new SetupScreen(app);
@ -2296,7 +2299,7 @@ abstract public class GeckoApp
private void checkMigrateSync() {
final File profileDir = getProfile().getDir();
if (profileDir != null) {
if (!GeckoApp.sIsUsingCustomProfile && profileDir != null) {
final GeckoApp app = GeckoApp.mAppContext;
ProfileMigrator profileMigrator = new ProfileMigrator(app);
if (!profileMigrator.hasSyncMigrated()) {

View File

@ -148,7 +148,8 @@ public final class GeckoProfile {
try {
// Check for old profiles that may need migration.
ProfileMigrator profileMigrator = new ProfileMigrator(mContext);
if (!profileMigrator.isProfileMoved()) {
if (!GeckoApp.sIsUsingCustomProfile &&
!profileMigrator.isProfileMoved()) {
Log.i(LOGTAG, "New installation or update, checking for old profiles.");
profileMigrator.launchMoveProfile();
}