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