Bug 1427239 - Always create FormAssistPopup in WebAppActivity; r=droeh a=lizzard
authorJim Chen <nchen@mozilla.com>
Thu, 08 Feb 2018 13:44:54 -0500
changeset 454814 e1b7cf0d65abf9792e795b99f7875193969cf832
parent 454813 38f370417409110b1fc422bb3d4088a3a91f8ff1
child 454815 ab285921713c97914561c3834dc4c1a6c31383cf
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdroeh, lizzard
bugs1427239
milestone59.0
Bug 1427239 - Always create FormAssistPopup in WebAppActivity; r=droeh a=lizzard Right now we create FormAssistPopup in WebAppActivity based on whether the manifest is successfully loaded. We should always create it because we always try to destroy it in onDestroy(). MozReview-Commit-ID: KskEZmYrDS1
mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -145,16 +145,19 @@ public class WebAppActivity extends AppC
             }
         });
 
         GeckoAccessibility.setDelegate(mGeckoView);
 
         mPromptService = new PromptService(this, mGeckoView.getEventDispatcher());
         mDoorHangerPopup = new DoorHangerPopup(this, mGeckoView.getEventDispatcher());
 
+        mFormAssistPopup = (FormAssistPopup) findViewById(R.id.pwa_form_assist_popup);
+        mFormAssistPopup.create(mGeckoView);
+
         mTextSelection = TextSelection.Factory.create(mGeckoView, this);
         mTextSelection.create();
 
         final GeckoSessionSettings settings = mGeckoView.getSettings();
         settings.setBoolean(GeckoSessionSettings.USE_MULTIPROCESS, false);
         settings.setBoolean(
             GeckoSessionSettings.USE_REMOTE_DEBUGGER,
             GeckoSharedPrefs.forApp(this).getBoolean(
@@ -167,22 +170,16 @@ public class WebAppActivity extends AppC
             Log.w(LOGTAG, "Cannot retrieve manifest, launching in Firefox:" + e);
             fallbackToFennec(null);
             return;
         }
 
         updateFromManifest();
 
         mGeckoSession.loadUri(mManifest.getStartUri().toString());
-
-        mFormAssistPopup = (FormAssistPopup) findViewById(R.id.pwa_form_assist_popup);
-        mFormAssistPopup.create(mGeckoView);
-
-
-
     }
 
     private void fallbackToFennec(String message) {
         if (message != null) {
             Toast.makeText(this, message, Toast.LENGTH_LONG).show();
         }
 
         try {
@@ -213,19 +210,19 @@ public class WebAppActivity extends AppC
     public void onPause() {
         mGeckoSession.setActive(false);
         super.onPause();
     }
 
     @Override
     public void onDestroy() {
         mTextSelection.destroy();
+        mFormAssistPopup.destroy();
         mDoorHangerPopup.destroy();
         mPromptService.destroy();
-        mFormAssistPopup.destroy();
         super.onDestroy();
     }
 
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (!ActivityHandlerHelper.handleActivityResult(requestCode, resultCode, data)) {
             super.onActivityResult(requestCode, resultCode, data);
         }