Bug 1476106 - Part 2 - Fix setting of mRuntime when restoring GeckoView from savedInstanceState. r=snorp
☠☠ backed out by b7cd9638d4a4 ☠ ☠
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 04 Aug 2018 15:21:40 +0200
changeset 430556 deb22f602d59ebe947e568749d4075ed2d563640
parent 430555 3b1084efc943a6819dfb067437918010d17d4a25
child 430557 b1a3ff0760bfd2d26d3f22e58139ca28e94f8d1e
push id67508
push usermozilla@buttercookie.de
push dateWed, 08 Aug 2018 14:45:07 +0000
treeherderautoland@bf1f28e2b46d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1476106
milestone63.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 1476106 - Part 2 - Fix setting of mRuntime when restoring GeckoView from savedInstanceState. r=snorp The call to mSession.transferFrom(ss.session) in the line above also transfers the window from ss.session into mSession, which means we subsequently won't be able to retrieve a runtime from ss.session any more, thereby defeating the goal of calling mRuntime = ss.session.getRuntime(). This case is encountered e.g. when the containing activity is destroyed and sub- sequently recreated after a configuration change that isn't handled by the app, e.g. screen rotation in the GeckoView example app. MozReview-Commit-ID: 5YGskdLZWqw
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
@@ -387,17 +387,17 @@ public class GeckoView extends FrameLayo
 
         final SavedState ss = (SavedState) state;
         super.onRestoreInstanceState(ss.getSuperState());
 
         if (mSession == null && ss.session != null) {
             setSession(ss.session, ss.session.getRuntime());
         } else if (ss.session != null) {
             mSession.transferFrom(ss.session);
-            mRuntime = ss.session.getRuntime();
+            mRuntime = mSession.getRuntime();
         }
     }
 
     @Override
     public void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
         super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
 
         if (!gainFocus || mIsResettingFocus) {