2 * Copyright 2018 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.media.update;
19 import android.media.MediaItem2;
20 import android.media.MediaPlayerInterface;
21 import android.media.MediaPlayerInterface.PlaybackListener;
22 import android.media.MediaSession2.Command;
23 import android.media.MediaSession2.CommandButton;
24 import android.media.MediaSession2.CommandGroup;
25 import android.media.MediaSession2.ControllerInfo;
26 import android.media.MediaSession2.PlaylistParams;
27 import android.media.SessionToken2;
28 import android.media.VolumeProvider;
29 import android.os.Bundle;
30 import android.os.ResultReceiver;
32 import java.util.List;
33 import java.util.concurrent.Executor;
39 public interface MediaSession2Provider extends TransportControlProvider {
43 void setPlayer_impl(MediaPlayerInterface player);
44 void setPlayer_impl(MediaPlayerInterface player, VolumeProvider volumeProvider);
45 MediaPlayerInterface getPlayer_impl();
46 SessionToken2 getToken_impl();
47 List<ControllerInfo> getConnectedControllers_impl();
48 void setCustomLayout_impl(ControllerInfo controller, List<CommandButton> layout);
49 void setAudioFocusRequest_impl(int focusGain);
51 void setAllowedCommands_impl(ControllerInfo controller, CommandGroup commands);
52 void notifyMetadataChanged_impl();
53 void sendCustomCommand_impl(ControllerInfo controller, Command command, Bundle args,
54 ResultReceiver receiver);
55 void sendCustomCommand_impl(Command command, Bundle args);
56 void setPlaylist_impl(List<MediaItem2> playlist);
57 List<MediaItem2> getPlaylist_impl();
58 void setPlaylistParams_impl(PlaylistParams params);
59 PlaylistParams getPlaylistParams_impl();
61 void addPlaybackListener_impl(Executor executor, PlaybackListener listener);
62 void removePlaybackListener_impl(PlaybackListener listener);
64 interface CommandProvider {
65 int getCommandCode_impl();
66 String getCustomCommand_impl();
67 Bundle getExtra_impl();
68 Bundle toBundle_impl();
70 boolean equals_impl(Object ob);
74 interface CommandGroupProvider {
75 void addCommand_impl(Command command);
76 void addAllPredefinedCommands_impl();
77 void removeCommand_impl(Command command);
78 boolean hasCommand_impl(Command command);
79 boolean hasCommand_impl(int code);
80 Bundle toBundle_impl();
83 interface ControllerInfoProvider {
84 String getPackageName_impl();
86 boolean isTrusted_impl();
88 boolean equals_impl(ControllerInfoProvider obj);