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

Commit 4dedb476 authored by Pablo Gamito's avatar Pablo Gamito Committed by Automerger Merge Worker
Browse files

Merge "Include real to elapsed time offset in transition trace" into udc-dev...

Merge "Include real to elapsed time offset in transition trace" into udc-dev am: 66fb7c7f am: ecfd3599

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22707461



Change-Id: I833af158463033235d2d27e35b2d200646c31a68
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2fb91457 ecfd3599
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@ message TransitionTraceProto {
  // Additional debugging info only collected and dumped when explicitly requested to trace
  repeated TransitionState transition_states = 3;
  repeated TransitionInfo transition_info = 4;

  /* offset between real-time clock and elapsed time clock in nanoseconds.
   Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */
  optional fixed64 real_to_elapsed_time_offset_nanos = 5;
}

message Transition {
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.os.Build.IS_USER;
import static com.android.server.wm.shell.TransitionTraceProto.MAGIC_NUMBER;
import static com.android.server.wm.shell.TransitionTraceProto.MAGIC_NUMBER_H;
import static com.android.server.wm.shell.TransitionTraceProto.MAGIC_NUMBER_L;
import static com.android.server.wm.shell.TransitionTraceProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -37,6 +38,7 @@ import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

/**
 * Helper class to collect and dump transition traces.
@@ -395,6 +397,10 @@ public class TransitionTracer {
        try {
            ProtoOutputStream proto = new ProtoOutputStream();
            proto.write(MAGIC_NUMBER, MAGIC_NUMBER_VALUE);
            long timeOffsetNs =
                    TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis())
                            - SystemClock.elapsedRealtimeNanos();
            proto.write(REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs);
            int pid = android.os.Process.myPid();
            LogAndPrintln.i(pw, "Writing file to " + file.getAbsolutePath()
                    + " from process " + pid);