mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 686405 - Remove push-to-debug Android debug intent, and just sleep the thread. r=snorp
This commit is contained in:
parent
65b4b6ed3c
commit
3dd100af55
@ -85,8 +85,7 @@ abstract public class GeckoApp
|
||||
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;
|
||||
|
||||
@ -301,43 +300,42 @@ abstract public class GeckoApp
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user