OSDN Git Service

75fc03cd8689b56f5e429a541b17794413fe2db5
[android-x86/frameworks-base.git] / media / java / android / media / IAudioService.aidl
1 /*
2  * Copyright (C) 2007 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
17 package android.media;
18
19 import android.app.PendingIntent;
20 import android.bluetooth.BluetoothDevice;
21 import android.content.ComponentName;
22 import android.media.AudioRoutesInfo;
23 import android.media.IAudioFocusDispatcher;
24 import android.media.IAudioRoutesObserver;
25 import android.media.IRemoteControlClient;
26 import android.media.IRemoteControlDisplay;
27 import android.media.IRemoteVolumeObserver;
28 import android.media.IRingtonePlayer;
29 import android.media.IVolumeController;
30 import android.media.Rating;
31 import android.media.audiopolicy.AudioPolicyConfig;
32 import android.net.Uri;
33 import android.view.KeyEvent;
34
35 /**
36  * {@hide}
37  */
38 interface IAudioService {
39
40     void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags,
41             String callingPackage);
42
43     void adjustStreamVolume(int streamType, int direction, int flags, String callingPackage);
44
45     void adjustMasterVolume(int direction, int flags, String callingPackage);
46
47     void setStreamVolume(int streamType, int index, int flags, String callingPackage);
48
49     oneway void setRemoteStreamVolume(int index);
50
51     void setMasterVolume(int index, int flags, String callingPackage);
52
53     void setStreamSolo(int streamType, boolean state, IBinder cb);
54
55     void setStreamMute(int streamType, boolean state, IBinder cb);
56
57     boolean isStreamMute(int streamType);
58
59     void setMasterMute(boolean state, int flags, String callingPackage, IBinder cb);
60
61     boolean isMasterMute();
62
63     int getStreamVolume(int streamType);
64
65     int getMasterVolume();
66
67     int getStreamMaxVolume(int streamType);
68
69     int getMasterMaxVolume();
70
71     int getLastAudibleStreamVolume(int streamType);
72
73     int getLastAudibleMasterVolume();
74
75     void setMicrophoneMute(boolean on, String callingPackage);
76
77     void setRingerMode(int ringerMode);
78
79     int getRingerMode();
80
81     void setVibrateSetting(int vibrateType, int vibrateSetting);
82
83     int getVibrateSetting(int vibrateType);
84
85     boolean shouldVibrate(int vibrateType);
86
87     void setMode(int mode, IBinder cb);
88
89     int getMode();
90
91     oneway void playSoundEffect(int effectType);
92
93     oneway void playSoundEffectVolume(int effectType, float volume);
94
95     boolean loadSoundEffects();
96
97     oneway void unloadSoundEffects();
98
99     oneway void reloadAudioSettings();
100
101     oneway void avrcpSupportsAbsoluteVolume(String address, boolean support);
102
103     void setSpeakerphoneOn(boolean on);
104
105     boolean isSpeakerphoneOn();
106
107     void setBluetoothScoOn(boolean on);
108
109     boolean isBluetoothScoOn();
110
111     void setBluetoothA2dpOn(boolean on);
112
113     boolean isBluetoothA2dpOn();
114
115     int requestAudioFocus(int mainStreamType, int durationHint, IBinder cb,
116             IAudioFocusDispatcher fd, String clientId, String callingPackageName);
117
118     int abandonAudioFocus(IAudioFocusDispatcher fd, String clientId);
119
120     void unregisterAudioFocusClient(String clientId);
121
122     int getCurrentAudioFocus();
123
124     /**
125      * Register an IRemoteControlDisplay.
126      * Success of registration is subject to a check on
127      *   the android.Manifest.permission.MEDIA_CONTENT_CONTROL permission.
128      * Notify all IRemoteControlClient of the new display and cause the RemoteControlClient
129      * at the top of the stack to update the new display with its information.
130      * @param rcd the IRemoteControlDisplay to register. No effect if null.
131      * @param w the maximum width of the expected bitmap. Negative or zero values indicate this
132      *   display doesn't need to receive artwork.
133      * @param h the maximum height of the expected bitmap. Negative or zero values indicate this
134      *   display doesn't need to receive artwork.
135      */
136     boolean registerRemoteControlDisplay(in IRemoteControlDisplay rcd, int w, int h);
137
138     /**
139      * Like registerRemoteControlDisplay, but with success being subject to a check on
140      *   the android.Manifest.permission.MEDIA_CONTENT_CONTROL permission, and if it fails,
141      *   success is subject to listenerComp being one of the ENABLED_NOTIFICATION_LISTENERS
142      *   components.
143      */
144     boolean registerRemoteController(in IRemoteControlDisplay rcd, int w, int h,
145             in ComponentName listenerComp);
146
147     /**
148      * Unregister an IRemoteControlDisplay.
149      * No effect if the IRemoteControlDisplay hasn't been successfully registered.
150      * @param rcd the IRemoteControlDisplay to unregister. No effect if null.
151      */
152     oneway void unregisterRemoteControlDisplay(in IRemoteControlDisplay rcd);
153     /**
154      * Update the size of the artwork used by an IRemoteControlDisplay.
155      * @param rcd the IRemoteControlDisplay with the new artwork size requirement
156      * @param w the maximum width of the expected bitmap. Negative or zero values indicate this
157      *   display doesn't need to receive artwork.
158      * @param h the maximum height of the expected bitmap. Negative or zero values indicate this
159      *   display doesn't need to receive artwork.
160      */
161     oneway void remoteControlDisplayUsesBitmapSize(in IRemoteControlDisplay rcd, int w, int h);
162     /**
163      * Controls whether a remote control display needs periodic checks of the RemoteControlClient
164      * playback position to verify that the estimated position has not drifted from the actual
165      * position. By default the check is not performed.
166      * The IRemoteControlDisplay must have been previously registered for this to have any effect.
167      * @param rcd the IRemoteControlDisplay for which the anti-drift mechanism will be enabled
168      *     or disabled. Not null.
169      * @param wantsSync if true, RemoteControlClient instances which expose their playback position
170      *     to the framework will regularly compare the estimated playback position with the actual
171      *     position, and will update the IRemoteControlDisplay implementation whenever a drift is
172      *     detected.
173      */
174     oneway void remoteControlDisplayWantsPlaybackPositionSync(in IRemoteControlDisplay rcd,
175             boolean wantsSync);
176
177     void startBluetoothSco(IBinder cb, int targetSdkVersion);
178     void startBluetoothScoVirtualCall(IBinder cb);
179     void stopBluetoothSco(IBinder cb);
180
181     void forceVolumeControlStream(int streamType, IBinder cb);
182
183     void setRingtonePlayer(IRingtonePlayer player);
184     IRingtonePlayer getRingtonePlayer();
185     int getMasterStreamType();
186
187     void setWiredDeviceConnectionState(int device, int state, String name);
188     int setBluetoothA2dpDeviceConnectionState(in BluetoothDevice device, int state, int profile);
189
190     AudioRoutesInfo startWatchingRoutes(in IAudioRoutesObserver observer);
191
192     boolean isCameraSoundForced();
193
194     void setVolumeController(in IVolumeController controller);
195
196     void notifyVolumeControllerVisible(in IVolumeController controller, boolean visible);
197
198     boolean isStreamAffectedByRingerMode(int streamType);
199
200     void disableSafeMediaVolume();
201
202     int setHdmiSystemAudioSupported(boolean on);
203
204     boolean isHdmiSystemAudioSupported();
205
206     boolean registerAudioPolicy(in AudioPolicyConfig policyConfig, IBinder cb);
207     oneway void unregisterAudioPolicyAsync(in IBinder cb);
208 }