From 233a1d165f5c2296e39a9b2fe44fc9f8898a0066 Mon Sep 17 00:00:00 2001 From: olly Date: Wed, 1 Nov 2017 11:57:16 -0700 Subject: [PATCH] Explicitly document internal onXError are for reporting only Issue: #3366 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=174214690 --- .../android/exoplayer2/drm/DefaultDrmSessionManager.java | 8 ++++++++ .../source/AdaptiveMediaSourceEventListener.java | 8 ++++++++ .../android/exoplayer2/source/ExtractorMediaSource.java | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java index badacca9ac..08defdccee 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java @@ -24,6 +24,7 @@ import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.text.TextUtils; import com.google.android.exoplayer2.C; +import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.drm.DefaultDrmSession.ProvisioningManager; import com.google.android.exoplayer2.drm.DrmInitData.SchemeData; import com.google.android.exoplayer2.drm.DrmSession.DrmSessionException; @@ -58,6 +59,13 @@ public class DefaultDrmSessionManager implements DrmSe /** * Called when a drm error occurs. + *

+ * This method being called does not indicate that playback has failed, or that it will fail. + * The player may be able to recover from the error and continue. Hence applications should + * not implement this method to display a user visible error or initiate an application + * level retry ({@link Player.EventListener#onPlayerError} is the appropriate place to implement + * such behavior). This method is called to provide the application with an opportunity to log + * the error if it wishes to do so. * * @param e The corresponding exception. */ diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java b/library/core/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java index f97d4a1542..be07cbb5dc 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java @@ -19,6 +19,7 @@ import android.os.Handler; import android.os.SystemClock; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.Format; +import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.upstream.DataSpec; import com.google.android.exoplayer2.util.Assertions; import java.io.IOException; @@ -111,6 +112,13 @@ public interface AdaptiveMediaSourceEventListener { * The error may or may not have resulted in the load being canceled, as indicated by the * {@code wasCanceled} parameter. If the load was canceled, {@link #onLoadCanceled} will * not be called in addition to this method. + *

+ * This method being called does not indicate that playback has failed, or that it will fail. The + * player may be able to recover from the error and continue. Hence applications should + * not implement this method to display a user visible error or initiate an application + * level retry ({@link Player.EventListener#onPlayerError} is the appropriate place to implement + * such behavior). This method is called to provide the application with an opportunity to log the + * error if it wishes to do so. * * @param dataSpec Defines the data being loaded. * @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java index bd407f58f2..1b3f6cb95c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java @@ -19,6 +19,7 @@ import android.net.Uri; import android.os.Handler; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.ExoPlayer; +import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; import com.google.android.exoplayer2.extractor.Extractor; import com.google.android.exoplayer2.extractor.ExtractorsFactory; @@ -47,6 +48,13 @@ public final class ExtractorMediaSource implements MediaSource, ExtractorMediaPe /** * Called when an error occurs loading media data. + *

+ * This method being called does not indicate that playback has failed, or that it will fail. + * The player may be able to recover from the error and continue. Hence applications should + * not implement this method to display a user visible error or initiate an application + * level retry ({@link Player.EventListener#onPlayerError} is the appropriate place to implement + * such behavior). This method is called to provide the application with an opportunity to log + * the error if it wishes to do so. * * @param error The load error. */