Back to project page wigle-wifi-wardriving-badfork.
The source code is released under:
/* * Copyright (c) 2010-2012, Andrew Carra, Robert Hagemann, Hugh Kennedy * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permi...
If you think the Android project wigle-wifi-wardriving-badfork listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.wigle.wigleandroid; /*from ww w .j a v a2 s.c om*/ import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; public class WigleUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { private final Context applicationContext; private final Thread.UncaughtExceptionHandler origHandler; private final PendingIntent pendingIntent; public WigleUncaughtExceptionHandler ( Context applicationContext, Thread.UncaughtExceptionHandler origHandler ) { this.applicationContext = applicationContext.getApplicationContext(); this.origHandler = origHandler; // set up pending email intent to email stacktrace logs if needed final Intent errorReportIntent = new Intent( this.applicationContext, ErrorReportActivity.class ); errorReportIntent.putExtra( ListActivity.ERROR_REPORT_DO_EMAIL, true ); pendingIntent = PendingIntent.getActivity( this.applicationContext, 0, errorReportIntent, errorReportIntent.getFlags() ); } public void uncaughtException( Thread thread, Throwable throwable ) { String error = "Thread: " + thread + " throwable: " + throwable; ListActivity.error( error ); throwable.printStackTrace(); ListActivity.writeError( thread, throwable, applicationContext ); // set the email intent to go off in a few seconds AlarmManager mgr = (AlarmManager) applicationContext.getSystemService(Context.ALARM_SERVICE); mgr.set( AlarmManager.RTC, System.currentTimeMillis() + 5000, pendingIntent ); // give it to the regular handler origHandler.uncaughtException( thread, throwable ); } }