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

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

MediaSession2: Implements sendCustomCommand()

Bug: 72543316
Test: Run all MediaComponents tests once
Change-Id: Iad4fff6d6d41fb39f632735244cc7ecbec93fa0f
parent 650fa857
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.media;

import android.media.IMediaSession2Callback;
import android.os.Bundle;
import android.os.ResultReceiver;

/**
 * Interface to MediaSession2. Framework MUST only call oneway APIs.
@@ -42,6 +43,8 @@ oneway interface IMediaSession2 {
    void sendCommand(IMediaSession2Callback caller, in Bundle command, in Bundle args);
    void sendTransportControlCommand(IMediaSession2Callback caller,
            int commandCode, in Bundle args);
    void sendCustomCommand(IMediaSession2Callback caller, in Bundle command, in Bundle args,
            in ResultReceiver receiver);

    //////////////////////////////////////////////////////////////////////////////////////////////
    // Get library service specific
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.media;

import android.os.Bundle;
import android.os.ResultReceiver;
import android.media.session.PlaybackState;
import android.media.IMediaSession2;

@@ -48,6 +49,8 @@ oneway interface IMediaSession2Callback {

    void onCustomLayoutChanged(in List<Bundle> commandButtonlist);

    void sendCustomCommand(in Bundle command, in Bundle args, in ResultReceiver receiver);

    //////////////////////////////////////////////////////////////////////////////////////////////
    // Browser sepcific
    //////////////////////////////////////////////////////////////////////////////////////////////
+10 −0
Original line number Diff line number Diff line
@@ -1425,6 +1425,16 @@ public class MediaSessionService extends SystemService implements Monitor {
                    mUserRecords.valueAt(i).dumpLocked(pw, "");
                }
                mAudioPlayerStateMonitor.dump(getContext(), pw, "");

                // TODO(jaewan): Remove this debug command before ship.
                if (args != null && args.length > 0 && "--purge".equals(args[0])) {
                    mSessions.clear();
                }
                pw.println();
                pw.println("Session2: size=" + mSessions.size());
                for (int i = 0; i < mSessions.size(); i++) {
                    pw.println("  " + mSessions.get(i));
                }
            }
        }