MediaController2Provider.java revision a2be62f25b8b9504c773156f062a8ae0fc02e678
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.SystemApi;
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    int getRatingType_impl();
47
48    void setVolumeTo_impl(int value, int flags);
49    void adjustVolume_impl(int direction, int flags);
50    PlaybackInfo getPlaybackInfo_impl();
51
52    void prepareFromUri_impl(Uri uri, Bundle extras);
53    void prepareFromSearch_impl(String query, Bundle extras);
54    void prepareMediaId_impl(String mediaId, Bundle extras);
55    void playFromSearch_impl(String query, Bundle extras);
56    void playFromUri_impl(Uri uri, Bundle extras);
57    void playFromMediaId_impl(String mediaId, Bundle extras);
58
59    void setRating_impl(String mediaId, Rating2 rating);
60    void sendCustomCommand_impl(Command command, Bundle args, ResultReceiver cb);
61    List<MediaItem2> getPlaylist_impl();
62
63    void removePlaylistItem_impl(MediaItem2 index);
64    void addPlaylistItem_impl(int index, MediaItem2 item);
65
66    PlaylistParams getPlaylistParams_impl();
67    void setPlaylistParams_impl(PlaylistParams params);
68    PlaybackState2 getPlaybackState_impl();
69
70    interface PlaybackInfoProvider {
71        int getPlaybackType_impl();
72        AudioAttributes getAudioAttributes_impl();
73        int getControlType_impl();
74        int getMaxVolume_impl();
75        int getCurrentVolume_impl();
76    }
77}
78