MediaController2Provider.java revision c3a438f65b24d88059fdc2d5e2432a4cb70e2cfb
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.annotation.NonNull;
20import android.app.PendingIntent;
21import android.media.AudioAttributes;
22import android.media.MediaController2.PlaybackInfo;
23import android.media.MediaItem2;
24import android.media.MediaSession2.Command;
25import android.media.MediaSession2.PlaylistParams;
26import android.media.PlaybackState2;
27import android.media.Rating2;
28import android.media.SessionToken2;
29import android.net.Uri;
30import android.os.Bundle;
31import android.os.ResultReceiver;
32
33import java.util.List;
34
35/**
36 * @hide
37 */
38public interface MediaController2Provider extends TransportControlProvider {
39    void initialize();
40
41    void close_impl();
42    SessionToken2 getSessionToken_impl();
43    boolean isConnected_impl();
44
45    PendingIntent getSessionActivity_impl();
46
47    void setVolumeTo_impl(int value, int flags);
48    void adjustVolume_impl(int direction, int flags);
49    PlaybackInfo getPlaybackInfo_impl();
50
51    void prepareFromUri_impl(Uri uri, Bundle extras);
52    void prepareFromSearch_impl(String query, Bundle extras);
53    void prepareMediaId_impl(String mediaId, Bundle extras);
54    void playFromSearch_impl(String query, Bundle extras);
55    void playFromUri_impl(Uri uri, Bundle extras);
56    void playFromMediaId_impl(String mediaId, Bundle extras);
57
58    void setRating_impl(String mediaId, Rating2 rating);
59    void sendCustomCommand_impl(Command command, Bundle args, ResultReceiver cb);
60    List<MediaItem2> getPlaylist_impl();
61
62    void removePlaylistItem_impl(MediaItem2 index);
63    void addPlaylistItem_impl(int index, MediaItem2 item);
64    void replacePlaylistItem_impl(int index, MediaItem2 item);
65
66    PlaylistParams getPlaylistParams_impl();
67    void setPlaylistParams_impl(PlaylistParams params);
68    PlaybackState2 getPlaybackState_impl();
69    int getPlayerState_impl();
70    long getPosition_impl();
71    float getPlaybackSpeed_impl();
72    long getBufferedPosition_impl();
73    MediaItem2 getCurrentPlaylistItem_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