MediaController2Provider.java revision c006dc2a8517f70a8f8f54047b5aa7cc0c4eb5ac
1/* 2 * Copyright 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.media.update; 18 19import android.app.PendingIntent; 20import android.media.AudioAttributes; 21import android.media.MediaController2.PlaybackInfo; 22import android.media.MediaItem2; 23import android.media.MediaMetadata2; 24import android.media.MediaSession2.Command; 25import android.media.MediaSession2.PlaylistParams; 26import android.media.Rating2; 27import android.media.SessionToken2; 28import android.net.Uri; 29import android.os.Bundle; 30import android.os.ResultReceiver; 31 32import java.util.List; 33 34/** 35 * @hide 36 */ 37public interface MediaController2Provider extends TransportControlProvider { 38 void initialize(); 39 40 void close_impl(); 41 SessionToken2 getSessionToken_impl(); 42 boolean isConnected_impl(); 43 44 PendingIntent getSessionActivity_impl(); 45 46 void setVolumeTo_impl(int value, int flags); 47 void adjustVolume_impl(int direction, int flags); 48 PlaybackInfo getPlaybackInfo_impl(); 49 50 void prepareFromUri_impl(Uri uri, Bundle extras); 51 void prepareFromSearch_impl(String query, Bundle extras); 52 void prepareFromMediaId_impl(String mediaId, Bundle extras); 53 void playFromSearch_impl(String query, Bundle extras); 54 void playFromUri_impl(Uri uri, Bundle extras); 55 void playFromMediaId_impl(String mediaId, Bundle extras); 56 57 void setRating_impl(String mediaId, Rating2 rating); 58 void sendCustomCommand_impl(Command command, Bundle args, ResultReceiver cb); 59 List<MediaItem2> getPlaylist_impl(); 60 void setPlaylist_impl(List<MediaItem2> list, MediaMetadata2 metadata); 61 MediaMetadata2 getPlaylistMetadata_impl(); 62 void updatePlaylistMetadata_impl(MediaMetadata2 metadata); 63 64 void addPlaylistItem_impl(int index, MediaItem2 item); 65 void replacePlaylistItem_impl(int index, MediaItem2 item); 66 void removePlaylistItem_impl(MediaItem2 item); 67 68 PlaylistParams getPlaylistParams_impl(); 69 void setPlaylistParams_impl(PlaylistParams params); 70 int getPlayerState_impl(); 71 long getPosition_impl(); 72 float getPlaybackSpeed_impl(); 73 long getBufferedPosition_impl(); 74 MediaItem2 getCurrentMediaItem_impl(); 75 76 interface PlaybackInfoProvider { 77 int getPlaybackType_impl(); 78 AudioAttributes getAudioAttributes_impl(); 79 int getControlType_impl(); 80 int getMaxVolume_impl(); 81 int getCurrentVolume_impl(); 82 } 83} 84