Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec75d51e authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

VideoView2: Remove setRouteAttributes

Being consistent, create route player internally and do not expose it
since VideoView2 creats a MediaPlayer inside and do not expose it.

Bug: 72527212
Test: manually with VideoViewTest
Change-Id: I6db3bc668f6ab77587fed49b2d34611bc3c30465
parent 525c88c2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -176,6 +176,7 @@ public class MediaControlView2 extends ViewGroupHelper<MediaControlView2Provider
     * @hide TODO: remove once the implementation is revised
     */
    public void setController(MediaController controller) {
        mProvider.setController_impl(controller);
    }

    /**
+0 −36
Original line number Diff line number Diff line
@@ -26,10 +26,8 @@ import android.media.DataSourceDesc;
import android.media.MediaItem2;
import android.media.MediaMetadata2;
import android.media.MediaPlayer2;
import android.media.MediaPlayerBase;
import android.media.SessionToken2;
import android.media.session.MediaController;
import android.media.session.MediaSession;
import android.media.session.PlaybackState;
import android.media.update.ApiLoader;
import android.media.update.VideoView2Provider;
@@ -279,40 +277,6 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> {
        mProvider.setAudioAttributes_impl(attributes);
    }

    // TODO: unhide this method when MediaPlayerInterface became unhidden.
    /**
     * Sets a remote player for handling playback of the selected route from MediaControlView2.
     * If this is not called, MediaCotrolView2 will not show the route button.
     *
     * @param routeCategories        the list of media control categories in
     *                               {@link android.support.v7.media.MediaControlIntent}
     * @param player                 the player to handle playback of the selected route.
     *                               If null, a default route player will be used.
     * @throws IllegalStateException if MediaControlView2 is not set.
     * @hide
     */
    public void setRouteAttributes(@NonNull List<String> routeCategories,
            @Nullable MediaPlayerBase player) {
        mProvider.setRouteAttributes_impl(routeCategories, player);
    }

    /**
     * Sets a remote player for handling playback of the selected route from MediaControlView2.
     * If this is not called, MediaCotrolView2 will not show the route button.
     *
     * @param routeCategories        the list of media control categories in
     *                               {@link android.support.v7.media.MediaControlIntent}
     * @param sessionPlayer          the player to handle playback of the selected route.
     *                               If null, a default route player will be used.
     * @throws IllegalStateException if MediaControlView2 is not set.
     * @hide
     */
    // TODO: Use MediaPlayerBase once MediaSession2 APIs are ready.
    public void setRouteAttributes(@NonNull List<String> routeCategories,
            @Nullable MediaSession.Callback sessionPlayer) {
        mProvider.setRouteAttributes_impl(routeCategories, sessionPlayer);
    }

    /**
     * Sets video path.
     *
+0 −13
Original line number Diff line number Diff line
@@ -69,19 +69,6 @@ public interface VideoView2Provider extends ViewGroupProvider {
    void setSpeed_impl(float speed);
    void setAudioFocusRequest_impl(int focusGain);
    void setAudioAttributes_impl(AudioAttributes attributes);
    /**
     * @hide
     */
    void setRouteAttributes_impl(List<String> routeCategories, MediaPlayerBase player);
    /**
     * @hide
     */
    // TODO: remove setRouteAttributes_impl with MediaSession.Callback once MediaSession2 is ready.
    void setRouteAttributes_impl(List<String> routeCategories, MediaSession.Callback sessionPlayer);

    /**
     * @hide TODO: remove
     */
    void setVideoPath_impl(String path);
    /**
     * @hide TODO: remove