/development/samples/RandomMusicPlayer/src/com/example/android/musicplayer/ |
AudioFocusHelper.java | 20 import android.media.AudioManager; 30 public class AudioFocusHelper implements AudioManager.OnAudioFocusChangeListener { 31 AudioManager mAM; 35 mAM = (AudioManager) ctx.getSystemService(Context.AUDIO_SERVICE); 41 return AudioManager.AUDIOFOCUS_REQUEST_GRANTED == 42 mAM.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); 47 return AudioManager.AUDIOFOCUS_REQUEST_GRANTED == mAM.abandonAudioFocus(this); 51 * Called by AudioManager on audio focus changes. We implement this by calling our 57 case AudioManager.AUDIOFOCUS_GAIN [all...] |
MediaButtonHelper.java | 4 import android.media.AudioManager; 26 sMethodRegisterMediaButtonEventReceiver = AudioManager.class.getMethod( 29 sMethodUnregisterMediaButtonEventReceiver = AudioManager.class.getMethod( 37 public static void registerMediaButtonEventReceiverCompat(AudioManager audioManager, 43 sMethodRegisterMediaButtonEventReceiver.invoke(audioManager, receiver); 62 public static void unregisterMediaButtonEventReceiverCompat(AudioManager audioManager, 68 sMethodUnregisterMediaButtonEventReceiver.invoke(audioManager, receiver);
|
RemoteControlHelper.java | 19 import android.media.AudioManager; 42 sRegisterRemoteControlClientMethod = AudioManager.class.getMethod( 44 sUnregisterRemoteControlClientMethod = AudioManager.class.getMethod( 58 public static void registerRemoteControlClient(AudioManager audioManager, 65 sRegisterRemoteControlClientMethod.invoke(audioManager, 73 public static void unregisterRemoteControlClient(AudioManager audioManager, 80 sUnregisterRemoteControlClientMethod.invoke(audioManager,
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/ |
AudioManagerCompatWrapper.java | 19 import android.media.AudioManager; 25 AudioManager.class, "isWiredHeadsetOn"); 27 AudioManager.class, "isBluetoothA2dpOn"); 29 private final AudioManager mManager; 31 public AudioManagerCompatWrapper(AudioManager manager) {
|
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/ |
MediaAudioManagerTest.java | 21 import android.media.AudioManager; 26 * Junit / Instrumentation test case for the media AudioManager api 32 private AudioManager mAudioManager; 33 private int[] ringtoneMode = {AudioManager.RINGER_MODE_NORMAL, 34 AudioManager.RINGER_MODE_SILENT, AudioManager.RINGER_MODE_VIBRATE}; 43 mAudioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
|
MediaPresetReverbTest.java | 25 import android.media.AudioManager; 200 AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE); 201 int volume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC); 202 am.setStreamVolume(AudioManager.STREAM_MUSIC, 203 am.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 219 mp.setAudioStreamType(AudioManager.STREAM_MUSIC); 256 am.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0); 270 AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE) [all...] |
MediaAudioTrackTest.java | 23 import android.media.AudioManager; 142 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STREAM, 155 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STREAM, 168 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STATIC, 181 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STATIC, 198 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STREAM, 210 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STREAM, 222 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STATIC, 234 AudioManager.STREAM_MUSIC, AudioTrack.MODE_STATIC, 254 final int[] STREAM_TYPES = { AudioManager.STREAM_ALARM, AudioManager.STREAM_BLUETOOTH_SCO, [all...] |
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/ |
VolumeController.java | 23 import android.media.AudioManager; 31 private static final int STREAM = AudioManager.STREAM_NOTIFICATION; 35 private AudioManager mAudioManager; 43 mAudioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); 45 mMute = mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL; 60 vibeInSilent ? AudioManager.RINGER_MODE_VIBRATE 61 : AudioManager.RINGER_MODE_SILENT); 63 mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); 64 mAudioManager.setStreamVolume(STREAM, level, AudioManager.FLAG_PLAY_SOUND);
|
/packages/inputmethods/PinyinIME/src/com/android/inputmethod/pinyin/ |
SoundManager.java | 20 import android.media.AudioManager; 28 private AudioManager mAudioManager; 40 mAudioManager = (AudioManager) mContext 43 mSilentMode = (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL); 60 int sound = AudioManager.FX_KEYPRESS_STANDARD;
|
/cts/tests/tests/media/src/android/media/cts/ |
RingtoneTest.java | 25 import android.media.AudioManager; 36 private AudioManager mAudioManager; 45 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); 49 mOriginalVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_RING); 52 int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_RING); 53 mAudioManager.setStreamVolume(AudioManager.STREAM_RING, maxVolume / 2, 54 AudioManager.FLAG_ALLOW_RINGER_MODES); 66 mAudioManager.setStreamVolume(AudioManager.STREAM_RING, mOriginalVolume, 67 AudioManager.FLAG_ALLOW_RINGER_MODES); 109 mRingtone.setStreamType(AudioManager.STREAM_MUSIC) [all...] |
AudioManagerTest.java | 19 import static android.media.AudioManager.ADJUST_LOWER; 20 import static android.media.AudioManager.ADJUST_RAISE; 21 import static android.media.AudioManager.ADJUST_SAME; 22 import static android.media.AudioManager.FLAG_ALLOW_RINGER_MODES; 23 import static android.media.AudioManager.FLAG_SHOW_UI; 24 import static android.media.AudioManager.MODE_IN_CALL; 25 import static android.media.AudioManager.MODE_IN_COMMUNICATION; 26 import static android.media.AudioManager.MODE_NORMAL; 27 import static android.media.AudioManager.MODE_RINGTONE; 28 import static android.media.AudioManager.RINGER_MODE_NORMAL [all...] |
ToneGeneratorTest.java | 19 import android.media.AudioManager; 53 ToneGenerator toneGen = new ToneGenerator(AudioManager.STREAM_RING,
|
RingtoneManagerTest.java | 29 import android.media.AudioManager; 46 private AudioManager mAudioManager; 61 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); 63 mOriginalVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_RING); 66 mAudioManager.adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_RAISE, 67 AudioManager.FLAG_ALLOW_RINGER_MODES); 74 mAudioManager.setStreamVolume(AudioManager.STREAM_RING, mOriginalVolume, 75 AudioManager.FLAG_ALLOW_RINGER_MODES); 211 assertEquals(AudioManager.STREAM_ALARM, mRingtoneManager.inferStreamType()) [all...] |
/cts/tests/tests/permission/src/android/permission/cts/ |
NoAudioPermissionTest.java | 20 import android.media.AudioManager; 28 private AudioManager mAudioManager; 34 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); 39 * Verify that AudioManager.setMicrophoneMute, AudioManager.setMode requires permissions. 52 assertTrue(AudioManager.MODE_NORMAL != AudioManager.MODE_RINGTONE); 54 mAudioManager.setMode(AudioManager.MODE_NORMAL); 57 mAudioManager.setMode(AudioManager.MODE_RINGTONE); 62 * Verify that AudioManager routing methods require permissions [all...] |
/frameworks/base/tests/FixVibrateSetting/src/com/android/fixvibratesetting/ |
FixVibrateSetting.java | 24 import android.media.AudioManager; 32 AudioManager mAudioManager; 45 mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE); 70 case AudioManager.VIBRATE_SETTING_OFF: 72 case AudioManager.VIBRATE_SETTING_ON: 74 case AudioManager.VIBRATE_SETTING_ONLY_SILENT: 95 String ringer = getSettingValue(AudioManager.VIBRATE_TYPE_RINGER); 96 String notification = getSettingValue(AudioManager.VIBRATE_TYPE_NOTIFICATION); 102 mAudioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, 103 AudioManager.VIBRATE_SETTING_ON) [all...] |
/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/ |
SettingsHelper.java | 30 import android.media.AudioManager; 42 private AudioManager mAudioManager; 51 mAudioManager = (AudioManager) context 124 mAudioManager.setRingerMode(mVibrate ? AudioManager.RINGER_MODE_VIBRATE : 125 AudioManager.RINGER_MODE_SILENT); 127 mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); 128 mAudioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, 129 mVibrate ? AudioManager.VIBRATE_SETTING_ON 130 : AudioManager.VIBRATE_SETTING_OFF); 190 AudioManager am = new AudioManager(mContext) [all...] |
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/ |
TonesAutoTest.java | 24 import android.media.AudioManager; 40 toneGen = new ToneGenerator(AudioManager.STREAM_MUSIC, 100); 64 toneGen = new ToneGenerator(AudioManager.STREAM_MUSIC, 100); 101 toneGen = new ToneGenerator(AudioManager.STREAM_MUSIC, 100); 126 toneGen1 = new ToneGenerator(AudioManager.STREAM_MUSIC, 100); 127 toneGen2 = new ToneGenerator(AudioManager.STREAM_MUSIC, 50); 156 toneGen = new ToneGenerator(AudioManager.STREAM_MUSIC, 100);
|
/packages/apps/Settings/src/com/android/settings/ |
SoundSettings.java | 28 import android.media.AudioManager; 105 private AudioManager mAudioManager; 110 if (intent.getAction().equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) { 137 mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); 233 IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION); 252 mAudioManager.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER); 255 if (callsVibrateSetting == AudioManager.VIBRATE_SETTING_OFF) { 258 AudioManager.VIBRATE_TYPE_RINGER, 259 AudioManager.VIBRATE_SETTING_ONLY_SILENT); 261 if (callsVibrateSetting == AudioManager.VIBRATE_SETTING_ON) [all...] |
RingerVolumePreference.java | 30 import android.media.AudioManager; 71 AudioManager.STREAM_MUSIC, 72 AudioManager.STREAM_RING, 73 AudioManager.STREAM_NOTIFICATION, 74 AudioManager.STREAM_ALARM 119 if (streamType == AudioManager.STREAM_RING && muted 120 && mAudioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER)) { 138 private AudioManager mAudioManager; 147 setStreamType(AudioManager.STREAM_RING); 154 mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE) [all...] |
/frameworks/base/core/java/android/view/ |
VolumePanel.java | 29 import android.media.AudioManager; 96 private AudioManager mAudioManager; 122 BluetoothSCOStream(AudioManager.STREAM_BLUETOOTH_SCO, 127 RingerStream(AudioManager.STREAM_RING, 132 VoiceStream(AudioManager.STREAM_VOICE_CALL, 137 AlarmStream(AudioManager.STREAM_ALARM, 142 MediaStream(AudioManager.STREAM_MUSIC, 147 NotificationStream(AudioManager.STREAM_NOTIFICATION, 195 mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); 262 filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION) [all...] |
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/ |
MediaPlayerSetAudioStreamTypeStateUnitTest.java | 20 import android.media.AudioManager; 57 player.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
/cts/tests/src/android/media/cts/ |
AudioManagerStub.java | 24 import android.media.AudioManager; 32 private AudioManager mAudioManager; 42 mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); 44 mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
/packages/apps/Camera/src/com/android/camera/ |
SoundPlayer.java | 20 import android.media.AudioManager; 75 mAudioStreamType = AudioManager.STREAM_MUSIC; 81 mAudioStreamType = 7; // AudioManager.STREAM_SYSTEM_ENFORCED; currently hidden API. 83 mAudioStreamType = AudioManager.STREAM_MUSIC;
|
/frameworks/base/core/java/android/webkit/ |
HTML5Audio.java | 20 import android.media.AudioManager; 46 AudioManager.OnAudioFocusChangeListener { 239 case AudioManager.AUDIOFOCUS_GAIN: 249 case AudioManager.AUDIOFOCUS_LOSS: 257 case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT: 258 case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK: 275 AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); 276 int result = audioManager.requestAudioFocus(this, AudioManager.STREAM_MUSIC [all...] |
/frameworks/base/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ |
ScoAudioTest.java | 29 import android.media.AudioManager; 61 AudioManager mAudioManager; 62 AudioManager mAudioManager2; 105 intentFilter.addAction(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED); 106 intentFilter.addAction(AudioManager.ACTION_SCO_AUDIO_STATE_UPDATED); 109 mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); 110 mAudioManager2 = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE); 114 R.raw.sine440_mo_16b_16k, AudioManager.STREAM_BLUETOOTH_SCO); 134 String.valueOf(AudioManager.STREAM_BLUETOOTH_SCO)); 186 mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO [all...] |