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