Bug 1222638 - Don't inflate zoomed view until its needed. r=mcomella
authordominique vincent <domivinc@toitl.com>
Sat, 28 Nov 2015 20:42:35 +0100
changeset 274977 cd278a1e4865844185ee459855ec2bb6d1c30eb3
parent 274708 3307a801862270294770042f6e9b19ff92ed5b24
child 274978 7c75159bc4a6209f3d3cf652722e27fb7ae29b8c
push id29743
push userkwierso@gmail.com
push dateWed, 02 Dec 2015 00:07:20 +0000
treeherdermozilla-central@13022e404bfd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1222638
milestone45.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 1222638 - Don't inflate zoomed view until its needed. r=mcomella
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -726,19 +726,16 @@ public class BrowserApp extends GeckoApp
             @Override
             public void onEnabledChanged(boolean enabled) {
                 setDynamicToolbarEnabled(enabled);
             }
         });
 
         // Set the maximum bits-per-pixel the favicon system cares about.
         IconDirectoryEntry.setMaxBPP(GeckoAppShell.getScreenDepth());
-
-        ViewStub stub = (ViewStub) findViewById(R.id.zoomed_view_stub);
-        mZoomedView = (ZoomedView) stub.inflate();
     }
 
     private void conditionallyNotifyHCEOL() {
         final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
         try {
             final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this);
             if (!prefs.getBoolean(HONEYCOMB_EOL_NOTIFIED, false)) {
 
@@ -1762,16 +1759,20 @@ public class BrowserApp extends GeckoApp
                 });
             } else if (event.equals("Gecko:DelayedStartup")) {
                 ThreadUtils.postToUiThread(new Runnable() {
                     @Override
                     public void run() {
                         // Force tabs panel inflation once the initial
                         // pageload is finished.
                         ensureTabsPanelExists();
+                        if (mZoomedView == null) {
+                            ViewStub stub = (ViewStub) findViewById(R.id.zoomed_view_stub);
+                            mZoomedView = (ZoomedView) stub.inflate();
+                        }
                     }
                 });
 
                 if (AppConstants.MOZ_MEDIA_PLAYER) {
                     // Check if the fragment is already added. This should never be true here, but this is
                     // a nice safety check.
                     // If casting is disabled, these classes aren't built. We use reflection to initialize them.
                     final Class<?> mediaManagerClass = getMediaPlayerManager();