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

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

MediaSession2: Clean up TODOs under frameworks/base/media

This CL includes following changes
  - Remove outdated TODOs
  - Added buganizer issue if the remaining work take more than 5m

Test: Run MediaComponents tests
Change-Id: Ie8a005ee74a2959abc6844471f314559b1cfcf49
parent bcc63b14
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ oneway interface IMediaSession2 {
    //////////////////////////////////////////////////////////////////////////////////////////////
    // send command
    //////////////////////////////////////////////////////////////////////////////////////////////
    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,
+3 −3
Original line number Diff line number Diff line
@@ -548,17 +548,17 @@ public class MediaController2Impl implements MediaController2Provider {

    @Override
    public void addPlaylistItem_impl(int index, MediaItem2 item) {
        // TODO(jaewan): Implement
        // TODO(jaewan): Implement (b/73149584)
    }

    @Override
    public void removePlaylistItem_impl(MediaItem2 item) {
        // TODO(jaewan): Implement
        // TODO(jaewan): Implement (b/73149584)
    }

    @Override
    public void replacePlaylistItem_impl(int index, MediaItem2 item) {
        // TODO: Implement this
        // TODO: Implement this (b/73149407)
    }

    @Override
+26 −9
Original line number Diff line number Diff line
@@ -203,13 +203,13 @@ public class MediaSession2Impl implements MediaSession2Provider {
    }

    @Override
    public void setPlayer_impl(MediaPlayerBase player, MediaPlaylistController mpcl,
    public void updatePlayer_impl(MediaPlayerBase player, MediaPlaylistController mpcl,
            VolumeProvider2 volumeProvider) throws IllegalArgumentException {
        ensureCallingThread();
        if (player == null) {
            throw new IllegalArgumentException("player shouldn't be null");
        }

        // TODO(jaewan): Handle mpcl
        setPlayer(player, volumeProvider);
    }

@@ -294,7 +294,11 @@ public class MediaSession2Impl implements MediaSession2Provider {
        return getPlayer();
    }

    // TODO(jaewan): Change this to @NonNull
    @Override
    public VolumeProvider2 getVolumeProvider_impl() {
        return mVolumeProvider;
    }

    @Override
    public SessionToken2 getToken_impl() {
        return mSessionToken;
@@ -859,7 +863,7 @@ public class MediaSession2Impl implements MediaSession2Provider {
    public static class CommandGroupImpl implements CommandGroupProvider {
        private static final String KEY_COMMANDS =
                "android.media.mediasession2.commandgroup.commands";
        private ArraySet<Command> mCommands = new ArraySet<>();
        private List<Command> mCommands = new ArrayList<>();
        private final Context mContext;
        private final CommandGroup mInstance;

@@ -900,13 +904,18 @@ public class MediaSession2Impl implements MediaSession2Provider {
                throw new IllegalArgumentException("Use hasCommand(Command) for custom command");
            }
            for (int i = 0; i < mCommands.size(); i++) {
                if (mCommands.valueAt(i).getCommandCode() == code) {
                if (mCommands.get(i).getCommandCode() == code) {
                    return true;
                }
            }
            return false;
        }

        @Override
        public List<Command> getCommands_impl() {
            return mCommands;
        }

        /**
         * @return new bundle from the CommandGroup
         * @hide
@@ -915,7 +924,7 @@ public class MediaSession2Impl implements MediaSession2Provider {
        public Bundle toBundle_impl() {
            ArrayList<Bundle> list = new ArrayList<>();
            for (int i = 0; i < mCommands.size(); i++) {
                list.add(mCommands.valueAt(i).toBundle());
                list.add(mCommands.get(i).toBundle());
            }
            Bundle bundle = new Bundle();
            bundle.putParcelableArrayList(KEY_COMMANDS, list);
@@ -1010,8 +1019,17 @@ public class MediaSession2Impl implements MediaSession2Provider {
        }

        @Override
        public boolean equals_impl(ControllerInfoProvider obj) {
            return equals(obj);
        public boolean equals_impl(Object obj) {
            if (!(obj instanceof ControllerInfo)) {
                return false;
            }
            return equals(((ControllerInfo) obj).getProvider());
        }

        @Override
        public String toString_impl() {
            return "ControllerInfo {pkg=" + mPackageName + ", uid=" + mUid + ", trusted="
                    + mIsTrusted + "}";
        }

        @Override
@@ -1276,7 +1294,6 @@ public class MediaSession2Impl implements MediaSession2Provider {
         * Constructor.
         *
         * @param context a context
         * @param player a player to handle incoming command from any controller.
         * @throws IllegalArgumentException if any parameter is null, or the player is a
         *      {@link MediaSession2} or {@link MediaController2}.
         */
+0 −6
Original line number Diff line number Diff line
@@ -399,12 +399,6 @@ public class MediaSession2Stub extends IMediaSession2.Stub {
        });
    }

    @Override
    public void sendCommand(IMediaSession2Callback caller, Bundle command, Bundle args)
            throws RuntimeException {
        // TODO(jaewan): Generic command
    }

    @Override
    public void sendTransportControlCommand(IMediaSession2Callback caller,
            int commandCode, Bundle args) throws RuntimeException {
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import android.util.Log;
public class MediaSessionService2Impl implements MediaSessionService2Provider {

    private static final String TAG = "MPSessionService"; // to meet 23 char limit in Log tag
    private static final boolean DEBUG = true; // TODO(jaewan): Change this.
    private static final boolean DEBUG = true; // TODO(jaewan): Change this. (b/74094611)

    private final MediaSessionService2 mInstance;
    private final PlayerEventCallback mCallback = new SessionServiceEventCallback();
Loading