1 /* Copyright (C) 2011 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;
17 
18 import android.graphics.Bitmap;
19 import android.media.IRemoteControlDisplay;
20 import android.media.Rating;
21 
22 /**
23  * @hide
24  * Interface registered by AudioManager to notify a source of remote control information
25  * that information is requested to be displayed on the remote control (through
26  * IRemoteControlDisplay).
27  * {@see AudioManager#registerRemoteControlClient(RemoteControlClient)}.
28  */
29 oneway interface IRemoteControlClient
30 {
31     /**
32      * Notifies a remote control client that information for the given generation ID is
33      * requested. If the flags contains
34      * {@link RemoteControlClient#FLAG_INFORMATION_REQUESTED_ALBUM_ART} then the width and height
35      *   parameters are valid.
36      * @param generationId
37      * @param infoFlags
38      * FIXME: is infoFlags required? since the RCC pushes info, this might always be called
39      *        with RC_INFO_ALL
40      */
onInformationRequested(int generationId, int infoFlags)41     void onInformationRequested(int generationId, int infoFlags);
42 
43     /**
44      * Notifies a remote control client that information for the given generation ID is
45      * requested for the given IRemoteControlDisplay alone.
46      * @param rcd the display to which current info should be sent
47      */
informationRequestForDisplay(IRemoteControlDisplay rcd, int w, int h)48     void informationRequestForDisplay(IRemoteControlDisplay rcd, int w, int h);
49 
50     /**
51      * Sets the generation counter of the current client that is displayed on the remote control.
52      */
setCurrentClientGenerationId(int clientGeneration)53     void setCurrentClientGenerationId(int clientGeneration);
54 
plugRemoteControlDisplay(IRemoteControlDisplay rcd, int w, int h)55     void   plugRemoteControlDisplay(IRemoteControlDisplay rcd, int w, int h);
unplugRemoteControlDisplay(IRemoteControlDisplay rcd)56     void unplugRemoteControlDisplay(IRemoteControlDisplay rcd);
setBitmapSizeForDisplay(IRemoteControlDisplay rcd, int w, int h)57     void setBitmapSizeForDisplay(IRemoteControlDisplay rcd, int w, int h);
setWantsSyncForDisplay(IRemoteControlDisplay rcd, boolean wantsSync)58     void setWantsSyncForDisplay(IRemoteControlDisplay rcd, boolean wantsSync);
enableRemoteControlDisplay(IRemoteControlDisplay rcd, boolean enabled)59     void enableRemoteControlDisplay(IRemoteControlDisplay rcd, boolean enabled);
seekTo(int clientGeneration, long timeMs)60     void seekTo(int clientGeneration, long timeMs);
updateMetadata(int clientGeneration, int key, in Rating value)61     void updateMetadata(int clientGeneration, int key, in Rating value);
62 }