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

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

MediaController: Remove unused constructors

Bug: 123488663
Test: Build
Change-Id: I6bda318c5d8a83c4f833fe737a7b68229933c0b9
parent 817f5f85
Loading
Loading
Loading
Loading
+14 −30
Original line number Diff line number Diff line
@@ -81,35 +81,6 @@ public final class MediaController {

    private final TransportControls mTransportControls;

    /**
     * Call for creating a MediaController directly from a controller link. Should only
     * be used by framework code.
     * @hide
     */
    public MediaController(Context context, ControllerLink sessionBinder) {
        if (sessionBinder == null) {
            throw new IllegalArgumentException("Session token cannot be null");
        }
        if (context == null) {
            throw new IllegalArgumentException("Context cannot be null");
        }
        mSessionBinder = sessionBinder;
        mTransportControls = new TransportControls();
        mToken = new MediaSession.Token(sessionBinder);
        mContext = context;
        mCbStub = new ControllerCallbackLink(context, new CallbackStub(this));
    }

    /**
     * Call for creating a MediaController directly from a binder. Should only
     * be used by framework code.
     * @hide
     * TODO: remove this constructor
     */
    public MediaController(Context context, ISessionController sessionBinder) {
        this(context, new ControllerLink(sessionBinder.asBinder()));
    }

    /**
     * Create a new MediaController from a session's token.
     *
@@ -117,7 +88,20 @@ public final class MediaController {
     * @param token The token for the session.
     */
    public MediaController(@NonNull Context context, @NonNull MediaSession.Token token) {
        this(context, token.getControllerLink());
        if (context == null) {
            throw new IllegalArgumentException("context shouldn't be null");
        }
        if (token == null) {
            throw new IllegalArgumentException("token shouldn't be null");
        }
        if (token.getControllerLink() == null) {
            throw new IllegalArgumentException("token.getControllerLink() shouldn't be null");
        }
        mSessionBinder = token.getControllerLink();
        mTransportControls = new TransportControls();
        mToken = token;
        mContext = context;
        mCbStub = new ControllerCallbackLink(context, new CallbackStub(this));
    }

    /**