Bug 792212 - Don't attempt to migrate profiles if using a custom profile;r=gbrown a=akeybl
authorWilliam Lachance <wlachance@mozilla.com>
Fri, 28 Sep 2012 22:52:11 -0400
changeset 107128 c8fd11e70c0f0686891fcb7263d1579c9874f392
parent 107127 7f293a7c521dffa3b0d6ced9e8d4519ccc1b90c2
child 107129 90aa461de286da0390f3b77872e7415ac23927a5
push id2244
push userwjohnston@mozilla.com
push dateMon, 08 Oct 2012 17:19:26 +0000
treeherdermozilla-aurora@90aa461de286 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown, akeybl
bugs792212
milestone17.0a2
Bug 792212 - Don't attempt to migrate profiles if using a custom profile;r=gbrown a=akeybl
mobile/android/base/GeckoApp.java
mobile/android/base/GeckoProfile.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1479,16 +1479,17 @@ abstract public class GeckoApp
                 if (m.find()) {
                     profilePath =  m.group(1);
                 }
                 if (profileName == null) {
                     profileName = getDefaultProfileName();
                     if (profileName == null)
                         profileName = "default";
                 }
+                GeckoApp.sIsUsingCustomProfile = true;
             }
             if (profileName != null || profilePath != null) {
                 mProfile = GeckoProfile.get(this, profileName, profilePath);
             }
         }
 
         BrowserDB.initialize(getProfile().getName());
 
@@ -2200,17 +2201,18 @@ abstract public class GeckoApp
 
             GeckoAppShell.getHandler().post(new Runnable() {
                 public void run() {
                     Log.i(LOGTAG, "Checking profile migration in: " + profileDir.getAbsolutePath());
 
                     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);
 
                         final Runnable startCallback = new Runnable() {
                             public void run() {
                                 GeckoApp.mAppContext.runOnUiThread(new Runnable() {
                                     public void run() {
@@ -2244,17 +2246,17 @@ abstract public class GeckoApp
         }
     }
 
     protected void finishProfileMigration() {
     }
 
     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()) {
                 Log.i(LOGTAG, "Checking Sync settings in: " + profileDir.getAbsolutePath());
                 profileMigrator.launchSyncPrefs();
             }
         }
     }
--- a/mobile/android/base/GeckoProfile.java
+++ b/mobile/android/base/GeckoProfile.java
@@ -143,17 +143,18 @@ public final class GeckoProfile {
     public synchronized File getDir() {
         if (mDir != null) {
             return mDir;
         }
 
         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();
             }
 
             // now check if a profile with this name that already exists
             File mozillaDir = ensureMozillaDirectory(mContext);
             mDir = findProfileDir(mozillaDir);
             if (mDir == null) {