ISessionController.aidl revision e34c09daf89fb888fe2638e71758573462d85173
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.MediaSessionInfo; 27import android.media.session.ParcelableVolumeInfo; 28import android.media.session.PlaybackState; 29import android.media.session.MediaSession; 30import android.net.Uri; 31import android.os.Bundle; 32import android.os.ResultReceiver; 33import android.view.KeyEvent; 34 35import java.util.List; 36 37/** 38 * Interface to a MediaSession in the system. 39 * @hide 40 */ 41interface ISessionController { 42 void sendCommand(String command, in Bundle args, in ResultReceiver cb); 43 boolean sendMediaButton(in KeyEvent mediaButton); 44 void registerCallbackListener(in ISessionControllerCallback cb); 45 void unregisterCallbackListener(in ISessionControllerCallback cb); 46 boolean isTransportControlEnabled(); 47 MediaSessionInfo getSessionInfo(); 48 PendingIntent getLaunchPendingIntent(); 49 long getFlags(); 50 ParcelableVolumeInfo getVolumeAttributes(); 51 void adjustVolume(int direction, int flags); 52 void setVolumeTo(int value, int flags); 53 54 IMediaRouterDelegate createMediaRouterDelegate(IMediaRouterStateCallback callback); 55 56 // These commands are for the TransportControls 57 void play(); 58 void playUri(in Uri uri, in Bundle extras); 59 void playFromSearch(String string, in Bundle extras); 60 void skipToTrack(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