ISessionController.aidl revision 99c1f9f453b3b589b3f8f2c32ea4f947e309c089
1/* Copyright (C) 2014 The Android Open Source Project
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *      http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package android.media.session;
17
18import android.app.PendingIntent;
19import android.content.Intent;
20import android.content.pm.ParceledListSlice;
21import android.media.MediaDescription;
22import android.media.MediaMetadata;
23import android.media.Rating;
24import android.media.session.ISessionControllerCallback;
25import android.media.session.MediaSession;
26import android.media.session.ParcelableVolumeInfo;
27import android.media.session.PlaybackState;
28import android.net.Uri;
29import android.os.Bundle;
30import android.os.ResultReceiver;
31import android.view.KeyEvent;
32
33import java.util.List;
34
35/**
36 * Interface to a MediaSession in the system.
37 * @hide
38 */
39interface ISessionController {
40    void sendCommand(String command, in Bundle args, in ResultReceiver cb);
41    boolean sendMediaButton(in KeyEvent mediaButton);
42    void registerCallbackListener(in ISessionControllerCallback cb);
43    void unregisterCallbackListener(in ISessionControllerCallback cb);
44    boolean isTransportControlEnabled();
45    String getPackageName();
46    String getTag();
47    PendingIntent getLaunchPendingIntent();
48    long getFlags();
49    ParcelableVolumeInfo getVolumeAttributes();
50    void adjustVolume(int direction, int flags, String packageName);
51    void setVolumeTo(int value, int flags, String packageName);
52    MediaMetadata getMetadata();
53    PlaybackState getPlaybackState();
54    ParceledListSlice getQueue();
55    void addQueueItem(in MediaDescription description);
56    void addQueueItemAt(in MediaDescription description, int index);
57    void removeQueueItem(in MediaDescription description);
58    void removeQueueItemAt(int index);
59
60    CharSequence getQueueTitle();
61    Bundle getExtras();
62    int getRatingType();
63    int getRepeatMode();
64    boolean isShuffleModeEnabled();
65
66    // These commands are for the TransportControls
67    void prepare();
68    void prepareFromMediaId(String mediaId, in Bundle extras);
69    void prepareFromSearch(String string, in Bundle extras);
70    void prepareFromUri(in Uri uri, in Bundle extras);
71    void play();
72    void playFromMediaId(String mediaId, in Bundle extras);
73    void playFromSearch(String string, in Bundle extras);
74    void playFromUri(in Uri uri, in Bundle extras);
75    void skipToQueueItem(long id);
76    void pause();
77    void stop();
78    void next();
79    void previous();
80    void fastForward();
81    void rewind();
82    void seekTo(long pos);
83    void rate(in Rating rating);
84    void repeatMode(int repeatMode);
85    void shuffleMode(boolean enabled);
86    void sendCustomAction(String action, in Bundle args);
87}
88