Bug 1548960 - Call super.onAttachedToWindow from GeckoView even when we have no session set. r=geckoview-reviewers,snorp
authorEitan Isaacson <eitan@monotonous.org>
Mon, 06 May 2019 16:38:18 +0000
changeset 531542 729b948b257afc86585243423bb191b845b09238
parent 531541 cf38c251e2e643abd7b4bbc994f141a5dd174c5b
child 531543 70b7703b8c13dc87f02693338eef29ea36bb3689
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp
bugs1548960
milestone68.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 1548960 - Call super.onAttachedToWindow from GeckoView even when we have no session set. r=geckoview-reviewers,snorp Differential Revision: https://phabricator.services.mozilla.com/D29916
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
@@ -452,26 +452,25 @@ public class GeckoView extends FrameLayo
 
     public @NonNull DynamicToolbarAnimator getDynamicToolbarAnimator() {
         ThreadUtils.assertOnUiThread();
         return mSession.getDynamicToolbarAnimator();
     }
 
     @Override
     public void onAttachedToWindow() {
-        if (mSession == null) {
+        if (mSession != null && mRuntime != null) {
+            if (!mSession.isOpen()) {
+                mSession.open(mRuntime);
+            }
+            mRuntime.orientationChanged();
+        } else {
             Log.w(LOGTAG, "No GeckoSession attached to this GeckoView instance. Call setSession to attach a GeckoSession to this instance.");
-            return;
         }
 
-        if (!mSession.isOpen()) {
-            mSession.open(mRuntime);
-        }
-        mRuntime.orientationChanged();
-
         super.onAttachedToWindow();
     }
 
     @Override
     public void onDetachedFromWindow() {
         super.onDetachedFromWindow();
 
         if (mSession == null) {