Small refactoring

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-01-28 14:34:58 +01:00
parent 6581d9b4d2
commit bfb377ee9a
5 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Nextcloud Talk application&#10; &#10;@author Mario Danic&#10;Copyright (C) 2017 Mario Danic &lt;mario@lovelyhq.com&gt;&#10; &#10;This program is free software: you can redistribute it and/or modify&#10;it under the terms of the GNU General Public License as published by&#10;the Free Software Foundation, either version 3 of the License, or&#10;at your option) any later version.&#10; &#10;This program is distributed in the hope that it will be useful,&#10;but WITHOUT ANY WARRANTY; without even the implied warranty of&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10;GNU General Public License for more details.&#10; &#10;You should have received a copy of the GNU General Public License&#10;along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;." />
<option name="notice" value="Nextcloud Talk application&#10; &#10;@author Mario Danic&#10;Copyright (C) 2017-2018 Mario Danic &lt;mario@lovelyhq.com&gt;&#10; &#10;This program is free software: you can redistribute it and/or modify&#10;it under the terms of the GNU General Public License as published by&#10;the Free Software Foundation, either version 3 of the License, or&#10;at your option) any later version.&#10; &#10;This program is distributed in the hope that it will be useful,&#10;but WITHOUT ANY WARRANTY; without even the implied warranty of&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10;GNU General Public License for more details.&#10; &#10;You should have received a copy of the GNU General Public License&#10;along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;." />
<option name="myName" value="GPL3" />
</copyright>
</component>

View File

@ -81,7 +81,7 @@ import com.nextcloud.talk.utils.database.user.UserUtils;
import com.nextcloud.talk.webrtc.MagicAudioManager;
import com.nextcloud.talk.webrtc.MagicPeerConnectionWrapper;
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
import com.nextcloud.talk.webrtc.MagicWebRtcLists;
import com.nextcloud.talk.webrtc.MagicWebRTCLists;
import org.apache.commons.lang3.StringEscapeUtils;
import org.greenrobot.eventbus.EventBus;
@ -487,8 +487,8 @@ public class CallActivity extends AppCompatActivity {
if (camera2EnumeratorIsSupported) {
cameraEnumerator = new Camera2Enumerator(this);
} else {
cameraEnumerator = new Camera1Enumerator(!MagicWebRtcLists.HARDWARE_ACCELERATION_VENDOR_BLACKLIST.contains(Build
.MANUFACTURER.toLowerCase()) && !MagicWebRtcLists.HARDWARE_ACCELERATION_DEVICE_BLACKLIST.contains
cameraEnumerator = new Camera1Enumerator(!MagicWebRTCLists.HARDWARE_ACCELERATION_VENDOR_BLACKLIST.contains(Build
.MANUFACTURER.toLowerCase()) && !MagicWebRTCLists.HARDWARE_ACCELERATION_DEVICE_BLACKLIST.contains
(Build.MODEL));
}
}

View File

@ -40,7 +40,7 @@ import com.nextcloud.talk.jobs.AccountRemovalJob;
import com.nextcloud.talk.jobs.PushRegistrationJob;
import com.nextcloud.talk.jobs.creator.MagicJobCreator;
import com.nextcloud.talk.utils.database.user.UserModule;
import com.nextcloud.talk.webrtc.MagicWebRtcLists;
import com.nextcloud.talk.webrtc.MagicWebRTCLists;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
@ -114,17 +114,17 @@ public class NextcloudTalkApplication extends MultiDexApplication {
private void initializeWebRtc() {
try {
if (MagicWebRtcLists.HARDWARE_AEC_BLACKLIST.contains(Build.MODEL)) {
if (MagicWebRTCLists.HARDWARE_AEC_BLACKLIST.contains(Build.MODEL)) {
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
}
if (!MagicWebRtcLists.OPEN_SL_ES_WHITELIST.contains(Build.MODEL)) {
if (!MagicWebRTCLists.OPEN_SL_ES_WHITELIST.contains(Build.MODEL)) {
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
}
PeerConnectionFactory.initialize(PeerConnectionFactory.InitializationOptions.builder(this)
.setEnableVideoHwAcceleration(!MagicWebRtcLists.HARDWARE_ACCELERATION_VENDOR_BLACKLIST.contains(Build
.MANUFACTURER.toLowerCase()) && !MagicWebRtcLists.HARDWARE_ACCELERATION_DEVICE_BLACKLIST
.setEnableVideoHwAcceleration(!MagicWebRTCLists.HARDWARE_ACCELERATION_VENDOR_BLACKLIST.contains(Build
.MANUFACTURER.toLowerCase()) && !MagicWebRTCLists.HARDWARE_ACCELERATION_DEVICE_BLACKLIST
.contains(Build.MODEL))
.createInitializationOptions());
} catch (UnsatisfiedLinkError e) {

View File

@ -26,7 +26,8 @@
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
* be found in the AUTHORS file in the root of the source tree.
*
*/
package com.nextcloud.talk.webrtc;

View File

@ -23,7 +23,7 @@ package com.nextcloud.talk.webrtc;
import java.util.HashSet;
import java.util.Set;
public class MagicWebRtcLists {
public class MagicWebRTCLists {
/*
AEC blacklist and SL_ES_WHITELIST are borrowed from Signal
https://github.com/WhisperSystems/Signal-Android/blob/551470123d006b76a68d705d131bb12513a5e683/src/org/thoughtcrime/securesms/ApplicationContext.java