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

Commit f9671d38 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "EventSequenceValidator: Only record the debug log in debugging level."...

Merge "EventSequenceValidator: Only record the debug log in debugging level." into rvc-qpr-dev am: 8945f5c9

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

Change-Id: I5daf44d17947284e87b858a41e84891f348f7389
parents de470e25 8945f5c9
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -96,7 +96,8 @@ import java.io.PrintWriter;
 */
 */
public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
  static final String TAG = "EventSequenceValidator";
  static final String TAG = "EventSequenceValidator";

  /** $> adb shell 'setprop log.tag.EventSequenceValidator VERBOSE' */
  public static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
  private State state = State.INIT;
  private State state = State.INIT;
  private long accIntentStartedEvents = 0;
  private long accIntentStartedEvents = 0;


@@ -255,9 +256,11 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
  }
  }


  private void logWarningWithStackTrace(String log) {
  private void logWarningWithStackTrace(String log) {
    if (DEBUG) {
      StringWriter sw = new StringWriter();
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      PrintWriter pw = new PrintWriter(sw);
      new Throwable("EventSequenceValidator#getStackTrace").printStackTrace(pw);
      new Throwable("EventSequenceValidator#getStackTrace").printStackTrace(pw);
    Log.d(TAG, String.format("%s\n%s", log, sw));
      Log.wtf(TAG, String.format("%s\n%s", log, sw));
    }
  }
  }
}
}