Lines Matching refs:device

26 // Max volume for streams when playing over bluetooth SCO device while in call: -18dB
54 uint32_t device = 0;
57 device = mDeviceForStrategy[strategy];
58 ALOGV("getDeviceForStrategy() from cache strategy %d, device %x", strategy, device);
59 return device;
66 device = getDeviceForStrategy(STRATEGY_MEDIA, false);
78 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
79 if (device) break;
82 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_HEADSET;
83 if (device) break;
84 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO;
85 if (device) break;
86 // if SCO device is requested but no SCO device is available, fall back to default case
90 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE;
91 if (device) break;
92 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET;
93 if (device) break;
99 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP;
101 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
103 if (device) break;
105 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP;
106 if (device) break;
107 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
108 if (device) break;
110 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_EARPIECE;
111 if (device == 0) {
112 ALOGE("getDeviceForStrategy() earpiece device not found");
118 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
119 if (device) break;
125 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP;
126 if (device) break;
130 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
131 if (device) break;
133 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
134 if (device == 0) {
135 ALOGE("getDeviceForStrategy() speaker device not found");
143 // If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by
146 device = getDeviceForStrategy(STRATEGY_PHONE, false);
153 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
154 if (device == 0) {
155 ALOGE("getDeviceForStrategy() speaker device not found");
159 device |= AudioSystem::DEVICE_OUT_WIRED_HEADPHONE;
161 device |= AudioSystem::DEVICE_OUT_WIRED_HEADSET;
166 device = 0;
168 // The second device used for sonification is the same as the device used by media strategy
169 // Note that when docked, we pick the device below (no duplication)
210 device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
212 // device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION, 0 otherwise
213 device |= device2;
214 if (device == 0) {
215 ALOGE("getDeviceForStrategy() speaker device not found");
217 // Do not play media stream if in call and the requested device would change the hardware
220 !AudioSystem::isA2dpDevice((AudioSystem::audio_devices)device) &&
221 device != getDeviceForStrategy(STRATEGY_PHONE, false)) {
222 device = 0;
232 ALOGV("getDeviceForStrategy() strategy %d, device %x", strategy, device);
233 return device;
236 float AudioPolicyManager::computeVolume(int stream, int index, audio_io_handle_t output, uint32_t device)
242 return AudioPolicyManagerBase::computeVolume(stream, index, output, device);
254 float volume = AudioPolicyManagerBase::computeVolume(stream, index, output, device);
256 // limit stream volume when in call and playing over bluetooth SCO device to
258 if (mPhoneState == AudioSystem::MODE_IN_CALL && AudioSystem::isBluetoothScoDevice((AudioSystem::audio_devices)device)) {
270 (device & (AudioSystem::DEVICE_OUT_WIRED_HEADPHONE |