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

--HG--
extra : rebase_source : 3293fcaaf645706133531cb0180b6514a289b612
This commit is contained in:
Jan Henning 2018-08-04 15:21:40 +02:00
parent 50803fba6b
commit 85eac0f5c4

View File

@ -392,7 +392,7 @@ public class GeckoView extends FrameLayout {
setSession(ss.session, ss.session.getRuntime());
} else if (ss.session != null) {
mSession.transferFrom(ss.session);
mRuntime = ss.session.getRuntime();
mRuntime = mSession.getRuntime();
}
}