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

Commit 40b9f096 authored by Calin Juravle's avatar Calin Juravle Committed by Android (Google) Code Review
Browse files

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

parents dd4a89ba edd2c906
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -96,7 +96,8 @@ import java.io.PrintWriter;
 */
public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
  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 long accIntentStartedEvents = 0;

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

  private void logWarningWithStackTrace(String log) {
    if (DEBUG) {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      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));
    }
  }
}