IAudioService.aidl revision c68022258ebd3dd97a5079ba99f4f3cd12b223b0
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
17package android.media;
18
19import android.app.PendingIntent;
20import android.content.ComponentName;
21import android.media.IAudioFocusDispatcher;
22import android.media.IRemoteControlClient;
23import android.media.IRemoteControlDisplay;
24import android.media.IRingtonePlayer;
25import android.net.Uri;
26import android.view.KeyEvent;
27
28/**
29 * {@hide}
30 */
31interface IAudioService {
32
33    void adjustVolume(int direction, int flags);
34
35    void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags);
36
37    void adjustStreamVolume(int streamType, int direction, int flags);
38
39    void adjustMasterVolume(int direction, int flags);
40
41    void setStreamVolume(int streamType, int index, int flags);
42
43    void setMasterVolume(int index, int flags);
44
45    void setStreamSolo(int streamType, boolean state, IBinder cb);
46
47    void setStreamMute(int streamType, boolean state, IBinder cb);
48
49    boolean isStreamMute(int streamType);
50
51    void setMasterMute(boolean state, int flags, IBinder cb);
52
53    boolean isMasterMute();
54
55    int getStreamVolume(int streamType);
56
57    int getMasterVolume();
58
59    int getStreamMaxVolume(int streamType);
60
61    int getMasterMaxVolume();
62
63    int getLastAudibleStreamVolume(int streamType);
64
65    int getLastAudibleMasterVolume();
66
67    void setRingerMode(int ringerMode);
68
69    int getRingerMode();
70
71    void setVibrateSetting(int vibrateType, int vibrateSetting);
72
73    int getVibrateSetting(int vibrateType);
74
75    boolean shouldVibrate(int vibrateType);
76
77    void setMode(int mode, IBinder cb);
78
79    int getMode();
80
81    oneway void playSoundEffect(int effectType);
82
83    oneway void playSoundEffectVolume(int effectType, float volume);
84
85    boolean loadSoundEffects();
86
87    oneway void unloadSoundEffects();
88
89    oneway void reloadAudioSettings();
90
91    void setSpeakerphoneOn(boolean on);
92
93    boolean isSpeakerphoneOn();
94
95    void setBluetoothScoOn(boolean on);
96
97    boolean isBluetoothScoOn();
98
99    int requestAudioFocus(int mainStreamType, int durationHint, IBinder cb, IAudioFocusDispatcher l,
100            String clientId, String callingPackageName);
101
102    int abandonAudioFocus(IAudioFocusDispatcher l, String clientId);
103
104    void unregisterAudioFocusClient(String clientId);
105
106    oneway void dispatchMediaKeyEvent(in KeyEvent keyEvent);
107    void dispatchMediaKeyEventUnderWakelock(in KeyEvent keyEvent);
108
109    oneway void registerMediaButtonIntent(in PendingIntent pi, in ComponentName c);
110    oneway void unregisterMediaButtonIntent(in PendingIntent pi,  in ComponentName c);
111
112    oneway void registerRemoteControlClient(in PendingIntent mediaIntent,
113           in IRemoteControlClient rcClient, in String callingPackageName);
114    oneway void unregisterRemoteControlClient(in PendingIntent mediaIntent,
115           in IRemoteControlClient rcClient);
116
117    oneway void   registerRemoteControlDisplay(in IRemoteControlDisplay rcd);
118    oneway void unregisterRemoteControlDisplay(in IRemoteControlDisplay rcd);
119    oneway void remoteControlDisplayUsesBitmapSize(in IRemoteControlDisplay rcd, int w, int h);
120
121    void startBluetoothSco(IBinder cb);
122    void stopBluetoothSco(IBinder cb);
123
124    void forceVolumeControlStream(int streamType, IBinder cb);
125
126    void setRingtonePlayer(IRingtonePlayer player);
127    IRingtonePlayer getRingtonePlayer();
128    int getMasterStreamType();
129}
130