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.content.Intent; 19 import android.media.Rating; 20 import android.media.session.ISessionControllerCallback; 21 import android.net.Uri; 22 import android.os.Bundle; 23 import android.os.ResultReceiver; 24 25 /** 26 * @hide 27 */ 28 oneway interface ISessionCallback { 29 void onCommand(String packageName, int pid, int uid, ISessionControllerCallback caller, 30 String command, in Bundle args, in ResultReceiver cb); 31 void onMediaButton(String packageName, int pid, int uid, in Intent mediaButtonIntent, 32 int sequenceNumber, in ResultReceiver cb); 33 void onMediaButtonFromController(String packageName, int pid, int uid, 34 ISessionControllerCallback caller, in Intent mediaButtonIntent); 35 36 // These callbacks are for the TransportPerformer 37 void onPrepare(String packageName, int pid, int uid, ISessionControllerCallback caller); 38 void onPrepareFromMediaId(String packageName, int pid, int uid, 39 ISessionControllerCallback caller, String mediaId, in Bundle extras); 40 void onPrepareFromSearch(String packageName, int pid, int uid, 41 ISessionControllerCallback caller, String query, in Bundle extras); 42 void onPrepareFromUri(String packageName, int pid, int uid, ISessionControllerCallback caller, 43 in Uri uri, in Bundle extras); 44 void onPlay(String packageName, int pid, int uid, ISessionControllerCallback caller); 45 void onPlayFromMediaId(String packageName, int pid, int uid, ISessionControllerCallback caller, 46 String mediaId, in Bundle extras); 47 void onPlayFromSearch(String packageName, int pid, int uid, ISessionControllerCallback caller, 48 String query, in Bundle extras); 49 void onPlayFromUri(String packageName, int pid, int uid, ISessionControllerCallback caller, 50 in Uri uri, in Bundle extras); 51 void onSkipToTrack(String packageName, int pid, int uid, ISessionControllerCallback caller, 52 long id); 53 void onPause(String packageName, int pid, int uid, ISessionControllerCallback caller); 54 void onStop(String packageName, int pid, int uid, ISessionControllerCallback caller); 55 void onNext(String packageName, int pid, int uid, ISessionControllerCallback caller); 56 void onPrevious(String packageName, int pid, int uid, ISessionControllerCallback caller); 57 void onFastForward(String packageName, int pid, int uid, ISessionControllerCallback caller); 58 void onRewind(String packageName, int pid, int uid, ISessionControllerCallback caller); 59 void onSeekTo(String packageName, int pid, int uid, ISessionControllerCallback caller, 60 long pos); 61 void onRate(String packageName, int pid, int uid, ISessionControllerCallback caller, 62 in Rating rating); 63 void onCustomAction(String packageName, int pid, int uid, ISessionControllerCallback caller, 64 String action, in Bundle args); 65 66 // These callbacks are for volume handling 67 void onAdjustVolume(String packageName, int pid, int uid, ISessionControllerCallback caller, 68 int direction); 69 void onSetVolumeTo(String packageName, int pid, int uid, 70 ISessionControllerCallback caller, int value); 71 } 72