Loading core/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -42206,7 +42206,7 @@ package android.service.media { method public abstract void onLoadChildren(@NonNull String, @NonNull android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>); method public void onLoadChildren(@NonNull String, @NonNull android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>, @NonNull android.os.Bundle); method public void onLoadItem(String, android.service.media.MediaBrowserService.Result<android.media.browse.MediaBrowser.MediaItem>); method public void setSessionToken(android.media.session.MediaSession.Token); method public void setSessionToken(@Nullable android.media.session.MediaSession.Token); field public static final String SERVICE_INTERFACE = "android.media.browse.MediaBrowserService"; } media/java/android/service/media/MediaBrowserService.java +9 −10 Original line number Diff line number Diff line Loading @@ -43,8 +43,6 @@ import android.util.ArrayMap; import android.util.Log; import android.util.Pair; import com.android.media.flags.Flags; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.annotation.Retention; Loading Loading @@ -446,18 +444,19 @@ public abstract class MediaBrowserService extends Service { * Call to set the media session. * * <p>This should be called as soon as possible during the service's startup. It may only be * called once. * called once with a non-null session token. * * <p>Passing null as the token removes the current association with a {@link MediaSession} and * disconnects all existing {@link MediaBrowser} instances. * * @param token The token for the service's {@link MediaSession}. * @param token The token for the service's {@link MediaSession}, or null to remove the existing * {@link MediaSession} from the service and disconnect all connected {@link MediaBrowser} * instances. */ // TODO: b/185136506 - Update the javadoc to reflect API changes when // enableNullSessionInMediaBrowserService makes it to nextfood. public void setSessionToken(final MediaSession.Token token) { public void setSessionToken(@Nullable final MediaSession.Token token) { ServiceState serviceState = mServiceState.get(); if (token == null) { if (!Flags.enableNullSessionInMediaBrowserService()) { throw new IllegalArgumentException("Session token may not be null."); } else if (serviceState.mSession != null) { if (serviceState.mSession != null) { ServiceState newServiceState = new ServiceState(); mBinder.setServiceState(newServiceState); mServiceState.set(newServiceState); Loading Loading
core/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -42206,7 +42206,7 @@ package android.service.media { method public abstract void onLoadChildren(@NonNull String, @NonNull android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>); method public void onLoadChildren(@NonNull String, @NonNull android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>, @NonNull android.os.Bundle); method public void onLoadItem(String, android.service.media.MediaBrowserService.Result<android.media.browse.MediaBrowser.MediaItem>); method public void setSessionToken(android.media.session.MediaSession.Token); method public void setSessionToken(@Nullable android.media.session.MediaSession.Token); field public static final String SERVICE_INTERFACE = "android.media.browse.MediaBrowserService"; }
media/java/android/service/media/MediaBrowserService.java +9 −10 Original line number Diff line number Diff line Loading @@ -43,8 +43,6 @@ import android.util.ArrayMap; import android.util.Log; import android.util.Pair; import com.android.media.flags.Flags; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.annotation.Retention; Loading Loading @@ -446,18 +444,19 @@ public abstract class MediaBrowserService extends Service { * Call to set the media session. * * <p>This should be called as soon as possible during the service's startup. It may only be * called once. * called once with a non-null session token. * * <p>Passing null as the token removes the current association with a {@link MediaSession} and * disconnects all existing {@link MediaBrowser} instances. * * @param token The token for the service's {@link MediaSession}. * @param token The token for the service's {@link MediaSession}, or null to remove the existing * {@link MediaSession} from the service and disconnect all connected {@link MediaBrowser} * instances. */ // TODO: b/185136506 - Update the javadoc to reflect API changes when // enableNullSessionInMediaBrowserService makes it to nextfood. public void setSessionToken(final MediaSession.Token token) { public void setSessionToken(@Nullable final MediaSession.Token token) { ServiceState serviceState = mServiceState.get(); if (token == null) { if (!Flags.enableNullSessionInMediaBrowserService()) { throw new IllegalArgumentException("Session token may not be null."); } else if (serviceState.mSession != null) { if (serviceState.mSession != null) { ServiceState newServiceState = new ServiceState(); mBinder.setServiceState(newServiceState); mServiceState.set(newServiceState); Loading