/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/ |
D | RingerModeActivity.java | 73 private AudioManager mAudioManager; field in RingerModeActivity 94 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in onCreate() 150 mAudioManager.adjustStreamVolume(stream, AudioManager.ADJUST_MUTE, 0); in testStreamMuting() 152 mAudioManager.isStreamMute(stream)); in testStreamMuting() 154 mAudioManager.adjustStreamVolume(stream, AudioManager.ADJUST_MUTE, 0); in testStreamMuting() 156 mAudioManager.isStreamMute(stream)); in testStreamMuting() 158 mAudioManager.adjustStreamVolume(stream, AudioManager.ADJUST_UNMUTE, 0); in testStreamMuting() 160 mAudioManager.isStreamMute(stream)); in testStreamMuting() 162 mAudioManager.adjustStreamVolume(stream, AudioManager.ADJUST_TOGGLE_MUTE, 0); in testStreamMuting() 164 mAudioManager.isStreamMute(stream)); in testStreamMuting() [all …]
|
D | AudioFrequencyActivity.java | 47 protected AudioManager mAudioManager; field in AudioFrequencyActivity 66 mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE); in onCreate() 67 mAudioManager.registerAudioDeviceCallback(new ConnectListener(), new Handler()); in onCreate() 136 mMaxLevel = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); in setMaxLevel() 137 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, (int)(mMaxLevel), 0); in setMaxLevel() 141 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0); in setMinLevel() 145 int currentLevel = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); in testMaxLevel() 157 return mAudioManager.getStreamMaxVolume(streamType); in getMaxLevelForStream() 162 mAudioManager.setStreamVolume(streamType, level, 0); in setLevelForStream() 169 return mAudioManager.getStreamVolume(streamType); in getLevelForStream() [all …]
|
D | USBAudioPeripheralActivity.java | 46 AudioManager mAudioManager; field in USBAudioPeripheralActivity 137 mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE); in onCreate() 138 mAudioManager.registerAudioDeviceCallback(new ConnectListener(), new Handler()); in onCreate() 229 scanPeripheralList(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesAdded() 240 scanPeripheralList(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesRemoved()
|
D | USBAudioPeripheralNotificationsTest.java | 48 private AudioManager mAudioManager; field in USBAudioPeripheralNotificationsTest 86 mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE); in onCreate() 87 mAudioManager.registerAudioDeviceCallback(new ConnectListener(), new Handler()); in onCreate() 258 scanDevices(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesAdded() 265 scanDevices(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesRemoved()
|
D | AudioLoopbackBaseActivity.java | 65 protected AudioManager mAudioManager; field in AudioLoopbackBaseActivity 141 mMaxLevel = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); in connectLoopbackUI() 143 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, (int)(0.7 * mMaxLevel), 0); in connectLoopbackUI() 155 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, in connectLoopbackUI() 216 scanPeripheralList(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesAdded() 221 scanPeripheralList(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesRemoved() 324 int currentLevel = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); in refreshLevel() 614 mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE); in onCreate() 616 mAudioManager.registerAudioDeviceCallback(new ConnectListener(), new Handler()); in onCreate()
|
D | AnalogHeadsetAudioActivity.java | 60 private AudioManager mAudioManager; field in AnalogHeadsetAudioActivity 140 mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE); in onCreate() 144 mAudioManager.registerAudioDeviceCallback(new ConnectListener(), new Handler()); in onCreate() 381 scanPeripheralList(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesAdded() 388 scanPeripheralList(mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL)); in onAudioDevicesRemoved()
|
/cts/tests/tests/media/src/android/media/cts/ |
D | AudioManagerTest.java | 122 private AudioManager mAudioManager; field in AudioManagerTest 158 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 184 mOriginalRingerMode = mAudioManager.getRingerMode(); in setUp() 186 mOriginalStreamVolumes.put(streamType, mAudioManager.getStreamVolume(streamType)); in setUp() 202 if (mAudioManager.isMicrophoneMute()) { in setUp() 203 mAudioManager.setMicrophoneMute(false); in setUp() 204 if (mAudioManager.isMicrophoneMute()) { in setUp() 221 mAudioManager.setStreamVolume(e.getKey(), e.getValue(), in tearDown() 224 mAudioManager.setRingerMode(mOriginalRingerMode); in tearDown() 233 mAudioManager.setMicrophoneMute(true); in testMicrophoneMute() [all …]
|
D | AudioCommunicationDeviceTest.java | 37 private AudioManager mAudioManager; field in AudioCommunicationDeviceTest 42 mAudioManager = getInstrumentation().getContext().getSystemService(AudioManager.class); in setUp() 49 List<AudioDeviceInfo> devices = mAudioManager.getAvailableCommunicationDevices(); in testSetValidCommunicationDevice() 52 mAudioManager.setCommunicationDevice(device); in testSetValidCommunicationDevice() 54 commDevice = mAudioManager.getCommunicationDevice(); in testSetValidCommunicationDevice() 70 mAudioManager.clearCommunicationDevice(); in testSetValidCommunicationDevice() 75 commDevice = mAudioManager.getCommunicationDevice(); in testSetValidCommunicationDevice() 87 AudioDeviceInfo[] alldevices = mAudioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS); in testSetInvalidCommunicationDevice() 88 List<AudioDeviceInfo> validDevices = mAudioManager.getAvailableCommunicationDevices(); in testSetInvalidCommunicationDevice() 95 mAudioManager.setCommunicationDevice(device); in testSetInvalidCommunicationDevice() [all …]
|
D | EnumDevicesTest.java | 40 private AudioManager mAudioManager; field in EnumDevicesTest 50 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 51 assertNotNull(mAudioManager); in setUp() 58 deviceList = mAudioManager.getDevices(0); in test_getDevices() 69 deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS); in test_getDevices() 92 deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_INPUTS); in test_getDevices() 107 deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL); in test_getDevices() 115 deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_ALL); in test_devicesInfoFields() 203 mAudioManager.registerAudioDeviceCallback(null,null); in test_deviceCallback() 208 mAudioManager.registerAudioDeviceCallback(callback, null); in test_deviceCallback() [all …]
|
D | AudioModeListenerTest.java | 37 private AudioManager mAudioManager; field in AudioModeListenerTest 42 mAudioManager = getInstrumentation().getContext().getSystemService(AudioManager.class); in setUp() 106 mAudioManager.addOnModeChangedListener(null, listener); in testModeListener() 112 mAudioManager.addOnModeChangedListener( in testModeListener() 119 mAudioManager.removeOnModeChangedListener(null); in testModeListener() 125 mAudioManager.addOnModeChangedListener( in testModeListener() 132 mAudioManager.addOnModeChangedListener( in testModeListener() 138 int originalMode = mAudioManager.getMode(); in testModeListener() 142 mAudioManager.setMode(testMode); in testModeListener() 150 mAudioManager.setMode(originalMode); in testModeListener() [all …]
|
D | RingtoneTest.java | 41 private AudioManager mAudioManager; field in RingtoneTest 54 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 57 mOriginalRingerMode = mAudioManager.getRingerMode(); in setUp() 58 mOriginalVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_RING); in setUp() 61 int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_RING); in setUp() 63 if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE) { in setUp() 64 mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); in setUp() 65 mAudioManager.setStreamVolume(AudioManager.STREAM_RING, maxVolume / 2, in setUp() 67 } else if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { in setUp() 68 mAudioManager.setStreamVolume(AudioManager.STREAM_RING, maxVolume / 2, in setUp() [all …]
|
D | AudioSystemUsageTest.java | 52 private AudioManager mAudioManager; field in AudioSystemUsageTest 57 mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); in setUp() 63 mAudioManager.getSupportedSystemUsages()); in getSupportedSystemUsages_throwsException() 69 mAudioManager.setSupportedSystemUsages(new int[0])); in setSupportedSystemUsage_throwsException() 77 int response = mAudioManager.requestAudioFocus(request); in requestAudioFocus_returnsFailedResponse() 86 int response = mAudioManager.abandonAudioFocusRequest(request); in abandonAudioFocusRequest_returnsFailedResponse() 92 AudioDeviceInfo testDevice = mAudioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)[0]; in trackPlayer_throwsException()
|
D | AudioManagerStub.java | 34 private AudioManager mAudioManager; field in AudioManagerStub 49 mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); in onCreate() 61 mAudioManager.setStreamMute(i, false); in onPause() 62 mAudioManager.setStreamSolo(i, false); in onPause() 75 mAudioManager.setStreamMute(i, true); in onResume() 76 mAudioManager.setStreamSolo(i, true); in onResume()
|
D | MediaActivityTest.java | 83 private AudioManager mAudioManager; field in MediaActivityTest 97 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 101 mStreamVolumeMap.put(stream, mAudioManager.getStreamVolume(stream)); in setUp() 145 mAudioManager.setStreamVolume(stream, volume, /* flag= */ 0); in cleanUp() 149 + volume + ", currentVolume=" + mAudioManager.getStreamVolume(stream)); in cleanUp() 166 if (mStreamVolumeMap.get(testStream) == mAudioManager.getStreamMinVolume(testStream)) { in testVolumeKey_whileSessionAlive() 177 != mAudioManager.getStreamVolume(testStream); in testVolumeKey_whileSessionAlive() 272 if (mAudioManager.getStreamVolume(stream) != volume) { in checkAnyStreamVolumeChanged()
|
D | AudioPlayRoutingNative.java | 37 private AudioManager mAudioManager; field in AudioPlayRoutingNative 48 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 49 assertNotNull(mAudioManager); in setUp() 109 deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS); in testRouting()
|
D | AudioRecordRoutingNative.java | 37 private AudioManager mAudioManager; field in AudioRecordRoutingNative 48 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 49 assertNotNull(mAudioManager); in setUp() 119 deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_INPUTS); in testRouting()
|
D | RingtoneManagerTest.java | 51 private AudioManager mAudioManager; field in RingtoneManagerTest 67 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 72 mOriginalRingerMode = mAudioManager.getRingerMode(); in setUp() 73 if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) { in setUp() 77 mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); in setUp() 91 if (mAudioManager != null) { in tearDown() 92 mAudioManager.setRingerMode(mOriginalRingerMode); in tearDown()
|
D | RoutingTest.java | 82 private AudioManager mAudioManager; field in RoutingTest 90 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 91 assertNotNull(mAudioManager); in setUp() 135 AudioDeviceInfo[] deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS); in test_audioTrack_preferredDevice() 185 mAudioManager.setMode(AudioManager.MODE_NORMAL); in test_audioTrack_incallMusicRoutingPermissions() 192 AudioDeviceInfo[] deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS); in getTelephonyDeviceAndSetInCommunicationMode() 206 mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION); in getTelephonyDeviceAndSetInCommunicationMode() 207 assertEquals(AudioManager.MODE_IN_COMMUNICATION, mAudioManager.getMode()); in getTelephonyDeviceAndSetInCommunicationMode() 415 AudioDeviceInfo[] deviceList = mAudioManager.getDevices(AudioManager.GET_DEVICES_INPUTS); in test_audioRecord_preferredDevice() 460 if (!DeviceUtils.hasOutputDevice(mAudioManager)) { in test_audioTrack_getRoutedDevice() [all …]
|
D | AudioPlaybackCaptureTest.java | 77 private AudioManager mAudioManager; field in AudioPlaybackCaptureTest 143 mAudioManager = mActivity.getSystemService(AudioManager.class); in setup() 179 mAudioManager.generateAudioSessionId()); in createMediaPlayer() 258 mAudioManager.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_SYSTEM); in testPlaybackCapture() 260 mAudioManager.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_NONE); in testPlaybackCapture() 264 mAudioManager.setAllowedCapturePolicy(ALLOW_CAPTURE_BY_ALL); in testPlaybackCapture()
|
D | MediaRouter2Test.java | 86 private AudioManager mAudioManager; field in MediaRouter2Test 106 mAudioManager = (AudioManager) mContext.getSystemService(AUDIO_SERVICE); in setUp() 1000 if (!mAudioManager.isVolumeFixed()) { in testVolumeHandlingWhenVolumeFixed() 1011 if (mAudioManager.isVolumeFixed()) { in testCallbacksAreCalledWhenVolumeChanged() 1015 final int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); in testCallbacksAreCalledWhenVolumeChanged() 1016 final int minVolume = mAudioManager.getStreamMinVolume(AudioManager.STREAM_MUSIC); in testCallbacksAreCalledWhenVolumeChanged() 1017 final int originalVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); in testCallbacksAreCalledWhenVolumeChanged() 1046 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, targetVolume, 0); in testCallbacksAreCalledWhenVolumeChanged() 1050 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, originalVolume, 0); in testCallbacksAreCalledWhenVolumeChanged()
|
/cts/tests/tests/permission/src/android/permission/cts/ |
D | NoAudioPermissionTest.java | 36 private AudioManager mAudioManager; field in NoAudioPermissionTest 42 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 43 assertNotNull(mAudioManager); in setUp() 58 boolean muteState = mAudioManager.isMicrophoneMute(); in testSetMicrophoneMute() 59 int originalMode = mAudioManager.getMode(); in testSetMicrophoneMute() 64 mAudioManager.setMicrophoneMute(!muteState); in testSetMicrophoneMute() 65 assertEquals(muteState, mAudioManager.isMicrophoneMute()); in testSetMicrophoneMute() 71 mAudioManager.setMode(AudioManager.MODE_NORMAL); in testSetMicrophoneMute() 72 assertEquals(originalMode, mAudioManager.getMode()); in testSetMicrophoneMute() 74 mAudioManager.setMode(AudioManager.MODE_RINGTONE); in testSetMicrophoneMute() [all …]
|
/cts/tests/accessibilityservice/src/android/accessibilityservice/cts/ |
D | AccessibilityVolumeTest.java | 44 AudioManager mAudioManager; field in AccessibilityVolumeTest 65 mAudioManager = in setUp() 71 || mAudioManager.isVolumeFixed(); in setUp() 72 final int MIN = mAudioManager.getStreamMinVolume(AudioManager.STREAM_ACCESSIBILITY); in setUp() 73 final int MAX = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_ACCESSIBILITY); in setUp() 83 final int startingVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_ACCESSIBILITY); in testChangeAccessibilityVolume_outsideValidAccessibilityService_shouldFail() 84 final int MIN = mAudioManager.getStreamMinVolume(AudioManager.STREAM_ACCESSIBILITY); in testChangeAccessibilityVolume_outsideValidAccessibilityService_shouldFail() 85 final int MAX = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_ACCESSIBILITY); in testChangeAccessibilityVolume_outsideValidAccessibilityService_shouldFail() 87 mAudioManager.setStreamVolume(AudioManager.STREAM_ACCESSIBILITY, otherVolume, 0); in testChangeAccessibilityVolume_outsideValidAccessibilityService_shouldFail() 89 startingVolume, mAudioManager.getStreamVolume(AudioManager.STREAM_ACCESSIBILITY)); in testChangeAccessibilityVolume_outsideValidAccessibilityService_shouldFail() [all …]
|
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
D | AudioRestrictionTest.java | 36 private AudioManager mAudioManager; field in AudioRestrictionTest 50 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 107 mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 1, /* flag= */ 0); in testDisallowAdjustVolume() 115 mAudioManager.adjustVolume(AudioManager.ADJUST_RAISE, /* flag= */ 0); in testDisallowAdjustVolume() 116 assertEquals(1, mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC)); in testDisallowAdjustVolume() 124 mAudioManager.adjustVolume(AudioManager.ADJUST_RAISE, /* flag= */ 0); in testDisallowAdjustVolume() 128 return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); in testDisallowAdjustVolume() 149 mAudioManager.setMicrophoneMute(false); in testDisallowUnmuteMicrophone() 150 if (mAudioManager.isMicrophoneMute()) { in testDisallowUnmuteMicrophone() 161 return mAudioManager.isMicrophoneMute(); in testDisallowUnmuteMicrophone() [all …]
|
/cts/tests/tests/permission/telephony/src/android/permission/cts/telephony/ |
D | TelephonyManagerPermissionTest.java | 48 private AudioManager mAudioManager; field in TelephonyManagerPermissionTest 57 mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); in setUp() 58 assertNotNull(mAudioManager); in setUp() 179 int audioMode = mAudioManager.getMode(); in testSetMode() 180 mAudioManager.setMode(AudioManager.MODE_IN_CALL); in testSetMode() 181 assertEquals(audioMode, mAudioManager.getMode()); in testSetMode()
|
/cts/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/ |
D | ReadDefaultUris.java | 30 private AudioManager mAudioManager; field in ReadDefaultUris 35 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp()
|