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

Commit 4a7b8642 authored by Jaewan Kim's avatar Jaewan Kim
Browse files

MediaPlayerBase: Add PlayerEventCallback#onSeekCompleted()

PlayerEventCallback#onSeekCompleted() will be called when the
MediaPlayerBase#seekTo() is completed. Following callbacks are also
added to listen the event.
  - SessionCallback#onSeekCompleted()
  - ControllerCallback#onSeekCompleted()

Bug: 74370608
Test: Build
Change-Id: Ib99a3cdfabe34378d0ea6b86a2ae1c9dd99c13c8
parent d5b878d0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -808,6 +808,7 @@ public class MediaController2Impl implements MediaController2Provider {
        });
    }

    // TODO(jaewan): Rename to seek completed
    void pushPositionChanges(final long eventTimeMs, final long positionMs) {
        synchronized (mLock) {
            mPositionEventTimeMs = eventTimeMs;
@@ -817,7 +818,7 @@ public class MediaController2Impl implements MediaController2Provider {
            if (!mInstance.isConnected()) {
                return;
            }
            mCallback.onPositionChanged(mInstance, eventTimeMs, positionMs);
            mCallback.onSeekCompleted(mInstance, positionMs);
        });
    }

+1 −0
Original line number Diff line number Diff line
@@ -926,6 +926,7 @@ public class MediaSession2Stub extends IMediaSession2.Stub {
        });
    }

    // TODO(jaewan): Rename
    public void notifyPositionChangedNotLocked(long eventTimeMs, long positionMs) {
        notifyAll((controller, iController) -> {
            iController.onPositionChanged(eventTimeMs, positionMs);