Skip to content

Commit b7faaf4

Browse files
committed
Push dropbox logging into libcore.
Change-Id: I74c0644c6938d28c20c42d88d995ffb56a71d703
1 parent 2d95a33 commit b7faaf4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

core/java/android/app/ActivityThread.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import android.os.Binder;
5353
import android.os.Bundle;
5454
import android.os.Debug;
55+
import android.os.DropBoxManager;
5556
import android.os.Environment;
5657
import android.os.Handler;
5758
import android.os.IBinder;
@@ -108,6 +109,7 @@
108109
import java.util.TimeZone;
109110
import java.util.regex.Pattern;
110111

112+
import libcore.io.DropBox;
111113
import libcore.io.EventLogger;
112114
import libcore.io.IoUtils;
113115

@@ -4831,7 +4833,10 @@ public void run() {
48314833
"Unable to instantiate Application():" + e.toString(), e);
48324834
}
48334835
}
4834-
4836+
4837+
// add dropbox logging to libcore
4838+
DropBox.setReporter(new DropBoxReporter());
4839+
48354840
ViewRootImpl.addConfigCallback(new ComponentCallbacks2() {
48364841
public void onConfigurationChanged(Configuration newConfig) {
48374842
synchronized (mPackages) {
@@ -4887,6 +4892,25 @@ public void report (int code, Object... list) {
48874892
}
48884893
}
48894894

4895+
private class DropBoxReporter implements DropBox.Reporter {
4896+
4897+
private DropBoxManager dropBox;
4898+
4899+
public DropBoxReporter() {
4900+
dropBox = (DropBoxManager) getSystemContext().getSystemService(Context.DROPBOX_SERVICE);
4901+
}
4902+
4903+
@Override
4904+
public void addData(String tag, byte[] data, int flags) {
4905+
dropBox.addData(tag, data, flags);
4906+
}
4907+
4908+
@Override
4909+
public void addText(String tag, String data) {
4910+
dropBox.addText(tag, data);
4911+
}
4912+
}
4913+
48904914
public static void main(String[] args) {
48914915
SamplingProfilerIntegration.start();
48924916

0 commit comments

Comments
 (0)