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

Commit 33573461 authored by Jaewan Kim's avatar Jaewan Kim
Browse files

MediaSession2: Use Executor for callback handling

This also simplifies future work for adding more functions
Test: Run all MediaComponents test once

Change-Id: I37f1e205f95bcf506df5550c1e65a864e8a9028c
parent ea27314e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ interface IMediaSession2 {
    // send command
    //////////////////////////////////////////////////////////////////////////////////////////////
    oneway void sendCommand(IMediaSession2Callback caller, in Bundle command, in Bundle args);
    oneway void sendTransportControlCommand(IMediaSession2Callback caller,
            int commandCode, long arg);

    Bundle getPlaybackState();

+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ public abstract class MediaPlayerBase {
        void onPlaybackChanged(PlaybackState2 state);
    }

    // Transport controls that session will send command directly to this player.
    public abstract void play();
    public abstract void prepare();
    public abstract void pause();
+3 −0
Original line number Diff line number Diff line
@@ -595,6 +595,9 @@ public class MediaSession2 implements AutoCloseable {

        @Override
        public MediaSession2 build() {
            if (mCallbackExecutor == null) {
                mCallbackExecutor = mContext.getMainExecutor();
            }
            if (mCallback == null) {
                mCallback = new SessionCallback();
            }