zoukankan      html  css  js  c++  java
  • 保留全部Android crash信息

    保留全部Android crash信息


    framework/base/core/java/com/android/internal/os/RuntimeInit.java


    又一次以下这个函数,增加自己的代码,把信息保存下来,或者发回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(" ");
                        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);
                }
            }
        }

  • 相关阅读:
    git push时提示"fatal: The current branch master has no..."
    git push时提示"Everything up-to-date"
    图解vim常用命令
    总结下git中一些常用命令
    SVN服务端的版本对比及创建仓库时的注意事项
    bootstrap字体图标不正常显示的原因
    bigdata_Hadoop jps出现process information unavailable提示解决办法
    bigdata_批量机器执行通用脚本
    bigdata_ambari修改hiveserver_metastore链接库(从0.14 升级到1.2.1 )
    bigdata_一篇文看懂Hadoop
  • 原文地址:https://www.cnblogs.com/mfmdaoyou/p/7074271.html
Copyright © 2011-2022 走看看