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

Commit b250bf93 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add trace for getHistoricalOps API" into main

parents c933c6ad 273686ba
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import android.os.Bundle;
import android.os.Environment;
import android.os.Process;
import android.os.RemoteCallback;
import android.os.Trace;
import android.provider.DeviceConfig;
import android.provider.Settings;
import android.util.ArraySet;
@@ -590,6 +591,8 @@ public class HistoricalRegistry implements HistoricalRegistryInterface {
            @Nullable String attributionTag, @Nullable String[] opNames, int historyFlags,
            int filter, long beginTimeMillis, long endTimeMillis, int flags,
            @Nullable String[] attributionExemptPkgs, @NonNull RemoteCallback callback) {
        Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "AppOpHistory#SQLiteGetHistoricalOps");
        try {
            final long currentTimeMillis = System.currentTimeMillis();
            if (endTimeMillis == Long.MAX_VALUE) {
                endTimeMillis = currentTimeMillis;
@@ -610,6 +613,9 @@ public class HistoricalRegistry implements HistoricalRegistryInterface {
            final Bundle payload = new Bundle();
            payload.putParcelable(AppOpsManager.KEY_HISTORICAL_OPS, result);
            callback.sendResult(payload);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
        }
    }

    @Override