addErrorToDropBox
addErrorToDropBox方法位于ActivityManagerService.java中,一共有13个参数。
public void addErrorToDropBox(String eventType,ProcessRecord process, String processName, String activityShortComponentName,String parentShortComponentName, ProcessRecord parentProcess,String subject, final String report, final File dataFile,final ApplicationErrorReport.CrashInfo crashInfo,@Nullable Float loadingProgress, @Nullable IncrementalMetrics incrementalMetrics,@Nullable UUID errorId)
参数说明
该方法的用途以及每个参数的含义可以参考方法注释:
/*** Write a description of an error (crash, WTF, ANR) to the drop box.* 说明这个函数的功能是将一个错误的描述写入到dropbox中* @param eventType to include in the drop box tag ("crash", "wtf", etc.)* 表示要将哪个事件类型(例如崩溃、WTF等)包括在dropbox的标签中* @param process which caused the error, null means the system server* 表示哪个进程导致了错误。如果为null,则表示是system_server进程* @param activityShortComponentName which triggered the error, null if unknown* 表示哪个activity触发了错误。如果未知,则为null* @param parentShortComponentName activity related to the error, null if unknown* 表示与错误相关的activity的父activity。如果未知,则为null* @param parentProcess parent process* 表示父进程* @param subject line related to the error, null if absent* 表示与错误相关的主题行。如果没有,则为null* @param report in long form describing the error, null if absent* 表示详细描述错误的报告。如果没有,则为null* @param dataFile text file to include in the report, null if none* 表示要包括在报告中的文本文件。如果没有,则为null* @param crashInfo giving an application stack trace, null if absent* 表示提供应用程序堆栈跟踪的崩溃信息。如果没有,则为null* @param loadingProgress the loading progress of an installed package, range in [0, 1].* 表示已安装包的加载进度,范围在[0, 1]之间* @param incrementalMetrics metrics for apps installed on Incremental.* 在Incremental上安装的应用程序的指标* @param errorId a unique id to append to the dropbox headers.* 要添加到dropbox头部的唯一ID*/
方法实现
// 这个函数不应该获取ActivityManagerService的锁,否则可能会阻止watchdog重置系统// NOTE -- this must never acquire the ActivityManagerService lock,// otherwise the watchdog may be prevented from r