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

Commit a9e1c4e5 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "To help assess latency, dump the time a broadcast was enqueued."

parents 273fd8e4 9fb3fd1d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -187,10 +187,12 @@ public final class BroadcastQueue {

    public void enqueueParallelBroadcastLocked(BroadcastRecord r) {
        mParallelBroadcasts.add(r);
        r.enqueueClockTime = System.currentTimeMillis();
    }

    public void enqueueOrderedBroadcastLocked(BroadcastRecord r) {
        mOrderedBroadcasts.add(r);
        r.enqueueClockTime = System.currentTimeMillis();
    }

    public final boolean replaceParallelBroadcastLocked(BroadcastRecord r) {
+4 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ final class BroadcastRecord extends Binder {
    final int appOp;        // an app op that is associated with this broadcast
    final List receivers;   // contains BroadcastFilter and ResolveInfo
    IIntentReceiver resultTo; // who receives final result if non-null
    long enqueueClockTime;  // the clock time the broadcast was enqueued
    long dispatchTime;      // when dispatch started on this set of receivers
    long dispatchClockTime; // the clock time the dispatch started
    long receiverTime;      // when current receiver started for timeouts.
@@ -102,7 +103,9 @@ final class BroadcastRecord extends Binder {
            pw.print(prefix); pw.print("requiredPermission="); pw.print(requiredPermission);
                    pw.print("  appOp="); pw.println(appOp);
        }
        pw.print(prefix); pw.print("dispatchClockTime=");
        pw.print(prefix); pw.print("enqueueClockTime=");
                pw.print(new Date(enqueueClockTime));
                pw.print(" dispatchClockTime=");
                pw.println(new Date(dispatchClockTime));
        pw.print(prefix); pw.print("dispatchTime=");
                TimeUtils.formatDuration(dispatchTime, now, pw);