1e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik/* Copyright (C) 2014 The Android Open Source Project 2e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * 3e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * Licensed under the Apache License, Version 2.0 (the "License"); 4e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * you may not use this file except in compliance with the License. 5e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * You may obtain a copy of the License at 6e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * 7e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * http://www.apache.org/licenses/LICENSE-2.0 8e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * 9e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * Unless required by applicable law or agreed to in writing, software 10e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * distributed under the License is distributed on an "AS IS" BASIS, 11e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * See the License for the specific language governing permissions and 13e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * limitations under the License. 14e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik */ 15e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik 16e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikpackage android.support.v4.media.session; 17e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik 18e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.app.PendingIntent; 19e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.content.Intent; 20e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.support.v4.media.MediaMetadataCompat; 21e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.support.v4.media.RatingCompat; 22e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.support.v4.media.session.IMediaControllerCallback; 23e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.support.v4.media.session.ParcelableVolumeInfo; 24e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.support.v4.media.session.PlaybackStateCompat; 25e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.support.v4.media.session.MediaSessionCompat; 26e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.os.Bundle; 27e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport android.view.KeyEvent; 28e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik 29e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikimport java.util.List; 30e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik 31e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik/** 32e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * Interface to a MediaSessionCompat. This is only used on pre-Lollipop systems. 33e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik * @hide 34e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik */ 35e49860b0f76d8336c1d41831ed370b0ff94278efRoboErikinterface IMediaSession { 36e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void sendCommand(String command, in Bundle args, in MediaSessionCompat.ResultReceiverWrapper cb); 37e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik boolean sendMediaButton(in KeyEvent mediaButton); 38e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void registerCallbackListener(in IMediaControllerCallback cb); 39e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void unregisterCallbackListener(in IMediaControllerCallback cb); 40e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik boolean isTransportControlEnabled(); 41e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik String getPackageName(); 42e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik String getTag(); 43e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik PendingIntent getLaunchPendingIntent(); 44e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik long getFlags(); 45e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik ParcelableVolumeInfo getVolumeAttributes(); 46e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void adjustVolume(int direction, int flags, String packageName); 47e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void setVolumeTo(int value, int flags, String packageName); 48e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik 49e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik // These commands are for the TransportControls 50e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void play(); 51e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void playFromMediaId(String uri, in Bundle extras); 52e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void playFromSearch(String string, in Bundle extras); 53b51f456b92aeb62d5aa9d67e1fb2725b2035fdddIan Lake void playFromUri(in Uri uri, in Bundle extras); 54e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void skipToQueueItem(long id); 55e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void pause(); 56e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void stop(); 57e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void next(); 58e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void previous(); 59e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void fastForward(); 60e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void rewind(); 61e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void seekTo(long pos); 62e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void rate(in RatingCompat rating); 63e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik void sendCustomAction(String action, in Bundle args); 64e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik MediaMetadataCompat getMetadata(); 65e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik PlaybackStateCompat getPlaybackState(); 66e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik List<MediaSessionCompat.QueueItem> getQueue(); 67e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik CharSequence getQueueTitle(); 68e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik Bundle getExtras(); 69e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik int getRatingType(); 705491f533f2781b1693efb6e44df0fb5928bec70dDonghyun Cho void prepare(); 715491f533f2781b1693efb6e44df0fb5928bec70dDonghyun Cho void prepareFromMediaId(String uri, in Bundle extras); 725491f533f2781b1693efb6e44df0fb5928bec70dDonghyun Cho void prepareFromSearch(String string, in Bundle extras); 735491f533f2781b1693efb6e44df0fb5928bec70dDonghyun Cho void prepareFromUri(in Uri uri, in Bundle extras); 74e49860b0f76d8336c1d41831ed370b0ff94278efRoboErik} 75