Suppress logging for BufferLengthLogAction

It's really spammy. Decided not to document tag as also
being nullable in case we ever use it for anything else
in the base action class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183632944
This commit is contained in:
olly 2018-01-29 01:29:57 -08:00 committed by Oliver Woodman
parent f6541b498a
commit 91c52a4730

View File

@ -16,6 +16,7 @@
package com.google.android.exoplayer2.testutil; package com.google.android.exoplayer2.testutil;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable;
import android.util.Log; import android.util.Log;
import android.view.Surface; import android.view.Surface;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
@ -40,13 +41,14 @@ import com.google.android.exoplayer2.util.HandlerWrapper;
public abstract class Action { public abstract class Action {
private final String tag; private final String tag;
private final String description; private final @Nullable String description;
/** /**
* @param tag A tag to use for logging. * @param tag A tag to use for logging.
* @param description A description to be logged when the action is executed. * @param description A description to be logged when the action is executed, or null if no
* logging is required.
*/ */
public Action(String tag, String description) { public Action(String tag, @Nullable String description) {
this.tag = tag; this.tag = tag;
this.description = description; this.description = description;
} }
@ -66,7 +68,9 @@ public abstract class Action {
Surface surface, Surface surface,
HandlerWrapper handler, HandlerWrapper handler,
ActionNode nextAction) { ActionNode nextAction) {
if (description != null) {
Log.i(tag, description); Log.i(tag, description);
}
doActionAndScheduleNextImpl(player, trackSelector, surface, handler, nextAction); doActionAndScheduleNextImpl(player, trackSelector, surface, handler, nextAction);
} }