Keep all Android crash information
Framework/base/core/java/com/android/internal/os/runtimeinit.java
Re-enter this function, add your own code, save the information, or send it back to the server
*/
private static class Uncaughthandler implements Thread.uncaughtexceptionhandler {
public void Uncaughtexception (Thread t, Throwable e) {
try {
Don ' t re-enter--avoid infinite loops if crash-reporting crashes.
if (mcrashing) return;
Mcrashing = true;
if (Mapplicationobject = = null) {
Clog_e (TAG, "* * * FATAL EXCEPTION in SYSTEM PROCESS:" + t.getname (), E);
} else {
StringBuilder message = new StringBuilder ();
Message.append ("FATAL EXCEPTION:"). Append (T.getname ()). Append ("\ n");
Final String processName = Activitythread.currentprocessname ();
if (processName! = null) {
Message.append ("Process:"). Append (ProcessName). Append (",");
}
Message.append ("PID:"). Append (Process.mypid ());
Clog_e (TAG, message.tostring (), E);
}
Bring up crash dialog, wait for it to be dismissed
Activitymanagernative.getdefault (). Handleapplicationcrash (
Mapplicationobject, New Applicationerrorreport.crashinfo (e));
} catch (Throwable T2) {
try {
Clog_e (TAG, "Error reporting Crash", T2);
} catch (Throwable t3) {
Even Clog_e () fails! Oh well.
}
} finally {
Try everything to make sure this process goes away.
Process.killprocess (Process.mypid ());
System.exit (10);
}
}
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Keep all Android crash information