Merge "Add System Tracing capability to Sync Manager" into jb-dev
This commit is contained in:
@@ -21,6 +21,7 @@ import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteException;
|
||||
import android.os.Trace;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -233,9 +234,15 @@ public abstract class AbstractThreadedSyncAdapter {
|
||||
mThreadsKey = toSyncKey(account);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
|
||||
|
||||
// Trace this sync instance. Note, conceptually this should be in
|
||||
// SyncStorageEngine.insertStartSyncEvent(), but the trace functions require unique
|
||||
// threads in order to track overlapping operations, so we'll do it here for now.
|
||||
Trace.traceBegin(Trace.TRACE_TAG_SYNC_MANAGER, mAuthority);
|
||||
|
||||
SyncResult syncResult = new SyncResult();
|
||||
ContentProviderClient provider = null;
|
||||
try {
|
||||
@@ -250,6 +257,8 @@ public abstract class AbstractThreadedSyncAdapter {
|
||||
syncResult.databaseError = true;
|
||||
}
|
||||
} finally {
|
||||
Trace.traceEnd(Trace.TRACE_TAG_SYNC_MANAGER);
|
||||
|
||||
if (provider != null) {
|
||||
provider.release();
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ public final class Trace {
|
||||
public static final long TRACE_TAG_WEBVIEW = 1L << 4;
|
||||
public static final long TRACE_TAG_WINDOW_MANAGER = 1L << 5;
|
||||
public static final long TRACE_TAG_ACTIVITY_MANAGER = 1L << 6;
|
||||
public static final long TRACE_TAG_SYNC_MANAGER = 1L << 7;
|
||||
|
||||
private static final long sEnabledTags = nativeGetEnabledTags();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user