From 91c52a473007f60f3d1b8df8dc9d78a46b5c7e30 Mon Sep 17 00:00:00 2001 From: olly Date: Mon, 29 Jan 2018 01:29:57 -0800 Subject: [PATCH] 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 --- .../google/android/exoplayer2/testutil/Action.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/Action.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/Action.java index 9cd65fc7fe..1b3639788e 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/Action.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/Action.java @@ -16,6 +16,7 @@ package com.google.android.exoplayer2.testutil; import android.os.Handler; +import android.support.annotation.Nullable; import android.util.Log; import android.view.Surface; import com.google.android.exoplayer2.C; @@ -40,13 +41,14 @@ import com.google.android.exoplayer2.util.HandlerWrapper; public abstract class Action { private final String tag; - private final String description; + private final @Nullable String description; /** * @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.description = description; } @@ -66,7 +68,9 @@ public abstract class Action { Surface surface, HandlerWrapper handler, ActionNode nextAction) { - Log.i(tag, description); + if (description != null) { + Log.i(tag, description); + } doActionAndScheduleNextImpl(player, trackSelector, surface, handler, nextAction); }