IAudioService.aidl revision b839b83c7349533b4cb7278fd3d792b47199ba36
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.bluetooth.BluetoothDevice; 21import android.content.ComponentName; 22import android.media.AudioRoutesInfo; 23import android.media.IAudioFocusDispatcher; 24import android.media.IAudioRoutesObserver; 25import android.media.IRemoteControlClient; 26import android.media.IRemoteControlDisplay; 27import android.media.IRemoteVolumeObserver; 28import android.media.IRingtonePlayer; 29import android.net.Uri; 30import android.view.KeyEvent; 31 32/** 33 * {@hide} 34 */ 35interface IAudioService { 36 37 void adjustVolume(int direction, int flags); 38 39 oneway void adjustLocalOrRemoteStreamVolume(int streamType, int direction); 40 41 void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags); 42 43 void adjustStreamVolume(int streamType, int direction, int flags); 44 45 void adjustMasterVolume(int direction, int flags); 46 47 void setStreamVolume(int streamType, int index, int flags); 48 49 oneway void setRemoteStreamVolume(int index); 50 51 void setMasterVolume(int index, int flags); 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, 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 setRingerMode(int ringerMode); 76 77 int getRingerMode(); 78 79 void setVibrateSetting(int vibrateType, int vibrateSetting); 80 81 int getVibrateSetting(int vibrateType); 82 83 boolean shouldVibrate(int vibrateType); 84 85 void setMode(int mode, IBinder cb); 86 87 int getMode(); 88 89 oneway void playSoundEffect(int effectType); 90 91 oneway void playSoundEffectVolume(int effectType, float volume); 92 93 boolean loadSoundEffects(); 94 95 oneway void unloadSoundEffects(); 96 97 oneway void reloadAudioSettings(); 98 99 void setSpeakerphoneOn(boolean on); 100 101 boolean isSpeakerphoneOn(); 102 103 void setBluetoothScoOn(boolean on); 104 105 boolean isBluetoothScoOn(); 106 107 void setBluetoothA2dpOn(boolean on); 108 109 boolean isBluetoothA2dpOn(); 110 111 oneway void setRemoteSubmixOn(boolean on, int address); 112 113 int requestAudioFocus(int mainStreamType, int durationHint, IBinder cb, IAudioFocusDispatcher l, 114 String clientId, String callingPackageName); 115 116 int abandonAudioFocus(IAudioFocusDispatcher l, String clientId); 117 118 void unregisterAudioFocusClient(String clientId); 119 120 oneway void dispatchMediaKeyEvent(in KeyEvent keyEvent); 121 void dispatchMediaKeyEventUnderWakelock(in KeyEvent keyEvent); 122 123 void registerMediaButtonIntent(in PendingIntent pi, in ComponentName c); 124 oneway void unregisterMediaButtonIntent(in PendingIntent pi); 125 126 oneway void registerMediaButtonEventReceiverForCalls(in ComponentName c); 127 oneway void unregisterMediaButtonEventReceiverForCalls(); 128 129 int registerRemoteControlClient(in PendingIntent mediaIntent, 130 in IRemoteControlClient rcClient, in String callingPackageName); 131 oneway void unregisterRemoteControlClient(in PendingIntent mediaIntent, 132 in IRemoteControlClient rcClient); 133 134 /** 135 * Register an IRemoteControlDisplay. 136 * Notify all IRemoteControlClient of the new display and cause the RemoteControlClient 137 * at the top of the stack to update the new display with its information. 138 * @param rcd the IRemoteControlDisplay to register. No effect if null. 139 * @param w the maximum width of the expected bitmap. Negative or zero values indicate this 140 * display doesn't need to receive artwork. 141 * @param h the maximum height of the expected bitmap. Negative or zero values indicate this 142 * display doesn't need to receive artwork. 143 */ 144 oneway void registerRemoteControlDisplay(in IRemoteControlDisplay rcd, int w, int h); 145 /** 146 * Unregister an IRemoteControlDisplay. 147 * No effect if the IRemoteControlDisplay hasn't been successfully registered. 148 * @param rcd the IRemoteControlDisplay to unregister. No effect if null. 149 */ 150 oneway void unregisterRemoteControlDisplay(in IRemoteControlDisplay rcd); 151 /** 152 * Update the size of the artwork used by an IRemoteControlDisplay. 153 * @param rcd the IRemoteControlDisplay with the new artwork size requirement 154 * @param w the maximum width of the expected bitmap. Negative or zero values indicate this 155 * display doesn't need to receive artwork. 156 * @param h the maximum height of the expected bitmap. Negative or zero values indicate this 157 * display doesn't need to receive artwork. 158 */ 159 oneway void remoteControlDisplayUsesBitmapSize(in IRemoteControlDisplay rcd, int w, int h); 160 161 oneway void setPlaybackInfoForRcc(int rccId, int what, int value); 162 void setPlaybackStateForRcc(int rccId, int state, long timeMs, float speed); 163 int getRemoteStreamMaxVolume(); 164 int getRemoteStreamVolume(); 165 oneway void registerRemoteVolumeObserverForRcc(int rccId, in IRemoteVolumeObserver rvo); 166 167 void startBluetoothSco(IBinder cb); 168 void stopBluetoothSco(IBinder cb); 169 170 void forceVolumeControlStream(int streamType, IBinder cb); 171 172 void setRingtonePlayer(IRingtonePlayer player); 173 IRingtonePlayer getRingtonePlayer(); 174 int getMasterStreamType(); 175 176 void setWiredDeviceConnectionState(int device, int state, String name); 177 int setBluetoothA2dpDeviceConnectionState(in BluetoothDevice device, int state); 178 179 AudioRoutesInfo startWatchingRoutes(in IAudioRoutesObserver observer); 180 181 boolean isCameraSoundForced(); 182} 183