Push event logging down into libcore.EventLogger

This changes the default behavior of the EventLogger from logging
to the normal logs to logging to the event logs.

Change-Id: I4338a1605928b82246a369adb3514bd31cd552e8
This commit is contained in:
Geremy Condra
2012-09-11 16:57:17 -07:00
parent a913e70f81
commit c3ec0d01a6

View File

@@ -108,6 +108,7 @@ import java.util.Map;
import java.util.TimeZone;
import java.util.regex.Pattern;
import libcore.io.EventLogger;
import libcore.io.IoUtils;
import dalvik.system.CloseGuard;
@@ -4869,6 +4870,13 @@ public final class ActivityThread {
}
}
private static class EventLoggingReporter implements EventLogger.Reporter {
@Override
public void report (int code, Object... list) {
EventLog.writeEvent(code, list);
}
}
public static void main(String[] args) {
SamplingProfilerIntegration.start();
@@ -4877,6 +4885,9 @@ public final class ActivityThread {
// StrictMode) on debug builds, but using DropBox, not logs.
CloseGuard.setEnabled(false);
// Set the reporter for event logging in libcore
EventLogger.setReporter(new EventLoggingReporter());
Security.addProvider(new AndroidKeyStoreProvider());
Process.setArgV0("<pre-initialized>");