From 41585699d2bc7452d415a2cbeabcd989158eb5a0 Mon Sep 17 00:00:00 2001 From: Jim Gustafson Date: Fri, 15 Oct 2021 14:02:48 -0700 Subject: [PATCH] Move device specific control to RingRTC --- .../securesms/ApplicationContext.java | 10 ---- .../securesms/RtcDeviceLists.java | 48 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 app/src/main/java/org/thoughtcrime/securesms/RtcDeviceLists.java diff --git a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java index 62d0a65410..da651921d4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java @@ -82,8 +82,6 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.thoughtcrime.securesms.util.Util; import org.thoughtcrime.securesms.util.VersionTracker; import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageContextWrapper; -import org.webrtc.voiceengine.WebRtcAudioManager; -import org.webrtc.voiceengine.WebRtcAudioUtils; import org.whispersystems.libsignal.logging.SignalProtocolLoggerProvider; import java.security.Security; @@ -343,14 +341,6 @@ public class ApplicationContext extends MultiDexApplication implements AppForegr private void initializeRingRtc() { try { - if (RtcDeviceLists.hardwareAECBlocked()) { - WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true); - } - - if (!RtcDeviceLists.openSLESAllowed()) { - WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true); - } - CallManager.initialize(this, new RingRtcLogger()); } catch (UnsatisfiedLinkError e) { throw new AssertionError("Unable to load ringrtc library", e); diff --git a/app/src/main/java/org/thoughtcrime/securesms/RtcDeviceLists.java b/app/src/main/java/org/thoughtcrime/securesms/RtcDeviceLists.java deleted file mode 100644 index e7e6bf9e15..0000000000 --- a/app/src/main/java/org/thoughtcrime/securesms/RtcDeviceLists.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.thoughtcrime.securesms; - -import android.os.Build; - -import java.util.HashSet; -import java.util.Set; - -/** - * Device hardware capability lists. - *

- * Moved outside of ApplicationContext as the indirection was important for API19 support with desugaring: https://issuetracker.google.com/issues/183419297 - */ -final class RtcDeviceLists { - - private RtcDeviceLists() {} - - static Set hardwareAECBlockList() { - return new HashSet() {{ - add("Pixel"); - add("Pixel XL"); - add("Moto G5"); - add("Moto G (5S) Plus"); - add("Moto G4"); - add("TA-1053"); - add("Mi A1"); - add("Mi A2"); - add("E5823"); // Sony z5 compact - add("Redmi Note 5"); - add("FP2"); // Fairphone FP2 - add("MI 5"); - }}; - } - - static Set openSlEsAllowList() { - return new HashSet() {{ - add("Pixel"); - add("Pixel XL"); - }}; - } - - static boolean hardwareAECBlocked() { - return hardwareAECBlockList().contains(Build.MODEL); - } - - static boolean openSLESAllowed() { - return openSlEsAllowList().contains(Build.MODEL); - } -}