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

Commit 00715bc4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "session2_playlist_add_remove"

* changes:
  MediaSession2: Add listeners for change in session token
  MediaSession2: Add from add/remove an item from playlist
parents 7933daec 379e30d9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -419,9 +419,9 @@ java_library {
        "location/java/android/location/IGpsGeofenceHardware.aidl",
        "location/java/android/location/INetInitiatedListener.aidl",
        "location/java/com/android/internal/location/ILocationProvider.aidl",
        "media/java/android/media/IAudioService.aidl",
        "media/java/android/media/IAudioFocusDispatcher.aidl",
        "media/java/android/media/IAudioRoutesObserver.aidl",
        "media/java/android/media/IAudioService.aidl",
        "media/java/android/media/IMediaHTTPConnection.aidl",
        "media/java/android/media/IMediaHTTPService.aidl",
        "media/java/android/media/IMediaResourceMonitor.aidl",
@@ -432,6 +432,7 @@ java_library {
        "media/java/android/media/IMediaSession2.aidl",
        "media/java/android/media/IMediaSession2Callback.aidl",
        "media/java/android/media/IPlaybackConfigDispatcher.aidl",
        "media/java/android/media/ISessionTokensListener.aidl",
        ":libaudioclient_aidl",
        "media/java/android/media/IRecordingConfigDispatcher.aidl",
        "media/java/android/media/IRemoteDisplayCallback.aidl",
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media;

import android.os.Bundle;

/**
 * Listens for changes to the list of session tokens.
 * @hide
 */
oneway interface ISessionTokensListener {
    void onSessionTokensChanged(in List<Bundle> tokens);
}
+3 −0
Original line number Diff line number Diff line
@@ -65,6 +65,9 @@ public interface MediaPlayerInterface {
    AudioAttributes getAudioAttributes();

    void setPlaylist(List<MediaItem2> list, PlaylistParams param);
    void addPlaylistItem(int index, MediaItem2 item);
    void removePlaylistItem(MediaItem2 item);

    List<MediaItem2> getPlaylist();

    void setCurrentPlaylistItem(int index);
+10 −0
Original line number Diff line number Diff line
@@ -116,6 +116,16 @@ public class SessionPlayer2 implements MediaPlayerInterface {
        mProvider.setPlaylistParams_impl(params);
    }

    @Override
    public void addPlaylistItem(int index, MediaItem2 item) {
        mProvider.addPlaylistItem_impl(index, item);
    }

    @Override
    public void removePlaylistItem(MediaItem2 item) {
        mProvider.removePlaylistItem_impl(item);
    }

    @Override
    public PlaylistParams getPlaylistParams() {
        return mProvider.getPlaylistParams_impl();
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.media.session;
import android.content.ComponentName;
import android.media.IRemoteVolumeController;
import android.media.IMediaSession2;
import android.media.ISessionTokensListener;
import android.media.session.IActiveSessionsListener;
import android.media.session.ICallback;
import android.media.session.IOnMediaKeyListener;
@@ -55,4 +56,8 @@ interface ISessionManager {
    boolean onSessionCreated(in Bundle sessionToken);
    void onSessionDestroyed(in Bundle sessionToken);
    List<Bundle> getSessionTokens(boolean activeSessionOnly, boolean sessionServiceOnly);

    void addSessionTokensListener(in ISessionTokensListener listener, int userId,
            String packageName);
    void removeSessionTokensListener(in ISessionTokensListener listener);
}
Loading