diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index b6079c6ed3..721103a5be 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -398,7 +398,7 @@ import java.util.concurrent.TimeoutException; currentCues = ImmutableList.of(); throwsWhenUsingWrongThread = true; - listeners.add(analyticsCollector); + addListener(analyticsCollector); bandwidthMeter.addEventListener(new Handler(applicationLooper), analyticsCollector); addAudioOffloadListener(componentListener); if (builder.foregroundModeTimeoutMs > 0) { @@ -1382,7 +1382,6 @@ import java.util.concurrent.TimeoutException; this.audioAttributes = audioAttributes; sendRendererMessage(TRACK_TYPE_AUDIO, MSG_SET_AUDIO_ATTRIBUTES, audioAttributes); streamVolumeManager.setStreamType(Util.getStreamTypeForAudioUsage(audioAttributes.usage)); - analyticsCollector.onAudioAttributesChanged(audioAttributes); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onAudioAttributesChanged(audioAttributes); @@ -1420,7 +1419,6 @@ import java.util.concurrent.TimeoutException; this.audioSessionId = audioSessionId; sendRendererMessage(TRACK_TYPE_AUDIO, MSG_SET_AUDIO_SESSION_ID, audioSessionId); sendRendererMessage(TRACK_TYPE_VIDEO, MSG_SET_AUDIO_SESSION_ID, audioSessionId); - analyticsCollector.onAudioSessionIdChanged(audioSessionId); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onAudioSessionIdChanged(audioSessionId); @@ -1448,7 +1446,6 @@ import java.util.concurrent.TimeoutException; } this.volume = volume; sendVolumeToRenderers(); - analyticsCollector.onVolumeChanged(volume); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onVolumeChanged(volume); @@ -2475,7 +2472,6 @@ import java.util.concurrent.TimeoutException; if (width != surfaceWidth || height != surfaceHeight) { surfaceWidth = width; surfaceHeight = height; - analyticsCollector.onSurfaceSizeChanged(width, height); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onSurfaceSizeChanged(width, height); @@ -2489,7 +2485,6 @@ import java.util.concurrent.TimeoutException; } private void notifySkipSilenceEnabledChanged() { - analyticsCollector.onSkipSilenceEnabledChanged(skipSilenceEnabled); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onSkipSilenceEnabledChanged(skipSilenceEnabled); @@ -2688,7 +2683,6 @@ import java.util.concurrent.TimeoutException; @Override public void onVideoSizeChanged(VideoSize videoSize) { ExoPlayerImpl.this.videoSize = videoSize; - analyticsCollector.onVideoSizeChanged(videoSize); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onVideoSizeChanged(videoSize); @@ -2796,7 +2790,6 @@ import java.util.concurrent.TimeoutException; @Override public void onCues(List cues) { currentCues = cues; - analyticsCollector.onCues(cues); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listeners : listenerArraySet) { listeners.onCues(cues); @@ -2807,7 +2800,6 @@ import java.util.concurrent.TimeoutException; @Override public void onMetadata(Metadata metadata) { - analyticsCollector.onMetadata(metadata); ExoPlayerImpl.this.onMetadata(metadata); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { @@ -2905,7 +2897,6 @@ import java.util.concurrent.TimeoutException; DeviceInfo deviceInfo = createDeviceInfo(streamVolumeManager); if (!deviceInfo.equals(ExoPlayerImpl.this.deviceInfo)) { ExoPlayerImpl.this.deviceInfo = deviceInfo; - analyticsCollector.onDeviceInfoChanged(deviceInfo); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onDeviceInfoChanged(deviceInfo); @@ -2915,7 +2906,6 @@ import java.util.concurrent.TimeoutException; @Override public void onStreamVolumeChanged(int streamVolume, boolean streamMuted) { - analyticsCollector.onDeviceVolumeChanged(streamVolume, streamMuted); // TODO(internal b/187152483): Events should be dispatched via ListenerSet for (Listener listener : listenerArraySet) { listener.onDeviceVolumeChanged(streamVolume, streamMuted);