Lines Matching refs:AudioSystem

50                                                   AudioSystem::device_connection_state state,
87 case AudioSystem::DEVICE_STATE_AVAILABLE:
129 case AudioSystem::DEVICE_STATE_UNAVAILABLE: {
168 if ((state == AudioSystem::DEVICE_STATE_UNAVAILABLE) ||
203 case AudioSystem::DEVICE_STATE_AVAILABLE: {
213 case AudioSystem::DEVICE_STATE_UNAVAILABLE: {
247 AudioSystem::device_connection_state AudioPolicyManagerBase::getDeviceConnectionState(audio_devices_t device,
250 AudioSystem::device_connection_state state = AudioSystem::DEVICE_STATE_UNAVAILABLE;
270 state = AudioSystem::DEVICE_STATE_AVAILABLE;
274 state = AudioSystem::DEVICE_STATE_AVAILABLE;
285 if (state < 0 || state >= AudioSystem::NUM_MODES) {
299 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
382 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
388 if (state == AudioSystem::MODE_RINGTONE &&
389 isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY)) {
396 void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config)
402 case AudioSystem::FOR_COMMUNICATION:
403 if (config != AudioSystem::FORCE_SPEAKER && config != AudioSystem::FORCE_BT_SCO &&
404 config != AudioSystem::FORCE_NONE) {
411 case AudioSystem::FOR_MEDIA:
412 if (config != AudioSystem::FORCE_HEADPHONES && config != AudioSystem::FORCE_BT_A2DP &&
413 config != AudioSystem::FORCE_WIRED_ACCESSORY &&
414 config != AudioSystem::FORCE_ANALOG_DOCK &&
415 config != AudioSystem::FORCE_DIGITAL_DOCK && config != AudioSystem::FORCE_NONE &&
416 config != AudioSystem::FORCE_NO_BT_A2DP) {
422 case AudioSystem::FOR_RECORD:
423 if (config != AudioSystem::FORCE_BT_SCO && config != AudioSystem::FORCE_WIRED_ACCESSORY &&
424 config != AudioSystem::FORCE_NONE) {
430 case AudioSystem::FOR_DOCK:
431 if (config != AudioSystem::FORCE_NONE && config != AudioSystem::FORCE_BT_CAR_DOCK &&
432 config != AudioSystem::FORCE_BT_DESK_DOCK &&
433 config != AudioSystem::FORCE_WIRED_ACCESSORY &&
434 config != AudioSystem::FORCE_ANALOG_DOCK &&
435 config != AudioSystem::FORCE_DIGITAL_DOCK) {
441 case AudioSystem::FOR_SYSTEM:
442 if (config != AudioSystem::FORCE_NONE &&
443 config != AudioSystem::FORCE_SYSTEM_ENFORCED) {
483 AudioSystem::forced_config AudioPolicyManagerBase::getForceUse(AudioSystem::force_use usage)
530 audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type stream,
534 AudioSystem::output_flags flags,
539 routing_strategy strategy = getStrategy((AudioSystem::stream_type)stream);
557 outputDesc->mFlags = (audio_output_flags_t)(mDirectOutput ? AudioSystem::OUTPUT_FLAG_DIRECT : 0);
582 flags = (AudioSystem::output_flags)(flags | AUDIO_OUTPUT_FLAG_DIRECT);
688 AudioSystem::output_flags flags)
711 int commonFlags = (int)AudioSystem::popCount(outputDesc->mProfile->mFlags & flags);
734 AudioSystem::stream_type stream,
802 AudioSystem::stream_type stream,
882 if (desc->mFlags & AudioSystem::OUTPUT_FLAG_DIRECT) {
905 AudioSystem::audio_in_acoustics acoustics)
921 channelMask = AudioSystem::CHANNEL_IN_VOICE_UPLINK;
924 channelMask = AudioSystem::CHANNEL_IN_VOICE_DNLINK;
927 channelMask = (AudioSystem::CHANNEL_IN_VOICE_UPLINK | AudioSystem::CHANNEL_IN_VOICE_DNLINK);
1018 AudioSystem::DEVICE_STATE_AVAILABLE, AUDIO_REMOTE_SUBMIX_DEVICE_ADDRESS);
1053 AudioSystem::DEVICE_STATE_UNAVAILABLE, AUDIO_REMOTE_SUBMIX_DEVICE_ADDRESS);
1078 void AudioPolicyManagerBase::initStreamVolume(AudioSystem::stream_type stream,
1091 status_t AudioPolicyManagerBase::setStreamVolumeIndex(AudioSystem::stream_type stream,
1131 status_t AudioPolicyManagerBase::getStreamVolumeIndex(AudioSystem::stream_type stream,
1198 routing_strategy strategy = getStrategy(AudioSystem::MUSIC);
1332 if (outputDesc->isStreamActive((AudioSystem::stream_type)stream, inPastMs, sysTime)) {
1345 outputDesc->isStreamActive((AudioSystem::stream_type)stream, inPastMs, sysTime)) {
1390 snprintf(buffer, SIZE, " Force use for communications %d\n", mForceUse[AudioSystem::FOR_COMMUNICATION]);
1392 snprintf(buffer, SIZE, " Force use for media %d\n", mForceUse[AudioSystem::FOR_MEDIA]);
1394 snprintf(buffer, SIZE, " Force use for record %d\n", mForceUse[AudioSystem::FOR_RECORD]);
1396 snprintf(buffer, SIZE, " Force use for dock %d\n", mForceUse[AudioSystem::FOR_DOCK]);
1398 snprintf(buffer, SIZE, " Force use for system %d\n", mForceUse[AudioSystem::FOR_SYSTEM]);
1432 for (size_t i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
1532 mPhoneState(AudioSystem::MODE_NORMAL),
1540 for (int i = 0; i < AudioSystem::NUM_FORCE_USE; i++) {
1541 mForceUse[i] = AudioSystem::FORCE_NONE;
1620 mTestFormat = AudioSystem::PCM_16_BIT;
1621 mTestChannels = AudioSystem::CHANNEL_OUT_STEREO;
1702 int format = AudioSystem::INVALID_FORMAT;
1704 format = AudioSystem::PCM_16_BIT;
1706 format = AudioSystem::PCM_8_BIT;
1708 format = AudioSystem::MP3;
1710 if (format != AudioSystem::INVALID_FORMAT) {
1725 channels = AudioSystem::CHANNEL_OUT_STEREO;
1727 channels = AudioSystem::CHANNEL_OUT_MONO;
1820 AudioSystem::device_connection_state state,
1825 if (state == AudioSystem::DEVICE_STATE_AVAILABLE) {
2048 for (int j = 0; j < (int)AudioSystem::NUM_STREAM_TYPES; j++) {
2050 outputDesc2->changeRefCount((AudioSystem::stream_type)j,-refCount);
2141 for (int i = 0; i < (int)AudioSystem::NUM_STREAM_TYPES; i++) {
2142 if (getStrategy((AudioSystem::stream_type)i) == strategy) {
2144 mpClientInterface->setStreamOutput((AudioSystem::stream_type)i,
2201 ((mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO) &&
2202 (mForceUse[AudioSystem::FOR_RECORD] != AudioSystem::FORCE_BT_SCO))) &&
2203 ((mPhoneState != AudioSystem::MODE_IN_CALL) &&
2204 (mPhoneState != AudioSystem::MODE_RINGTONE))) {
2211 ((mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) ||
2212 (mForceUse[AudioSystem::FOR_RECORD] == AudioSystem::FORCE_BT_SCO))) ||
2213 ((mPhoneState == AudioSystem::MODE_IN_CALL) ||
2214 (mPhoneState == AudioSystem::MODE_RINGTONE))) {
2259 uint32_t AudioPolicyManagerBase::getStrategyForStream(AudioSystem::stream_type stream) {
2263 audio_devices_t AudioPolicyManagerBase::getDevicesForStream(AudioSystem::stream_type stream) {
2268 if (stream < (AudioSystem::stream_type) 0 || stream >= AudioSystem::NUM_STREAM_TYPES) {
2278 AudioSystem::stream_type stream) {
2281 case AudioSystem::VOICE_CALL:
2282 case AudioSystem::BLUETOOTH_SCO:
2284 case AudioSystem::RING:
2285 case AudioSystem::ALARM:
2287 case AudioSystem::NOTIFICATION:
2289 case AudioSystem::DTMF:
2293 case AudioSystem::SYSTEM:
2296 case AudioSystem::TTS:
2297 case AudioSystem::MUSIC:
2299 case AudioSystem::ENFORCED_AUDIBLE:
2304 void AudioPolicyManagerBase::handleNotificationRoutingForStream(AudioSystem::stream_type stream) {
2306 case AudioSystem::MUSIC:
2331 } else if (isStreamActiveRemotely(AudioSystem::MUSIC,
2338 } else if (isStreamActive(AudioSystem::MUSIC, SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
2360 switch (mForceUse[AudioSystem::FOR_COMMUNICATION]) {
2361 case AudioSystem::FORCE_BT_SCO:
2376 (mForceUse[AudioSystem::FOR_MEDIA] != AudioSystem::FORCE_NO_BT_A2DP) &&
2387 if (mPhoneState != AudioSystem::MODE_IN_CALL) {
2407 case AudioSystem::FORCE_SPEAKER:
2411 (mForceUse[AudioSystem::FOR_MEDIA] != AudioSystem::FORCE_NO_BT_A2DP) &&
2416 if (mPhoneState != AudioSystem::MODE_IN_CALL) {
2455 (mForceUse[AudioSystem::FOR_SYSTEM] == AudioSystem::FORCE_SYSTEM_ENFORCED)) {
2471 mHasA2dp && (mForceUse[AudioSystem::FOR_MEDIA] != AudioSystem::FORCE_NO_BT_A2DP) &&
2501 (mForceUse[AudioSystem::FOR_DOCK] == AudioSystem::FORCE_ANALOG_DOCK)) {
2548 bool shouldMute = outputDesc->isActive() && (AudioSystem::popCount(device) >= 2);
2704 if (mForceUse[AudioSystem::FOR_RECORD] == AudioSystem::FORCE_BT_SCO &&
2768 } else if (AudioSystem::popCount(device) > 1) {
2781 ALOGW_IF(AudioSystem::popCount(device) != 1,
3005 if (stream == AudioSystem::MUSIC &&
3021 const routing_strategy stream_strategy = getStrategy((AudioSystem::stream_type)stream);
3028 || (stream == AudioSystem::SYSTEM)
3030 (mForceUse[AudioSystem::FOR_SYSTEM] == AudioSystem::FORCE_NONE))) &&
3036 if (isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY) ||
3039 float musicVol = computeVolume(AudioSystem::MUSIC,
3040 mStreams[AudioSystem::MUSIC].getVolumeIndex(musicDevice),
3071 if ((stream == AudioSystem::VOICE_CALL && mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) ||
3072 (stream == AudioSystem::BLUETOOTH_SCO && mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO)) {
3074 stream, mForceUse[AudioSystem::FOR_COMMUNICATION]);
3088 if (stream == AudioSystem::BLUETOOTH_SCO) {
3089 mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs);
3091 mpClientInterface->setStreamVolume((AudioSystem::stream_type)stream, volume, output, delayMs);
3094 if (stream == AudioSystem::VOICE_CALL ||
3095 stream == AudioSystem::BLUETOOTH_SCO) {
3098 if (stream == AudioSystem::VOICE_CALL) {
3120 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
3137 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
3138 if (getStrategy((AudioSystem::stream_type)stream) == strategy) {
3162 ((stream != AudioSystem::ENFORCED_AUDIBLE) ||
3163 (mForceUse[AudioSystem::FOR_SYSTEM] == AudioSystem::FORCE_NONE))) {
3192 const routing_strategy stream_strategy = getStrategy((AudioSystem::stream_type)stream);
3203 if (AudioSystem::isLowVisibility((AudioSystem::stream_type)stream)) {
3218 mpClientInterface->startTone(ToneGenerator::TONE_SUP_CALL_WAITING, AudioSystem::VOICE_CALL);
3233 return ((state == AudioSystem::MODE_IN_CALL) ||
3234 (state == AudioSystem::MODE_IN_COMMUNICATION));
3257 for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
3304 void AudioPolicyManagerBase::AudioOutputDescriptor::changeRefCount(AudioSystem::stream_type stream, int delta)
3341 for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
3342 if (((getStrategy((AudioSystem::stream_type)i) == strategy) ||
3344 isStreamActive((AudioSystem::stream_type)i, inPastMs, sysTime)) {
3351 bool AudioPolicyManagerBase::AudioOutputDescriptor::isStreamActive(AudioSystem::stream_type stream,
3391 for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {