Bug 1500023 - Only process previous session file once per app startup. r=nalexander
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 22 Nov 2018 17:10:49 +0000
changeset 504311 d6d4324ac77986649e1e09983b1f4061ff40d395
parent 504310 a95519247ae7f4ec260d0009ee7b5af0841513d5
child 504312 2317749c5abfb7eab139a2545d2fa5362d2309f0
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1500023
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1500023 - Only process previous session file once per app startup. r=nalexander Even if the GeckoApp activity is destroyed, the user's tabs remain open as long as the app process itself isn't killed. Therefore, for users who aren't automatically restoring their previous session's tabs on startup, there's no point in renaming the current session store file so it appears under "Recently closed" instead of being automatically restored, unless we're really doing a cold startup (and hence mIsRestoringActivity is false). This also better matches what we do when we *are* automatically restoring tabs: We only do it when !mIsRestoringActivity, too. Differential Revision: https://phabricator.services.mozilla.com/D11800
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1201,20 +1201,19 @@ public abstract class GeckoApp extends G
                 synchronized (GeckoApp.this) {
                     mSessionRestoreParsingFinished = true;
                     GeckoApp.this.notifyAll();
                 }
 
                 // If we are doing a restore, send the parsed session data to Gecko.
                 if (!mIsRestoringActivity) {
                     getAppEventDispatcher().dispatch("Session:Restore", restoreMessage);
+                    // Make sure sessionstore.old is either updated or deleted as necessary.
+                    getProfile().updateSessionFile(mShouldRestore);
                 }
-
-                // Make sure sessionstore.old is either updated or deleted as necessary.
-                getProfile().updateSessionFile(mShouldRestore);
             }
         });
 
         // Perform background initialization.
         ThreadUtils.postToBackgroundThread(new Runnable() {
             @Override
             public void run() {
                 final SharedPreferences prefs = GeckoApp.this.getSharedPreferences();