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 17 package android.media.update; 18 19 import android.app.PendingIntent; 20 import android.media.AudioAttributes; 21 import android.media.MediaController2.PlaybackInfo; 22 import android.media.MediaItem2; 23 import android.media.MediaMetadata2; 24 import android.media.SessionCommand2; 25 import android.media.Rating2; 26 import android.media.SessionToken2; 27 import android.net.Uri; 28 import android.os.Bundle; 29 import android.os.ResultReceiver; 30 31 import java.util.List; 32 33 /** 34 * @hide 35 */ 36 public interface MediaController2Provider extends TransportControlProvider { 37 void initialize(); 38 39 void close_impl(); 40 SessionToken2 getSessionToken_impl(); 41 boolean isConnected_impl(); 42 43 PendingIntent getSessionActivity_impl(); 44 45 void setVolumeTo_impl(int value, int flags); 46 void adjustVolume_impl(int direction, int flags); 47 PlaybackInfo getPlaybackInfo_impl(); 48 49 void prepareFromUri_impl(Uri uri, Bundle extras); 50 void prepareFromSearch_impl(String query, Bundle extras); 51 void prepareFromMediaId_impl(String mediaId, Bundle extras); 52 void playFromSearch_impl(String query, Bundle extras); 53 void playFromUri_impl(Uri uri, Bundle extras); 54 void playFromMediaId_impl(String mediaId, Bundle extras); 55 void fastForward_impl(); 56 void rewind_impl(); 57 58 void setRating_impl(String mediaId, Rating2 rating); 59 void sendCustomCommand_impl(SessionCommand2 command, Bundle args, ResultReceiver cb); 60 List<MediaItem2> getPlaylist_impl(); 61 void setPlaylist_impl(List<MediaItem2> list, MediaMetadata2 metadata); 62 MediaMetadata2 getPlaylistMetadata_impl(); 63 void updatePlaylistMetadata_impl(MediaMetadata2 metadata); 64 65 void addPlaylistItem_impl(int index, MediaItem2 item); 66 void replacePlaylistItem_impl(int index, MediaItem2 item); 67 void removePlaylistItem_impl(MediaItem2 item); 68 69 int getPlayerState_impl(); 70 long getCurrentPosition_impl(); 71 float getPlaybackSpeed_impl(); 72 long getBufferedPosition_impl(); 73 MediaItem2 getCurrentMediaItem_impl(); 74 75 interface PlaybackInfoProvider { 76 int getPlaybackType_impl(); 77 AudioAttributes getAudioAttributes_impl(); 78 int getControlType_impl(); 79 int getMaxVolume_impl(); 80 int getCurrentVolume_impl(); 81 } 82 } 83