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 { initialize()37 void initialize(); 38 close_impl()39 void close_impl(); getSessionToken_impl()40 SessionToken2 getSessionToken_impl(); isConnected_impl()41 boolean isConnected_impl(); 42 getSessionActivity_impl()43 PendingIntent getSessionActivity_impl(); 44 setVolumeTo_impl(int value, int flags)45 void setVolumeTo_impl(int value, int flags); adjustVolume_impl(int direction, int flags)46 void adjustVolume_impl(int direction, int flags); getPlaybackInfo_impl()47 PlaybackInfo getPlaybackInfo_impl(); 48 prepareFromUri_impl(Uri uri, Bundle extras)49 void prepareFromUri_impl(Uri uri, Bundle extras); prepareFromSearch_impl(String query, Bundle extras)50 void prepareFromSearch_impl(String query, Bundle extras); prepareFromMediaId_impl(String mediaId, Bundle extras)51 void prepareFromMediaId_impl(String mediaId, Bundle extras); playFromSearch_impl(String query, Bundle extras)52 void playFromSearch_impl(String query, Bundle extras); playFromUri_impl(Uri uri, Bundle extras)53 void playFromUri_impl(Uri uri, Bundle extras); playFromMediaId_impl(String mediaId, Bundle extras)54 void playFromMediaId_impl(String mediaId, Bundle extras); fastForward_impl()55 void fastForward_impl(); rewind_impl()56 void rewind_impl(); 57 setRating_impl(String mediaId, Rating2 rating)58 void setRating_impl(String mediaId, Rating2 rating); sendCustomCommand_impl(SessionCommand2 command, Bundle args, ResultReceiver cb)59 void sendCustomCommand_impl(SessionCommand2 command, Bundle args, ResultReceiver cb); getPlaylist_impl()60 List<MediaItem2> getPlaylist_impl(); setPlaylist_impl(List<MediaItem2> list, MediaMetadata2 metadata)61 void setPlaylist_impl(List<MediaItem2> list, MediaMetadata2 metadata); getPlaylistMetadata_impl()62 MediaMetadata2 getPlaylistMetadata_impl(); updatePlaylistMetadata_impl(MediaMetadata2 metadata)63 void updatePlaylistMetadata_impl(MediaMetadata2 metadata); 64 addPlaylistItem_impl(int index, MediaItem2 item)65 void addPlaylistItem_impl(int index, MediaItem2 item); replacePlaylistItem_impl(int index, MediaItem2 item)66 void replacePlaylistItem_impl(int index, MediaItem2 item); removePlaylistItem_impl(MediaItem2 item)67 void removePlaylistItem_impl(MediaItem2 item); 68 getPlayerState_impl()69 int getPlayerState_impl(); getCurrentPosition_impl()70 long getCurrentPosition_impl(); getPlaybackSpeed_impl()71 float getPlaybackSpeed_impl(); getBufferedPosition_impl()72 long getBufferedPosition_impl(); getCurrentMediaItem_impl()73 MediaItem2 getCurrentMediaItem_impl(); 74 75 interface PlaybackInfoProvider { getPlaybackType_impl()76 int getPlaybackType_impl(); getAudioAttributes_impl()77 AudioAttributes getAudioAttributes_impl(); getControlType_impl()78 int getControlType_impl(); getMaxVolume_impl()79 int getMaxVolume_impl(); getCurrentVolume_impl()80 int getCurrentVolume_impl(); 81 } 82 } 83