Bug 738859 - Increment mActivityDepth for all activities launched from GeckoApp. r=blassey
authorBrian Nicholson <bnicholson@mozilla.com>
Tue, 27 Mar 2012 12:25:26 -0700
changeset 93754 43b9f25a14b08e295151e3a4e7fd7334bba1d1dc
parent 93753 bb496ca24eefd6679b0258a00ab01a85cac0aef3
child 93755 bfd56e7aa7c18fd9c0959c6b6e97f0111cc34917
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs738859
milestone14.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 738859 - Increment mActivityDepth for all activities launched from GeckoApp. r=blassey
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -146,17 +146,17 @@ abstract public class GeckoApp
     private static GeckoLayerClient mLayerClient;
     private AboutHomeContent mAboutHomeContent;
     private static AbsoluteLayout mPluginContainer;
 
     public String mLastTitle;
     public String mLastSnapshotUri;
     public String mLastViewport;
     public byte[] mLastScreen;
-    public int mOwnActivityDepth = 0;
+    private int mOwnActivityDepth = 0;
     private boolean mRestoreSession = false;
     private boolean mInitialized = false;
 
     private static final String HANDLER_MSG_TYPE = "type";
     private static final int HANDLER_MSG_TYPE_INITIALIZE = 1;
 
     static class ExtraMenuItem implements MenuItem.OnMenuItemClickListener {
         String label;
@@ -2555,17 +2555,16 @@ abstract public class GeckoApp
             Tab tab = Tabs.getInstance().getSelectedTab();
             if (tab != null) {
                 String url = tab.getURL();
                 if (url != null) {
                     intent.putExtra(AwesomeBar.CURRENT_URL_KEY, url);
                 }
             }
         }
-        mOwnActivityDepth++;
         startActivityForResult(intent, AWESOMEBAR_REQUEST);
         return true;
     }
 
     public boolean doReload() {
         Log.i(LOGTAG, "Reload requested");
         Tab tab = Tabs.getInstance().getSelectedTab();
         if (tab == null)
@@ -2846,16 +2845,28 @@ abstract public class GeckoApp
             switch (type) {
                 case HANDLER_MSG_TYPE_INITIALIZE:
                     initialize();
                     break;
 
             }
         }
     } 
+
+    @Override
+    public void startActivity(Intent intent) {
+        mOwnActivityDepth++;
+        super.startActivity(intent);
+    }
+
+    @Override
+    public void startActivityForResult(Intent intent, int request) {
+        mOwnActivityDepth++;
+        super.startActivityForResult(intent, request);
+    }
 }
 
 class PluginLayoutParams extends AbsoluteLayout.LayoutParams
 {
     private static final int MAX_DIMENSION = 2048;
     private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
 
     private int mOriginalX;