AppRTCDemo(android): uncaught exceptions now display a modal dialog box before killing the app.

BUG=2458
R=henrike@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2348004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4914 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org
2013-10-03 18:09:40 +00:00
parent 44db9d1a57
commit ddc5a19ce9
3 changed files with 105 additions and 9 deletions

View File

@@ -93,16 +93,8 @@ public class AppRTCDemoActivity extends Activity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Since the error-handling of this demo consists of throwing
// RuntimeExceptions and we assume that'll terminate the app, we install
// this default handler so it's applied to background threads as well.
Thread.setDefaultUncaughtExceptionHandler(
new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t, Throwable e) {
e.printStackTrace();
System.exit(-1);
}
});
new UnhandledExceptionHandler(this));
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
wakeLock = powerManager.newWakeLock(