12883 public void addErrorToDropBox(String eventType,
12884 ProcessRecord process, String processName, ActivityRecord activity, 12885 ActivityRecord parent, String subject, 12886 final String report, final File logFile, 12887 final ApplicationErrorReport.CrashInfo crashInfo) { 12888 // NOTE -- this must never acquire the ActivityManagerService lock, 12889 // otherwise the watchdog may be prevented from resetting the system. 12890
sTombstoneObserver = new FileObserver(TOMBSTONE_DIR.getPath(), FileObserver.CLOSE_WRITE) {
@Override
public void onEvent(int event, String path) {
try {
File file = new File(TOMBSTONE_DIR, path);
if (file.isFile()) {
addFileToDropBox(db, prefs, headers, file.getPath(), LOG_SIZE, "SYSTEM_TOMBSTONE");
}
} catch (IOException e) {
Slog.e(TAG, "Can‘t log tombstone", e);
}
}
};
这个逻辑在frameworks/base/core/java/com/android/server/BootReceiver.java文件里。原文:http://www.cnblogs.com/lcchuguo/p/5344583.html