Loading services/audiopolicy/engineconfigurable/wrapper/audio_policy_criteria_conf.h +2 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,8 @@ static const std::string gForceUseCriterionTag[AUDIO_POLICY_FORCE_USE_CNT] = [AUDIO_POLICY_FORCE_FOR_DOCK] = "ForceUseForDock", [AUDIO_POLICY_FORCE_FOR_SYSTEM] = "ForceUseForSystem", [AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] = "ForceUseForHdmiSystemAudio", [AUDIO_POLICY_FORCE_FOR_ENCODED_SURROUND] = "ForceUseForEncodedSurround" [AUDIO_POLICY_FORCE_FOR_ENCODED_SURROUND] = "ForceUseForEncodedSurround", [AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING] = "ForceUseForVibrateRinging" }; Loading services/audiopolicy/enginedefault/src/Engine.cpp +25 −6 Original line number Diff line number Diff line Loading @@ -154,6 +154,13 @@ status_t Engine::setForceUse(audio_policy_force_use_t usage, audio_policy_forced } mForceUse[usage] = config; break; case AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING: if (config != AUDIO_POLICY_FORCE_BT_SCO && config != AUDIO_POLICY_FORCE_NONE) { ALOGW("setForceUse() invalid config %d for FOR_VIBRATE_RINGING", config); return BAD_VALUE; } mForceUse[usage] = config; break; default: ALOGW("setForceUse() invalid usage %d", usage); break; // TODO return BAD_VALUE? Loading Loading @@ -423,8 +430,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy, // if SCO headset is connected and we are told to use it, play ringtone over // speaker and BT SCO if (((availableOutputDevicesType & AUDIO_DEVICE_OUT_ALL_SCO) != 0) && (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO)) { if ((availableOutputDevicesType & AUDIO_DEVICE_OUT_ALL_SCO) != 0) { uint32_t device2 = AUDIO_DEVICE_NONE; device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT; if (device2 == AUDIO_DEVICE_NONE) { Loading @@ -433,12 +439,25 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy, if (device2 == AUDIO_DEVICE_NONE) { device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO; } // Use ONLY Bluetooth SCO output when ringing in vibration mode if (!((mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) && (strategy == STRATEGY_ENFORCED_AUDIBLE))) { if (mForceUse[AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING] == AUDIO_POLICY_FORCE_BT_SCO) { if (device2 != AUDIO_DEVICE_NONE) { device = device2; break; } } } // Use both Bluetooth SCO and phone default output when ringing in normal mode if (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO) { if (device2 != AUDIO_DEVICE_NONE) { device |= device2; break; } } } // The second device used for sonification is the same as the device used by media strategy // FALL THROUGH Loading Loading
services/audiopolicy/engineconfigurable/wrapper/audio_policy_criteria_conf.h +2 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,8 @@ static const std::string gForceUseCriterionTag[AUDIO_POLICY_FORCE_USE_CNT] = [AUDIO_POLICY_FORCE_FOR_DOCK] = "ForceUseForDock", [AUDIO_POLICY_FORCE_FOR_SYSTEM] = "ForceUseForSystem", [AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] = "ForceUseForHdmiSystemAudio", [AUDIO_POLICY_FORCE_FOR_ENCODED_SURROUND] = "ForceUseForEncodedSurround" [AUDIO_POLICY_FORCE_FOR_ENCODED_SURROUND] = "ForceUseForEncodedSurround", [AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING] = "ForceUseForVibrateRinging" }; Loading
services/audiopolicy/enginedefault/src/Engine.cpp +25 −6 Original line number Diff line number Diff line Loading @@ -154,6 +154,13 @@ status_t Engine::setForceUse(audio_policy_force_use_t usage, audio_policy_forced } mForceUse[usage] = config; break; case AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING: if (config != AUDIO_POLICY_FORCE_BT_SCO && config != AUDIO_POLICY_FORCE_NONE) { ALOGW("setForceUse() invalid config %d for FOR_VIBRATE_RINGING", config); return BAD_VALUE; } mForceUse[usage] = config; break; default: ALOGW("setForceUse() invalid usage %d", usage); break; // TODO return BAD_VALUE? Loading Loading @@ -423,8 +430,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy, // if SCO headset is connected and we are told to use it, play ringtone over // speaker and BT SCO if (((availableOutputDevicesType & AUDIO_DEVICE_OUT_ALL_SCO) != 0) && (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO)) { if ((availableOutputDevicesType & AUDIO_DEVICE_OUT_ALL_SCO) != 0) { uint32_t device2 = AUDIO_DEVICE_NONE; device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT; if (device2 == AUDIO_DEVICE_NONE) { Loading @@ -433,12 +439,25 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy, if (device2 == AUDIO_DEVICE_NONE) { device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO; } // Use ONLY Bluetooth SCO output when ringing in vibration mode if (!((mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) && (strategy == STRATEGY_ENFORCED_AUDIBLE))) { if (mForceUse[AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING] == AUDIO_POLICY_FORCE_BT_SCO) { if (device2 != AUDIO_DEVICE_NONE) { device = device2; break; } } } // Use both Bluetooth SCO and phone default output when ringing in normal mode if (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO) { if (device2 != AUDIO_DEVICE_NONE) { device |= device2; break; } } } // The second device used for sonification is the same as the device used by media strategy // FALL THROUGH Loading