Bug 1332546 - add initialization checking to SiteIdentityPopup r=sebastian
authorJulian_Chu <walkingice0204@gmail.com>
Fri, 10 Mar 2017 12:54:09 +0800
changeset 348316 c9df402008ca91b48edcb5de1e8173f68c93108b
parent 348315 540020bee3a69181f00d1ab059d6588f3c9a2cd8
child 348317 1edd52437ecb2f6b64bcbdbae85b7faa79280a16
push id88187
push userarchaeopteryx@coole-files.de
push dateSat, 18 Mar 2017 15:27:00 +0000
treeherdermozilla-inbound@0b1d3324cffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1332546
milestone55.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 1332546 - add initialization checking to SiteIdentityPopup r=sebastian If there are multiple SiteIdentityPopup instances.(ie. in GeckoApp and in CustomTabsActivity), each instances will start receiving events once attached to window. However it might have not call init() yet. MozReview-Commit-ID: 1dIAUOTeTLg
mobile/android/base/java/org/mozilla/gecko/toolbar/SiteIdentityPopup.java
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/SiteIdentityPopup.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/SiteIdentityPopup.java
@@ -166,16 +166,22 @@ public class SiteIdentityPopup extends A
                 addLoginsToTab(data);
             }
             if (isShowing()) {
                 addSelectLoginDoorhanger(selectedTab);
             }
 
         } else if ("Permissions:CheckResult".equals(event)) {
             final boolean hasPermissions = geckoObject.getBoolean("hasPermissions", false);
+
+            // ensure initialization completed, in case of receiving event too early
+            if (!mInflated) {
+                init();
+            }
+
             if (hasPermissions) {
                 mSiteSettingsLink.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         EventDispatcher.getInstance().dispatch("Permissions:Get", null);
                         dismiss();
                     }
                 });