Disable OpenSL ES by default

Fixes #6432
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-05-09 11:03:32 -07:00
parent 51d6144591
commit 3fd5e58bd5

View File

@ -179,12 +179,13 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
private void initializeWebRtc() {
Set<String> HARDWARE_AEC_WHITELIST = new HashSet<String>() {{
add("D5803");
add("FP1");
add("SM-A500FU");
add("XT1092");
}};
Set<String> OPEN_SL_ES_BLACKLIST = new HashSet<String>() {{
add("MI 4LTE"); // Xiami Mi4 #6241
add("Nexus 5"); // Nexus 5 #6432
add("LG-D852"); // LG G3 #6432
Set<String> OPEN_SL_ES_WHITELIST = new HashSet<String>() {{
}};
if (Build.VERSION.SDK_INT >= 11) {
@ -194,7 +195,9 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
}
if (OPEN_SL_ES_BLACKLIST.contains(Build.MODEL)) {
if (OPEN_SL_ES_WHITELIST.contains(Build.MODEL)) {
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(false);
} else {
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
}