Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66ff373f authored by Andy Stadler's avatar Andy Stadler Committed by Android Git Automerger
Browse files

am 1f1aed5e: am c4be1b7e: Merge "Add System Tracing capability to Sync Manager" into jb-dev

* commit '1f1aed5e':
  Add System Tracing capability to Sync Manager
parents 541eab68 1f1aed5e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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();
                }
+1 −0
Original line number Diff line number Diff line
@@ -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();