aboutsummaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-06-10 08:27:58 +0000
committerKenny Root <kenny@the-b.org>2009-06-10 08:27:58 +0000
commitd62e6eebae78c8d59c46517fd5cea9be6942f5ba (patch)
tree620ce7a5e365d71097bb839fcfa2f81890a6a234 /src/org
parente7e79db923cd98bfd804ae2dc8383d949b5ddddb (diff)
downloadconnectbot-d62e6eebae78c8d59c46517fd5cea9be6942f5ba.tar.gz
connectbot-d62e6eebae78c8d59c46517fd5cea9be6942f5ba.tar.bz2
connectbot-d62e6eebae78c8d59c46517fd5cea9be6942f5ba.zip
Add stack trace reporting
* When an unhandled exception occurs, the exception handler writes it to a file in addition to all ther other stuff that normally happens * The next time ConnectBot is started up, the user is prompted as to whether they want to submit the stack trace to aid in finding bugs. * If the user agrees or declines, the stack traces are deleted. git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@277 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src/org')
-rw-r--r--src/org/connectbot/ConsoleActivity.java13
-rw-r--r--src/org/connectbot/HostListActivity.java12
-rw-r--r--src/org/connectbot/service/TerminalManager.java5
3 files changed, 29 insertions, 1 deletions
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java
index a88c6d0..20673eb 100644
--- a/src/org/connectbot/ConsoleActivity.java
+++ b/src/org/connectbot/ConsoleActivity.java
@@ -67,6 +67,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;
+
+import com.nullwire.trace.ExceptionHandler;
+
import de.mud.terminal.vt320;
public class ConsoleActivity extends Activity {
@@ -294,6 +297,8 @@ public class ConsoleActivity extends Activity {
this.setContentView(R.layout.act_console);
+ ExceptionHandler.register(this);
+
clipboard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
prefs = PreferenceManager.getDefaultSharedPreferences(this);
@@ -715,7 +720,6 @@ public class ConsoleActivity extends Activity {
// this also keeps the wifi chipset from disconnecting us
if(wakelock != null && prefs.getBoolean(PreferenceConstants.KEEP_ALIVE, true))
wakelock.acquire();
-
}
@Override
@@ -729,6 +733,13 @@ public class ConsoleActivity extends Activity {
wakelock.release();
}
+ @Override
+ public void onResume() {
+ super.onResume();
+
+ ExceptionHandler.checkForTraces(this);
+ }
+
protected void shiftLeft() {
View overlay;
boolean shouldAnimate = flip.getChildCount() > 1;
diff --git a/src/org/connectbot/HostListActivity.java b/src/org/connectbot/HostListActivity.java
index 662da65..17edd0f 100644
--- a/src/org/connectbot/HostListActivity.java
+++ b/src/org/connectbot/HostListActivity.java
@@ -64,6 +64,8 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
+import com.nullwire.trace.ExceptionHandler;
+
public class HostListActivity extends ListActivity {
protected TerminalManager bound = null;
@@ -110,6 +112,7 @@ public class HostListActivity extends ListActivity {
this.updateList();
+ ExceptionHandler.checkForTraces(this);
}
@Override
@@ -124,6 +127,13 @@ public class HostListActivity extends ListActivity {
}
+ @Override
+ public void onResume() {
+ super.onResume();
+
+ ExceptionHandler.checkForTraces(this);
+ }
+
public final static int REQUEST_EDIT = 1;
public final static int REQUEST_EULA = 2;
@@ -157,6 +167,8 @@ public class HostListActivity extends ListActivity {
getResources().getText(R.string.app_name),
getResources().getText(R.string.title_hosts_list)));
+ ExceptionHandler.register(this);
+
// check for eula agreement
this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
diff --git a/src/org/connectbot/service/TerminalManager.java b/src/org/connectbot/service/TerminalManager.java
index 9719452..27812d8 100644
--- a/src/org/connectbot/service/TerminalManager.java
+++ b/src/org/connectbot/service/TerminalManager.java
@@ -61,6 +61,8 @@ import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.util.Log;
+import com.nullwire.trace.ExceptionHandler;
+
/**
* Manager for SSH connections that runs as a background service. This service
* holds a list of currently connected SSH bridges that are ready for connection
@@ -110,6 +112,9 @@ public class TerminalManager extends Service implements BridgeDisconnectedListen
@Override
public void onCreate() {
Log.i(TAG, "Starting background service");
+
+ ExceptionHandler.register(this);
+
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);