IRemoteControlDisplay.aidl revision 1b16cc3de51d69c8027cefcc70a084a5b2d7a3d0
1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.media; 18 19import android.app.PendingIntent; 20import android.content.ComponentName; 21import android.graphics.Bitmap; 22import android.os.Bundle; 23 24/** 25 * @hide 26 * Interface registered through AudioManager of an object that displays information 27 * received from a remote control client. 28 * {@see AudioManager#registerRemoteControlDisplay(IRemoteControlDisplay)}. 29 */ 30oneway interface IRemoteControlDisplay 31{ 32 /** 33 * Sets the generation counter of the current client that is displayed on the remote control. 34 * @param clientGeneration the new RemoteControlClient generation 35 * @param clientMediaIntent the PendingIntent associated with the client. 36 * May be null, which implies there is no registered media button event receiver. 37 * @param clearing true if the new client generation value maps to a remote control update 38 * where the display should be cleared. 39 */ 40 void setCurrentClientId(int clientGeneration, in PendingIntent clientMediaIntent, 41 boolean clearing); 42 43 /** 44 * Sets the playback information (state, position and speed) of a client. 45 * @param generationId the current generation ID as known by this client 46 * @param state the current playback state, one of the following values: 47 * {@link RemoteControlClient#PLAYSTATE_STOPPED}, 48 * {@link RemoteControlClient#PLAYSTATE_PAUSED}, 49 * {@link RemoteControlClient#PLAYSTATE_PLAYING}, 50 * {@link RemoteControlClient#PLAYSTATE_FAST_FORWARDING}, 51 * {@link RemoteControlClient#PLAYSTATE_REWINDING}, 52 * {@link RemoteControlClient#PLAYSTATE_SKIPPING_FORWARDS}, 53 * {@link RemoteControlClient#PLAYSTATE_SKIPPING_BACKWARDS}, 54 * {@link RemoteControlClient#PLAYSTATE_BUFFERING}, 55 * {@link RemoteControlClient#PLAYSTATE_ERROR}. 56 * @param stateChangeTimeMs the time at which the client reported the playback information 57 * @param currentPosMs a 0 or positive value for the current media position expressed in ms 58 * Strictly negative values imply that position is not known: 59 * a value of {@link RemoteControlClient#PLAYBACK_POSITION_INVALID} is intended to express 60 * that an application doesn't know the position (e.g. listening to a live stream of a radio) 61 * or that the position information is not applicable (e.g. when state 62 * is {@link RemoteControlClient#PLAYSTATE_BUFFERING} and nothing had played yet); 63 * a value of {@link RemoteControlClient#PLAYBACK_POSITION_ALWAYS_UNKNOWN} implies that the 64 * application uses {@link RemoteControlClient#setPlaybackState(int)} (legacy API) and will 65 * never pass a playback position. 66 * @param speed a value expressed as a ratio of 1x playback: 1.0f is normal playback, 67 * 2.0f is 2x, 0.5f is half-speed, -2.0f is rewind at 2x speed. 0.0f means nothing is 68 * playing (e.g. when state is {@link RemoteControlClient#PLAYSTATE_ERROR}). 69 */ 70 void setPlaybackState(int generationId, int state, long stateChangeTimeMs, long currentPosMs, 71 float speed); 72 73 /** 74 * Sets the transport control flags and playback position capabilities of a client. 75 * @param generationId the current generation ID as known by this client 76 * @param transportControlFlags bitmask of the transport controls this client supports, see 77 * {@link RemoteControlClient#setTransportControlFlags(int)} 78 * @param posCapabilities a bit mask for playback position capabilities, see 79 * {@link RemoteControlClient#MEDIA_POSITION_READABLE} and 80 * {@link RemoteControlClient#MEDIA_POSITION_WRITABLE} 81 */ 82 void setTransportControlInfo(int generationId, int transportControlFlags, int posCapabilities); 83 84 void setMetadata(int generationId, in Bundle metadata); 85 86 void setArtwork(int generationId, in Bitmap artwork); 87 88 /** 89 * To combine metadata text and artwork in one binder call 90 */ 91 void setAllMetadata(int generationId, in Bundle metadata, in Bitmap artwork); 92} 93