- 方法一,修改frameworks/av//services/audiopolicy/enginedefault/src/Engine.cpp
Engine::getDeviceForStrategyInt()函数的case STRATEGY_PHONE下
switch (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]) {
...
default: // FORCE_NONE
....
device = availableOutputDevicesType & AUDIO_DEVICE_OUT_EARPIECE;
break;
改为device = availableOutputDevicesType &AUDIO_DEVICE_OUT_SPEAKER;
编译生成libaudiopolicyenginedefault.so位于out的system/lib和system/lib64目录下。
2.方法二,hardware\qcom\audio\configs\msm8953\mixer_paths_mtp.xml
<path name="voice-handset">
<!--<path name="handset" /> -->改前
<path name="speaker" />改后
</path>