Push dropbox logging into libcore.
Change-Id: I74c0644c6938d28c20c42d88d995ffb56a71d703
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 9b82f2a..81d87659 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -52,6 +52,7 @@
import android.os.Binder;
import android.os.Bundle;
import android.os.Debug;
+import android.os.DropBoxManager;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
@@ -108,6 +109,7 @@
import java.util.TimeZone;
import java.util.regex.Pattern;
+import libcore.io.DropBox;
import libcore.io.EventLogger;
import libcore.io.IoUtils;
@@ -4831,7 +4833,10 @@
"Unable to instantiate Application():" + e.toString(), e);
}
}
-
+
+ // add dropbox logging to libcore
+ DropBox.setReporter(new DropBoxReporter());
+
ViewRootImpl.addConfigCallback(new ComponentCallbacks2() {
public void onConfigurationChanged(Configuration newConfig) {
synchronized (mPackages) {
@@ -4887,6 +4892,25 @@
}
}
+ private class DropBoxReporter implements DropBox.Reporter {
+
+ private DropBoxManager dropBox;
+
+ public DropBoxReporter() {
+ dropBox = (DropBoxManager) getSystemContext().getSystemService(Context.DROPBOX_SERVICE);
+ }
+
+ @Override
+ public void addData(String tag, byte[] data, int flags) {
+ dropBox.addData(tag, data, flags);
+ }
+
+ @Override
+ public void addText(String tag, String data) {
+ dropBox.addText(tag, data);
+ }
+ }
+
public static void main(String[] args) {
SamplingProfilerIntegration.start();