From 1fb105bbb2bef0f543eb5e2bd909dddef623d420 Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 6 Jun 2019 01:00:22 +0100 Subject: [PATCH] Attach timestamp to ExoPlaybackException PiperOrigin-RevId: 251748542 --- .../com/google/android/exoplayer2/ExoPlaybackException.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java index b5f8f954bb..49aacd9638 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java @@ -15,6 +15,7 @@ */ package com.google.android.exoplayer2; +import android.os.SystemClock; import androidx.annotation.IntDef; import androidx.annotation.Nullable; import com.google.android.exoplayer2.source.MediaSource; @@ -73,6 +74,9 @@ public final class ExoPlaybackException extends Exception { */ public final int rendererIndex; + /** The value of {@link SystemClock#elapsedRealtime()} when this exception was created. */ + public final long timestampMs; + @Nullable private final Throwable cause; /** @@ -131,6 +135,7 @@ public final class ExoPlaybackException extends Exception { this.type = type; this.cause = cause; this.rendererIndex = rendererIndex; + timestampMs = SystemClock.elapsedRealtime(); } private ExoPlaybackException(@Type int type, String message) { @@ -138,6 +143,7 @@ public final class ExoPlaybackException extends Exception { this.type = type; rendererIndex = C.INDEX_UNSET; cause = null; + timestampMs = SystemClock.elapsedRealtime(); } /**