Merge "Push dropbox logging into libcore." into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d053554f80
@ -52,6 +52,7 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Debug;
|
import android.os.Debug;
|
||||||
|
import android.os.DropBoxManager;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@ -108,6 +109,7 @@ import java.util.Map;
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import libcore.io.DropBox;
|
||||||
import libcore.io.EventLogger;
|
import libcore.io.EventLogger;
|
||||||
import libcore.io.IoUtils;
|
import libcore.io.IoUtils;
|
||||||
|
|
||||||
@ -4832,6 +4834,9 @@ public final class ActivityThread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add dropbox logging to libcore
|
||||||
|
DropBox.setReporter(new DropBoxReporter());
|
||||||
|
|
||||||
ViewRootImpl.addConfigCallback(new ComponentCallbacks2() {
|
ViewRootImpl.addConfigCallback(new ComponentCallbacks2() {
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
@ -4887,6 +4892,25 @@ public final class ActivityThread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
public static void main(String[] args) {
|
||||||
SamplingProfilerIntegration.start();
|
SamplingProfilerIntegration.start();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user