rename classes called 'Magic*'

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-04-23 15:26:00 +02:00
parent 3e1c364119
commit b870b0f208
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
10 changed files with 32 additions and 33 deletions

View File

@ -233,7 +233,7 @@ open class BaseActivity : AppCompatActivity() {
@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: CertificateEvent) {
showCertificateDialog(event.x509Certificate, event.magicTrustManager, event.sslErrorHandler)
showCertificateDialog(event.x509Certificate, event.trustManager, event.sslErrorHandler)
}
companion object {

View File

@ -17,7 +17,7 @@ import com.nextcloud.talk.data.user.model.User;
import com.nextcloud.talk.models.json.mention.Mention;
import com.nextcloud.talk.ui.theme.ViewThemeUtils;
import com.nextcloud.talk.utils.DisplayUtils;
import com.nextcloud.talk.utils.MagicCharPolicy;
import com.nextcloud.talk.utils.CharPolicy;
import com.nextcloud.talk.utils.text.Spans;
import com.otaliastudios.autocomplete.AutocompleteCallback;
import com.vanniktech.emoji.EmojiRange;
@ -47,7 +47,7 @@ public class MentionAutocompleteCallback implements AutocompleteCallback<Mention
@OptIn(markerClass = kotlin.ExperimentalStdlibApi.class)
@Override
public boolean onPopupItemClicked(Editable editable, Mention item) {
MagicCharPolicy.TextSpan range = MagicCharPolicy.getQueryRange(editable);
CharPolicy.TextSpan range = CharPolicy.getQueryRange(editable);
if (range == null) {
return false;
}

View File

@ -190,7 +190,7 @@ import com.nextcloud.talk.utils.DisplayUtils
import com.nextcloud.talk.utils.FileUtils
import com.nextcloud.talk.utils.FileViewerUtils
import com.nextcloud.talk.utils.ImageEmojiEditText
import com.nextcloud.talk.utils.MagicCharPolicy
import com.nextcloud.talk.utils.CharPolicy
import com.nextcloud.talk.utils.Mimetype
import com.nextcloud.talk.utils.NotificationUtils
import com.nextcloud.talk.utils.ParticipantPermissions
@ -3379,7 +3379,7 @@ class ChatActivity :
mentionAutocomplete = Autocomplete.on<Mention>(binding.messageInputView.inputEditText)
.with(elevation)
.with(backgroundDrawable)
.with(MagicCharPolicy('@'))
.with(CharPolicy('@'))
.with(presenter)
.with(callback)
.build()

View File

@ -36,7 +36,7 @@ public class CertificateEvent {
return x509Certificate;
}
public TrustManager getMagicTrustManager() {
public TrustManager getTrustManager() {
return trustManager;
}
}

View File

@ -15,11 +15,11 @@ import com.otaliastudios.autocomplete.AutocompletePolicy;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MagicCharPolicy implements AutocompletePolicy {
public class CharPolicy implements AutocompletePolicy {
private final char character;
public MagicCharPolicy(char character) {
public CharPolicy(char character) {
this.character = character;
}

View File

@ -29,7 +29,6 @@ import org.webrtc.PeerConnection;
import org.webrtc.PeerConnectionFactory;
import org.webrtc.RtpReceiver;
import org.webrtc.RtpTransceiver;
import org.webrtc.SdpObserver;
import org.webrtc.SessionDescription;
import org.webrtc.VideoTrack;
@ -68,7 +67,7 @@ public class PeerConnectionWrapper {
private String sessionId;
private final MediaConstraints mediaConstraints;
private DataChannel dataChannel;
private final MagicSdpObserver magicSdpObserver;
private final SdpObserver sdpObserver;
private final boolean hasInitiated;
@ -127,13 +126,13 @@ public class PeerConnectionWrapper {
this.sessionId = sessionId;
this.mediaConstraints = mediaConstraints;
magicSdpObserver = new MagicSdpObserver();
sdpObserver = new SdpObserver();
hasInitiated = sessionId.compareTo(localSession) < 0;
this.isMCUPublisher = isMCUPublisher;
PeerConnection.RTCConfiguration configuration = new PeerConnection.RTCConfiguration(iceServerList);
configuration.sdpSemantics = PeerConnection.SdpSemantics.UNIFIED_PLAN;
peerConnection = peerConnectionFactory.createPeerConnection(configuration, new MagicPeerConnectionObserver());
peerConnection = peerConnectionFactory.createPeerConnection(configuration, new InitialPeerConnectionObserver());
this.signalingMessageReceiver = signalingMessageReceiver;
this.signalingMessageReceiver.addListener(webRtcMessageListener, sessionId, videoStreamType);
@ -155,9 +154,9 @@ public class PeerConnectionWrapper {
DataChannel.Init init = new DataChannel.Init();
init.negotiated = false;
dataChannel = peerConnection.createDataChannel("status", init);
dataChannel.registerObserver(new MagicDataChannelObserver());
dataChannel.registerObserver(new DataChannelObserver());
if (isMCUPublisher) {
peerConnection.createOffer(magicSdpObserver, mediaConstraints);
peerConnection.createOffer(sdpObserver, mediaConstraints);
} else if (hasMCU && "video".equals(this.videoStreamType)) {
// If the connection type is "screen" the client sharing the screen will send an
// offer; offers should be requested only for videos.
@ -168,7 +167,7 @@ public class PeerConnectionWrapper {
} else if (!hasMCU && hasInitiated && "video".equals(this.videoStreamType)) {
// If the connection type is "screen" the client sharing the screen will send an
// offer; offers should be created only for videos.
peerConnection.createOffer(magicSdpObserver, mediaConstraints);
peerConnection.createOffer(sdpObserver, mediaConstraints);
}
}
}
@ -358,7 +357,7 @@ public class PeerConnectionWrapper {
sessionDescriptionStringWithPreferredCodec);
if (getPeerConnection() != null) {
getPeerConnection().setRemoteDescription(magicSdpObserver, sessionDescriptionWithPreferredCodec);
getPeerConnection().setRemoteDescription(sdpObserver, sessionDescriptionWithPreferredCodec);
}
}
@ -372,7 +371,7 @@ public class PeerConnectionWrapper {
}
}
private class MagicDataChannelObserver implements DataChannel.Observer {
private class DataChannelObserver implements DataChannel.Observer {
@Override
public void onBufferedAmountChange(long l) {
@ -451,7 +450,7 @@ public class PeerConnectionWrapper {
}
}
private class MagicPeerConnectionObserver implements PeerConnection.Observer {
private class InitialPeerConnectionObserver implements PeerConnection.Observer {
@Override
public void onSignalingChange(PeerConnection.SignalingState signalingState) {
@ -523,7 +522,7 @@ public class PeerConnectionWrapper {
+ " exists, but received onDataChannel event for DataChannel with label " + dataChannel.label());
}
PeerConnectionWrapper.this.dataChannel = dataChannel;
PeerConnectionWrapper.this.dataChannel.registerObserver(new MagicDataChannelObserver());
PeerConnectionWrapper.this.dataChannel.registerObserver(new DataChannelObserver());
}
@Override
@ -536,8 +535,8 @@ public class PeerConnectionWrapper {
}
}
private class MagicSdpObserver implements SdpObserver {
private static final String TAG = "MagicSdpObserver";
private class SdpObserver implements org.webrtc.SdpObserver {
private static final String TAG = "SdpObserver";
@Override
public void onCreateFailure(String s) {
@ -573,7 +572,7 @@ public class PeerConnectionWrapper {
signalingMessageSender.send(ncSignalingMessage);
if (peerConnection != null) {
peerConnection.setLocalDescription(magicSdpObserver, sessionDescriptionWithPreferredCodec);
peerConnection.setLocalDescription(sdpObserver, sessionDescriptionWithPreferredCodec);
}
}
@ -595,7 +594,7 @@ public class PeerConnectionWrapper {
Passed 'MediaConstraints' will be ignored by WebRTC when using UNIFIED PLAN.
See for details: https://docs.google.com/document/d/1PPHWV6108znP1tk_rkCnyagH9FK205hHeE9k5mhUzOg/edit#heading=h.9dcmkavg608r
*/
peerConnection.createAnswer(magicSdpObserver, new MediaConstraints());
peerConnection.createAnswer(sdpObserver, new MediaConstraints());
}

View File

@ -16,7 +16,7 @@ import android.util.Log;
import org.webrtc.ThreadUtils;
/**
* MagicProximitySensor manages functions related to the proximity sensor in
* ProximitySensor manages functions related to the proximity sensor in
* the app.
* On most device, the proximity sensor is implemented as a boolean-sensor.
* It returns just two values "NEAR" or "FAR". Thresholding is done on the LUX
@ -24,8 +24,8 @@ import org.webrtc.ThreadUtils;
* A LUX-value more than the threshold means the proximity sensor returns "FAR".
* Anything less than the threshold value and the sensor returns "NEAR".
*/
public class MagicProximitySensor implements SensorEventListener {
private static final String TAG = "MagicProximitySensor";
public class ProximitySensor implements SensorEventListener {
private static final String TAG = "ProximitySensor";
// This class should be created, started and stopped on one thread
// (e.g. the main thread). We use |nonThreadSafe| to ensure that this is
@ -37,7 +37,7 @@ public class MagicProximitySensor implements SensorEventListener {
private Sensor proximitySensor = null;
private boolean lastStateReportIsNear = false;
private MagicProximitySensor(Context context, Runnable sensorStateListener) {
private ProximitySensor(Context context, Runnable sensorStateListener) {
onSensorStateListener = sensorStateListener;
sensorManager = ((SensorManager) context.getSystemService(Context.SENSOR_SERVICE));
}
@ -45,8 +45,8 @@ public class MagicProximitySensor implements SensorEventListener {
/**
* Construction
*/
static MagicProximitySensor create(Context context, Runnable sensorStateListener) {
return new MagicProximitySensor(context, sensorStateListener);
static ProximitySensor create(Context context, Runnable sensorStateListener) {
return new ProximitySensor(context, sensorStateListener);
}
/**

View File

@ -25,7 +25,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class WebRTCUtils {
private static final String TAG = "MagicWebRTCUtils";
private static final String TAG = "WebRTCUtils";
private static final Set<String> HARDWARE_ACCELERATION_DEVICE_EXCLUDE_SET = new HashSet<String>() {{
add("GT-I9100"); // Samsung Galaxy S2

View File

@ -56,7 +56,7 @@ public class WebRtcAudioManager {
private AudioDevice userSelectedAudioDevice;
private AudioDevice currentAudioDevice;
private MagicProximitySensor proximitySensor = null;
private ProximitySensor proximitySensor = null;
private Set<AudioDevice> audioDevices = new HashSet<>();
@ -83,7 +83,7 @@ public class WebRtcAudioManager {
// Create and initialize the proximity sensor.
// Tablet devices (e.g. Nexus 7) does not support proximity sensors.
// Note that, the sensor will not be active until start() has been called.
proximitySensor = MagicProximitySensor.create(context, new Runnable() {
proximitySensor = ProximitySensor.create(context, new Runnable() {
// This method will be called each time a state change is detected.
// Example: user holds his hand over the device (closer than ~5 cm),
// or removes his hand from the device.

View File

@ -107,7 +107,7 @@ public class WebRtcBluetoothManager {
* is connected and enabled:
* UNINITIALIZED --> HEADSET_UNAVAILABLE --> HEADSET_AVAILABLE -->
* SCO_CONNECTING --> SCO_CONNECTED <==> audio is now routed via BT SCO.
* Note that the MagicAudioManager is also involved in driving this state
* Note that the AudioManager is also involved in driving this state
* change.
*/
@SuppressLint("MissingPermission")