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

Commit d65bb202 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MediaSession2: Implement fastForward() / rewind()" into pi-dev

parents 790befca 83bc984a
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -129,6 +129,33 @@ public abstract class MediaPlayerBase implements AutoCloseable {
     */
    public abstract void seekTo(long pos);

    /**
     * Fast forwards playback. If playback is already fast forwarding this may increase the rate.
     * <p>
     * Default implementation sets the playback speed to the 2.0f
     * @see #setPlaybackSpeed(float)
     * @hide
     */
    // TODO(jaewan): Unhide (b/74724709)
    public void fastForward() {
        setPlaybackSpeed(2.0f);
    }

    /**
     * Rewinds playback. If playback is already rewinding this may increase the rate.
     * <p>
     * Default implementation sets the playback speed to the -1.0f if
     * {@link #isReversePlaybackSupported()} returns {@code true}.
     * @see #setPlaybackSpeed(float)
     * @hide
     */
    // TODO(jaewan): Unhide (b/74724709)
    public void rewind() {
        if (isReversePlaybackSupported()) {
            setPlaybackSpeed(-1.0f);
        }
    }

    public static final long UNKNOWN_TIME = -1;

    /**
+2 −2
Original line number Diff line number Diff line
@@ -1418,14 +1418,14 @@ public class MediaSession2 implements AutoCloseable {
    }

    /**
     * Start fast forwarding. If playback is already fast forwarding this may increase the rate.
     * Fast forwards playback. If playback is already fast forwarding this may increase the rate.
     */
    public void fastForward() {
        mProvider.fastForward_impl();
    }

    /**
     * Start rewinding. If playback is already rewinding this may increase the rate.
     * Rewinds playback. If playback is already rewinding this may increase the rate.
     */
    public void rewind() {
        mProvider.rewind_impl();