IAudioService.aidl revision 3114ce3861f20f9a5c2c59dd2629197a1f4874a8
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.IRingtonePlayer; 28import android.net.Uri; 29import android.view.KeyEvent; 30 31/** 32 * {@hide} 33 */ 34interface IAudioService { 35 36 void adjustVolume(int direction, int flags); 37 38 oneway void adjustLocalOrRemoteStreamVolume(int streamType, int direction); 39 40 void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags); 41 42 void adjustStreamVolume(int streamType, int direction, int flags); 43 44 void adjustMasterVolume(int direction, int flags); 45 46 void setStreamVolume(int streamType, int index, int flags); 47 48 oneway void setRemoteStreamVolume(int index); 49 50 void setMasterVolume(int index, int flags); 51 52 void setStreamSolo(int streamType, boolean state, IBinder cb); 53 54 void setStreamMute(int streamType, boolean state, IBinder cb); 55 56 boolean isStreamMute(int streamType); 57 58 void setMasterMute(boolean state, int flags, IBinder cb); 59 60 boolean isMasterMute(); 61 62 int getStreamVolume(int streamType); 63 64 int getMasterVolume(); 65 66 int getStreamMaxVolume(int streamType); 67 68 int getMasterMaxVolume(); 69 70 int getLastAudibleStreamVolume(int streamType); 71 72 int getLastAudibleMasterVolume(); 73 74 void setRingerMode(int ringerMode); 75 76 int getRingerMode(); 77 78 void setVibrateSetting(int vibrateType, int vibrateSetting); 79 80 int getVibrateSetting(int vibrateType); 81 82 boolean shouldVibrate(int vibrateType); 83 84 void setMode(int mode, IBinder cb); 85 86 int getMode(); 87 88 oneway void playSoundEffect(int effectType); 89 90 oneway void playSoundEffectVolume(int effectType, float volume); 91 92 boolean loadSoundEffects(); 93 94 oneway void unloadSoundEffects(); 95 96 oneway void reloadAudioSettings(); 97 98 void setSpeakerphoneOn(boolean on); 99 100 boolean isSpeakerphoneOn(); 101 102 void setBluetoothScoOn(boolean on); 103 104 boolean isBluetoothScoOn(); 105 106 void setBluetoothA2dpOn(boolean on); 107 108 boolean isBluetoothA2dpOn(); 109 110 int requestAudioFocus(int mainStreamType, int durationHint, IBinder cb, IAudioFocusDispatcher l, 111 String clientId, String callingPackageName); 112 113 int abandonAudioFocus(IAudioFocusDispatcher l, String clientId); 114 115 void unregisterAudioFocusClient(String clientId); 116 117 oneway void dispatchMediaKeyEvent(in KeyEvent keyEvent); 118 void dispatchMediaKeyEventUnderWakelock(in KeyEvent keyEvent); 119 120 oneway void registerMediaButtonIntent(in PendingIntent pi, in ComponentName c); 121 oneway void unregisterMediaButtonIntent(in PendingIntent pi, in ComponentName c); 122 123 oneway void registerMediaButtonEventReceiverForCalls(in ComponentName c); 124 oneway void unregisterMediaButtonEventReceiverForCalls(); 125 126 int registerRemoteControlClient(in PendingIntent mediaIntent, 127 in IRemoteControlClient rcClient, in String callingPackageName); 128 oneway void unregisterRemoteControlClient(in PendingIntent mediaIntent, 129 in IRemoteControlClient rcClient); 130 131 oneway void registerRemoteControlDisplay(in IRemoteControlDisplay rcd); 132 oneway void unregisterRemoteControlDisplay(in IRemoteControlDisplay rcd); 133 oneway void remoteControlDisplayUsesBitmapSize(in IRemoteControlDisplay rcd, int w, int h); 134 135 oneway void setPlaybackInfoForRcc(int rccId, int what, int value); 136 int getRemoteStreamMaxVolume(); 137 int getRemoteStreamVolume(); 138 139 void startBluetoothSco(IBinder cb); 140 void stopBluetoothSco(IBinder cb); 141 142 void forceVolumeControlStream(int streamType, IBinder cb); 143 144 void setRingtonePlayer(IRingtonePlayer player); 145 IRingtonePlayer getRingtonePlayer(); 146 int getMasterStreamType(); 147 148 void setWiredDeviceConnectionState(int device, int state, String name); 149 int setBluetoothA2dpDeviceConnectionState(in BluetoothDevice device, int state); 150 151 AudioRoutesInfo startWatchingRoutes(in IAudioRoutesObserver observer); 152} 153