ISessionController.aidl revision d133303a5c3eaddcc5dd5b01f03916d754efaa8a
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.MediaMetadata;
22import android.media.Rating;
23import android.media.routing.IMediaRouterDelegate;
24import android.media.routing.IMediaRouterStateCallback;
25import android.media.session.ISessionControllerCallback;
26import android.media.session.ParcelableVolumeInfo;
27import android.media.session.PlaybackState;
28import android.media.session.MediaSession;
29import android.net.Uri;
30import android.os.Bundle;
31import android.os.ResultReceiver;
32import android.view.KeyEvent;
33
34import java.util.List;
35
36/**
37 * Interface to a MediaSession in the system.
38 * @hide
39 */
40interface ISessionController {
41    void sendCommand(String command, in Bundle args, in ResultReceiver cb);
42    boolean sendMediaButton(in KeyEvent mediaButton);
43    void registerCallbackListener(in ISessionControllerCallback cb);
44    void unregisterCallbackListener(in ISessionControllerCallback cb);
45    boolean isTransportControlEnabled();
46    String getPackageName();
47    String getTag();
48    PendingIntent getLaunchPendingIntent();
49    long getFlags();
50    ParcelableVolumeInfo getVolumeAttributes();
51    void adjustVolume(int direction, int flags, String packageName);
52    void setVolumeTo(int value, int flags, String packageName);
53
54    IMediaRouterDelegate createMediaRouterDelegate(IMediaRouterStateCallback callback);
55
56    // These commands are for the TransportControls
57    void play();
58    void playFromMediaId(String uri, in Bundle extras);
59    void playFromSearch(String string, in Bundle extras);
60    void skipToQueueItem(long id);
61    void pause();
62    void stop();
63    void next();
64    void previous();
65    void fastForward();
66    void rewind();
67    void seekTo(long pos);
68    void rate(in Rating rating);
69    void sendCustomAction(String action, in Bundle args);
70    MediaMetadata getMetadata();
71    PlaybackState getPlaybackState();
72    ParceledListSlice getQueue();
73    CharSequence getQueueTitle();
74    Bundle getExtras();
75    int getRatingType();
76}
77