|
52 | 52 | import android.os.Binder; |
53 | 53 | import android.os.Bundle; |
54 | 54 | import android.os.Debug; |
| 55 | +import android.os.DropBoxManager; |
55 | 56 | import android.os.Environment; |
56 | 57 | import android.os.Handler; |
57 | 58 | import android.os.IBinder; |
|
108 | 109 | import java.util.TimeZone; |
109 | 110 | import java.util.regex.Pattern; |
110 | 111 |
|
| 112 | +import libcore.io.DropBox; |
111 | 113 | import libcore.io.EventLogger; |
112 | 114 | import libcore.io.IoUtils; |
113 | 115 |
|
@@ -4831,7 +4833,10 @@ public void run() { |
4831 | 4833 | "Unable to instantiate Application():" + e.toString(), e); |
4832 | 4834 | } |
4833 | 4835 | } |
4834 | | - |
| 4836 | + |
| 4837 | + // add dropbox logging to libcore |
| 4838 | + DropBox.setReporter(new DropBoxReporter()); |
| 4839 | + |
4835 | 4840 | ViewRootImpl.addConfigCallback(new ComponentCallbacks2() { |
4836 | 4841 | public void onConfigurationChanged(Configuration newConfig) { |
4837 | 4842 | synchronized (mPackages) { |
@@ -4887,6 +4892,25 @@ public void report (int code, Object... list) { |
4887 | 4892 | } |
4888 | 4893 | } |
4889 | 4894 |
|
| 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 | + |
4890 | 4914 | public static void main(String[] args) { |
4891 | 4915 | SamplingProfilerIntegration.start(); |
4892 | 4916 |
|
|
0 commit comments