• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 package android.media.session;
17 
18 import android.app.PendingIntent;
19 import android.content.ComponentName;
20 import android.content.pm.ParceledListSlice;
21 import android.media.AudioAttributes;
22 import android.media.MediaMetadata;
23 import android.media.session.ISessionController;
24 import android.media.session.PlaybackState;
25 import android.media.session.MediaSession;
26 import android.os.Bundle;
27 import android.os.ResultReceiver;
28 
29 /**
30  * Interface to a MediaSession in the system.
31  * @hide
32  */
33 interface ISession {
sendEvent(String event, in Bundle data)34     void sendEvent(String event, in Bundle data);
getController()35     ISessionController getController();
setFlags(int flags)36     void setFlags(int flags);
setActive(boolean active)37     void setActive(boolean active);
setMediaButtonReceiver(in PendingIntent mbr)38     void setMediaButtonReceiver(in PendingIntent mbr);
setMediaButtonBroadcastReceiver(in ComponentName broadcastReceiver)39     void setMediaButtonBroadcastReceiver(in ComponentName broadcastReceiver);
setLaunchPendingIntent(in PendingIntent pi)40     void setLaunchPendingIntent(in PendingIntent pi);
destroySession()41     void destroySession();
42 
43     // These commands are for the TransportPerformer
setMetadata(in MediaMetadata metadata, long duration, String metadataDescription)44     void setMetadata(in MediaMetadata metadata, long duration, String metadataDescription);
setPlaybackState(in PlaybackState state)45     void setPlaybackState(in PlaybackState state);
resetQueue()46     void resetQueue();
getBinderForSetQueue()47     IBinder getBinderForSetQueue();
setQueueTitle(CharSequence title)48     void setQueueTitle(CharSequence title);
setExtras(in Bundle extras)49     void setExtras(in Bundle extras);
setRatingType(int type)50     void setRatingType(int type);
51 
52     // These commands relate to volume handling
setPlaybackToLocal(in AudioAttributes attributes)53     void setPlaybackToLocal(in AudioAttributes attributes);
setPlaybackToRemote(int control, int max, @nullable String controlId)54     void setPlaybackToRemote(int control, int max, @nullable String controlId);
setCurrentVolume(int currentVolume)55     void setCurrentVolume(int currentVolume);
56 }
57