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.pm.ParceledListSlice; 20import android.media.AudioAttributes; 21import android.media.MediaMetadata; 22import android.media.session.ISessionController; 23import android.media.session.PlaybackState; 24import android.media.session.MediaSession; 25import android.os.Bundle; 26import android.os.ResultReceiver; 27 28/** 29 * Interface to a MediaSession in the system. 30 * @hide 31 */ 32interface ISession { 33 void sendEvent(String event, in Bundle data); 34 ISessionController getController(); 35 void setFlags(int flags); 36 void setActive(boolean active); 37 void setMediaButtonReceiver(in PendingIntent mbr); 38 void setLaunchPendingIntent(in PendingIntent pi); 39 void destroy(); 40 41 // These commands are for the TransportPerformer 42 void setMetadata(in MediaMetadata metadata); 43 void setPlaybackState(in PlaybackState state); 44 void setQueue(in ParceledListSlice queue); 45 void setQueueTitle(CharSequence title); 46 void setExtras(in Bundle extras); 47 void setRatingType(int type); 48 49 // These commands relate to volume handling 50 void setPlaybackToLocal(in AudioAttributes attributes); 51 void setPlaybackToRemote(int control, int max); 52 void setCurrentVolume(int currentVolume); 53 54 String getCallingPackage(); 55} 56