Rename AnalyticsListener.onAudioSessionId for consistency

PiperOrigin-RevId: 351687086
This commit is contained in:
olly 2021-01-14 00:18:06 +00:00 committed by Ian Baker
parent adb9dcb43f
commit 6084a552a9
5 changed files with 8 additions and 8 deletions

View File

@ -152,8 +152,8 @@
which can be immediately queried by calling which can be immediately queried by calling
`SimpleExoPlayer.getAudioSessionId`. The audio session ID will only `SimpleExoPlayer.getAudioSessionId`. The audio session ID will only
change if application code calls `SimpleExoPlayer.setAudioSessionId`. change if application code calls `SimpleExoPlayer.setAudioSessionId`.
* `AudioListener.onAudioSessionId` is replaced with * `onAudioSessionId` is replaced with `onAudioSessionIdChanged` in
`AudioListener.onAudioSessionIdChanged`. Note that `AudioListener` and `AnalyticsListener`. Note that
`onAudioSessionIdChanged` is called in fewer cases than `onAudioSessionIdChanged` is called in fewer cases than
`onAudioSessionId` was called, due to the improved handling of audio `onAudioSessionId` was called, due to the improved handling of audio
session IDs as described above. session IDs as described above.

View File

@ -305,7 +305,7 @@ public class AnalyticsCollector
sendEvent( sendEvent(
eventTime, eventTime,
AnalyticsListener.EVENT_AUDIO_SESSION_ID, AnalyticsListener.EVENT_AUDIO_SESSION_ID,
listener -> listener.onAudioSessionId(eventTime, audioSessionId)); listener -> listener.onAudioSessionIdChanged(eventTime, audioSessionId));
} }
@Override @Override

View File

@ -805,12 +805,12 @@ public interface AnalyticsListener {
default void onAudioDisabled(EventTime eventTime, DecoderCounters counters) {} default void onAudioDisabled(EventTime eventTime, DecoderCounters counters) {}
/** /**
* Called when the audio session id is set. * Called when the audio session ID changes.
* *
* @param eventTime The event time. * @param eventTime The event time.
* @param audioSessionId The audio session id. * @param audioSessionId The audio session ID.
*/ */
default void onAudioSessionId(EventTime eventTime, int audioSessionId) {} default void onAudioSessionIdChanged(EventTime eventTime, int audioSessionId) {}
/** /**
* Called when the audio attributes change. * Called when the audio attributes change.

View File

@ -353,7 +353,7 @@ public class EventLogger implements AnalyticsListener {
} }
@Override @Override
public void onAudioSessionId(EventTime eventTime, int audioSessionId) { public void onAudioSessionIdChanged(EventTime eventTime, int audioSessionId) {
logd(eventTime, "audioSessionId", Integer.toString(audioSessionId)); logd(eventTime, "audioSessionId", Integer.toString(audioSessionId));
} }

View File

@ -2199,7 +2199,7 @@ public final class AnalyticsCollectorTest {
} }
@Override @Override
public void onAudioSessionId(EventTime eventTime, int audioSessionId) { public void onAudioSessionIdChanged(EventTime eventTime, int audioSessionId) {
reportedEvents.add(new ReportedEvent(EVENT_AUDIO_SESSION_ID, eventTime)); reportedEvents.add(new ReportedEvent(EVENT_AUDIO_SESSION_ID, eventTime));
} }