Bug 686405 - Remove push-to-debug Android debug intent, and just sleep the thread. r=snorp
☠☠ backed out by 3950656acf1b ☠ ☠
authorDoug Turner <dougt@dougt.org>
Mon, 12 Sep 2011 21:27:04 -0700
changeset 78216 091bdb10d01717a68c730b2625d3d02a443ce1bf
parent 78215 ddb49b079701d0a44947b087eda139a2401a6c73
child 78217 3950656acf1bbca750db300bc00b03bba4dfd657
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs686405
milestone9.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 686405 - Remove push-to-debug Android debug intent, and just sleep the thread. r=snorp
embedding/android/GeckoApp.java
--- a/embedding/android/GeckoApp.java
+++ b/embedding/android/GeckoApp.java
@@ -80,18 +80,17 @@ abstract public class GeckoApp
     public static boolean mFullscreen = false;
     public static File sGREDir = null;
     static Thread mLibLoadThread = null;
     public Handler mMainHandler;
     private IntentFilter mConnectivityFilter;
     private BroadcastReceiver mConnectivityReceiver;
     private PhoneStateListener mPhoneStateListener;
 
-    enum LaunchState {PreLaunch, Launching, WaitButton,
-                      Launched, GeckoRunning, GeckoExiting};
+    enum LaunchState {PreLaunch, Launching, Launched, GeckoRunning, GeckoExiting};
     private static LaunchState sLaunchState = LaunchState.PreLaunch;
     private static boolean sTryCatchAttached = false;
 
 
     static boolean checkLaunchState(LaunchState checkState) {
         synchronized(sLaunchState) {
             return sLaunchState == checkState;
         }
@@ -296,53 +295,52 @@ abstract public class GeckoApp
     protected void onNewIntent(Intent intent) {
         if (checkLaunchState(LaunchState.GeckoExiting)) {
             // We're exiting and shouldn't try to do anything else just incase
             // we're hung for some reason we'll force the process to exit
             System.exit(0);
             return;
         }
         final String action = intent.getAction();
-        if (ACTION_DEBUG.equals(action) &&
-            checkAndSetLaunchState(LaunchState.Launching, LaunchState.WaitButton)) {
-            final Button launchButton = new Button(this);
-            launchButton.setText("Launch"); // don't need to localize
-            launchButton.setOnClickListener(new Button.OnClickListener() {
-                public void onClick (View v) {
-                    // hide the button so we can't be launched again
-                    mainLayout.removeView(launchButton);
-                    setLaunchState(LaunchState.Launching);
-                    launch(null);
-                }
-            });
-            mainLayout.addView(launchButton, 300, 200);
-            return;
-        }
-        if (checkLaunchState(LaunchState.WaitButton) || launch(intent))
-            return;
 
         if (Intent.ACTION_MAIN.equals(action)) {
             Log.i(LOG_FILE_NAME, "Intent : ACTION_MAIN");
             GeckoAppShell.sendEventToGecko(new GeckoEvent(""));
+            return;
         }
-        else if (Intent.ACTION_VIEW.equals(action)) {
+        
+        if (Intent.ACTION_VIEW.equals(action)) {
             String uri = intent.getDataString();
             GeckoAppShell.sendEventToGecko(new GeckoEvent(uri));
             Log.i(LOG_FILE_NAME,"onNewIntent: "+uri);
+            return;
         }
-        else if (ACTION_WEBAPP.equals(action)) {
+        
+        if (ACTION_WEBAPP.equals(action)) {
             String uri = intent.getStringExtra("args");
             GeckoAppShell.sendEventToGecko(new GeckoEvent(uri));
             Log.i(LOG_FILE_NAME,"Intent : WEBAPP - " + uri);
+            return;
         }
-        else if (ACTION_BOOKMARK.equals(action)) {
+        
+        if (ACTION_BOOKMARK.equals(action)) {
             String args = intent.getStringExtra("args");
             GeckoAppShell.sendEventToGecko(new GeckoEvent(args));
             Log.i(LOG_FILE_NAME,"Intent : BOOKMARK - " + args);
+            return;
         }
+
+        if (ACTION_DEBUG.equals(action)) {
+            // Wait for 5 seconds until the debugger can attach.
+            try {
+                Thread.sleep(5000);
+            } catch (InterruptedException e) {}
+        }
+
+        launch(intent);
     }
 
     @Override
     public void onPause()
     {
         Log.i(LOG_FILE_NAME, "pause");
         GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_PAUSING));
         // The user is navigating away from this activity, but nothing