IMediaSession.aidl revision 7435f27d690f295c861db86f9e45475a205547b8
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.support.v4.media.session; 17 18import android.app.PendingIntent; 19import android.content.Intent; 20import android.support.v4.media.MediaMetadataCompat; 21import android.support.v4.media.RatingCompat; 22import android.support.v4.media.session.IMediaControllerCallback; 23import android.support.v4.media.session.ParcelableVolumeInfo; 24import android.support.v4.media.session.PlaybackStateCompat; 25import android.support.v4.media.session.MediaSessionCompat; 26import android.os.Bundle; 27import android.view.KeyEvent; 28 29import java.util.List; 30 31/** 32 * Interface to a MediaSessionCompat. This is only used on pre-Lollipop systems. 33 * @hide 34 */ 35interface IMediaSession { 36 // Next ID: 40 37 void sendCommand(String command, in Bundle args, in MediaSessionCompat.ResultReceiverWrapper cb) = 0; 38 boolean sendMediaButton(in KeyEvent mediaButton) = 1; 39 void registerCallbackListener(in IMediaControllerCallback cb) = 2; 40 void unregisterCallbackListener(in IMediaControllerCallback cb) = 3; 41 boolean isTransportControlEnabled() = 4; 42 String getPackageName() = 5; 43 String getTag() = 6; 44 PendingIntent getLaunchPendingIntent() = 7; 45 long getFlags() = 8; 46 ParcelableVolumeInfo getVolumeAttributes() = 9; 47 void adjustVolume(int direction, int flags, String packageName) = 10; 48 void setVolumeTo(int value, int flags, String packageName) = 11; 49 MediaMetadataCompat getMetadata() = 26; 50 PlaybackStateCompat getPlaybackState() = 27; 51 List<MediaSessionCompat.QueueItem> getQueue() = 28; 52 CharSequence getQueueTitle() = 29; 53 Bundle getExtras() = 30; 54 int getRatingType() = 31; 55 56 // These commands are for the TransportControls 57 void prepare() = 32; 58 void prepareFromMediaId(String uri, in Bundle extras) = 33; 59 void prepareFromSearch(String string, in Bundle extras) = 34; 60 void prepareFromUri(in Uri uri, in Bundle extras) = 35; 61 void play() = 12; 62 void playFromMediaId(String uri, in Bundle extras) = 13; 63 void playFromSearch(String string, in Bundle extras) = 14; 64 void playFromUri(in Uri uri, in Bundle extras) = 15; 65 void skipToQueueItem(long id) = 16; 66 void pause() = 17; 67 void stop() = 18; 68 void next() = 19; 69 void previous() = 20; 70 void fastForward() = 21; 71 void rewind() = 22; 72 void seekTo(long pos) = 23; 73 void rate(in RatingCompat rating) = 24; 74 void sendCustomAction(String action, in Bundle args) = 25; 75} 76