|
@@ -440,7 +440,7 @@ public class CallActivity extends CallBaseActivity {
|
|
binding.gridview.setOnItemClickListener((parent, view, position, id) -> animateCallControls(true, 0));
|
|
binding.gridview.setOnItemClickListener((parent, view, position, id) -> animateCallControls(true, 0));
|
|
|
|
|
|
binding.callStates.callStateRelativeLayout.setOnClickListener(l -> {
|
|
binding.callStates.callStateRelativeLayout.setOnClickListener(l -> {
|
|
- if (currentCallStatus.equals(CallStatus.CALLING_TIMEOUT)) {
|
|
|
|
|
|
+ if (currentCallStatus == CallStatus.CALLING_TIMEOUT) {
|
|
setCallState(CallStatus.RECONNECTING);
|
|
setCallState(CallStatus.RECONNECTING);
|
|
hangupNetworkCalls(false);
|
|
hangupNetworkCalls(false);
|
|
}
|
|
}
|
|
@@ -747,7 +747,7 @@ public class CallActivity extends CallBaseActivity {
|
|
}
|
|
}
|
|
|
|
|
|
private boolean isConnectionEstablished() {
|
|
private boolean isConnectionEstablished() {
|
|
- return (currentCallStatus.equals(CallStatus.JOINED) || currentCallStatus.equals(CallStatus.IN_CONVERSATION));
|
|
|
|
|
|
+ return (currentCallStatus == CallStatus.JOINED || currentCallStatus == CallStatus.IN_CONVERSATION);
|
|
}
|
|
}
|
|
|
|
|
|
@AfterPermissionGranted(100)
|
|
@AfterPermissionGranted(100)
|
|
@@ -838,9 +838,9 @@ public class CallActivity extends CallBaseActivity {
|
|
Log.d(TAG, "onAudioManagerDevicesChanged: " + availableDevices + ", "
|
|
Log.d(TAG, "onAudioManagerDevicesChanged: " + availableDevices + ", "
|
|
+ "currentDevice: " + currentDevice);
|
|
+ "currentDevice: " + currentDevice);
|
|
|
|
|
|
- final boolean shouldDisableProximityLock = (currentDevice.equals(WebRtcAudioManager.AudioDevice.WIRED_HEADSET)
|
|
|
|
- || currentDevice.equals(WebRtcAudioManager.AudioDevice.SPEAKER_PHONE)
|
|
|
|
- || currentDevice.equals(WebRtcAudioManager.AudioDevice.BLUETOOTH));
|
|
|
|
|
|
+ final boolean shouldDisableProximityLock = (currentDevice == WebRtcAudioManager.AudioDevice.WIRED_HEADSET
|
|
|
|
+ || currentDevice == WebRtcAudioManager.AudioDevice.SPEAKER_PHONE
|
|
|
|
+ || currentDevice == WebRtcAudioManager.AudioDevice.BLUETOOTH);
|
|
|
|
|
|
if (shouldDisableProximityLock) {
|
|
if (shouldDisableProximityLock) {
|
|
powerManagerUtils.updatePhoneState(PowerManagerUtils.PhoneState.WITHOUT_PROXIMITY_SENSOR_LOCK);
|
|
powerManagerUtils.updatePhoneState(PowerManagerUtils.PhoneState.WITHOUT_PROXIMITY_SENSOR_LOCK);
|
|
@@ -1230,7 +1230,7 @@ public class CallActivity extends CallBaseActivity {
|
|
Log.d(TAG, "localStream is null");
|
|
Log.d(TAG, "localStream is null");
|
|
}
|
|
}
|
|
|
|
|
|
- if (!currentCallStatus.equals(CallStatus.LEAVING)) {
|
|
|
|
|
|
+ if (currentCallStatus != CallStatus.LEAVING) {
|
|
hangup(true);
|
|
hangup(true);
|
|
}
|
|
}
|
|
powerManagerUtils.updatePhoneState(PowerManagerUtils.PhoneState.IDLE);
|
|
powerManagerUtils.updatePhoneState(PowerManagerUtils.PhoneState.IDLE);
|
|
@@ -1457,7 +1457,7 @@ public class CallActivity extends CallBaseActivity {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onNext(@io.reactivex.annotations.NonNull GenericOverall genericOverall) {
|
|
public void onNext(@io.reactivex.annotations.NonNull GenericOverall genericOverall) {
|
|
- if (!currentCallStatus.equals(CallStatus.LEAVING)) {
|
|
|
|
|
|
+ if (currentCallStatus != CallStatus.LEAVING) {
|
|
setCallState(CallStatus.JOINED);
|
|
setCallState(CallStatus.JOINED);
|
|
|
|
|
|
ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);
|
|
ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);
|
|
@@ -1549,7 +1549,7 @@ public class CallActivity extends CallBaseActivity {
|
|
conversationUser, externalSignalingServer.getExternalSignalingTicket(),
|
|
conversationUser, externalSignalingServer.getExternalSignalingTicket(),
|
|
TextUtils.isEmpty(credentials));
|
|
TextUtils.isEmpty(credentials));
|
|
} else {
|
|
} else {
|
|
- if (webSocketClient.isConnected() && currentCallStatus.equals(CallStatus.PUBLISHER_FAILED)) {
|
|
|
|
|
|
+ if (webSocketClient.isConnected() && currentCallStatus == CallStatus.PUBLISHER_FAILED) {
|
|
webSocketClient.restartWebSocket();
|
|
webSocketClient.restartWebSocket();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1567,7 +1567,7 @@ public class CallActivity extends CallBaseActivity {
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.BACKGROUND)
|
|
@Subscribe(threadMode = ThreadMode.BACKGROUND)
|
|
public void onMessageEvent(WebSocketCommunicationEvent webSocketCommunicationEvent) {
|
|
public void onMessageEvent(WebSocketCommunicationEvent webSocketCommunicationEvent) {
|
|
- if (CallStatus.LEAVING.equals(currentCallStatus)) {
|
|
|
|
|
|
+ if (currentCallStatus == CallStatus.LEAVING) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1575,7 +1575,7 @@ public class CallActivity extends CallBaseActivity {
|
|
case "hello":
|
|
case "hello":
|
|
Log.d(TAG, "onMessageEvent 'hello'");
|
|
Log.d(TAG, "onMessageEvent 'hello'");
|
|
if (!webSocketCommunicationEvent.getHashMap().containsKey("oldResumeId")) {
|
|
if (!webSocketCommunicationEvent.getHashMap().containsKey("oldResumeId")) {
|
|
- if (currentCallStatus.equals(CallStatus.RECONNECTING)) {
|
|
|
|
|
|
+ if (currentCallStatus == CallStatus.RECONNECTING) {
|
|
hangup(false);
|
|
hangup(false);
|
|
} else {
|
|
} else {
|
|
initiateCall();
|
|
initiateCall();
|
|
@@ -1660,7 +1660,7 @@ public class CallActivity extends CallBaseActivity {
|
|
private void receivedSignalingMessage(Signaling signaling) throws IOException {
|
|
private void receivedSignalingMessage(Signaling signaling) throws IOException {
|
|
String messageType = signaling.getType();
|
|
String messageType = signaling.getType();
|
|
|
|
|
|
- if (!isConnectionEstablished() && !currentCallStatus.equals(CallStatus.CONNECTING)) {
|
|
|
|
|
|
+ if (!isConnectionEstablished() && currentCallStatus != CallStatus.CONNECTING) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1889,7 +1889,7 @@ public class CallActivity extends CallBaseActivity {
|
|
userIdsBySessionId.put(participant.get("sessionId").toString(), userId);
|
|
userIdsBySessionId.put(participant.get("sessionId").toString(), userId);
|
|
} else {
|
|
} else {
|
|
Log.d(TAG, " inCallFlag of currentSessionId: " + inCallFlag);
|
|
Log.d(TAG, " inCallFlag of currentSessionId: " + inCallFlag);
|
|
- if (inCallFlag == 0 && !CallStatus.LEAVING.equals(currentCallStatus) && ApplicationWideCurrentRoomHolder.getInstance().isInCall()) {
|
|
|
|
|
|
+ if (inCallFlag == 0 && currentCallStatus != CallStatus.LEAVING && ApplicationWideCurrentRoomHolder.getInstance().isInCall()) {
|
|
Log.d(TAG, "Most probably a moderator ended the call for all.");
|
|
Log.d(TAG, "Most probably a moderator ended the call for all.");
|
|
hangup(true);
|
|
hangup(true);
|
|
}
|
|
}
|
|
@@ -1909,7 +1909,7 @@ public class CallActivity extends CallBaseActivity {
|
|
// Calculate sessions that join the call
|
|
// Calculate sessions that join the call
|
|
newSessions.removeAll(oldSessions);
|
|
newSessions.removeAll(oldSessions);
|
|
|
|
|
|
- if (!isConnectionEstablished() && !currentCallStatus.equals(CallStatus.CONNECTING)) {
|
|
|
|
|
|
+ if (!isConnectionEstablished() && currentCallStatus != CallStatus.CONNECTING) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1938,7 +1938,7 @@ public class CallActivity extends CallBaseActivity {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- if (newSessions.size() > 0 && !currentCallStatus.equals(CallStatus.IN_CONVERSATION)) {
|
|
|
|
|
|
+ if (newSessions.size() > 0 && currentCallStatus != CallStatus.IN_CONVERSATION) {
|
|
setCallState(CallStatus.IN_CONVERSATION);
|
|
setCallState(CallStatus.IN_CONVERSATION);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2193,7 +2193,7 @@ public class CallActivity extends CallBaseActivity {
|
|
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType() ==
|
|
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType() ==
|
|
PeerConnectionEvent.PeerConnectionEventType.SENSOR_FAR && videoOn;
|
|
PeerConnectionEvent.PeerConnectionEventType.SENSOR_FAR && videoOn;
|
|
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) &&
|
|
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) &&
|
|
- (currentCallStatus.equals(CallStatus.CONNECTING) || isConnectionEstablished()) && videoOn
|
|
|
|
|
|
+ (currentCallStatus == CallStatus.CONNECTING || isConnectionEstablished()) && videoOn
|
|
&& enableVideo != localVideoTrack.enabled()) {
|
|
&& enableVideo != localVideoTrack.enabled()) {
|
|
toggleMedia(enableVideo, true);
|
|
toggleMedia(enableVideo, true);
|
|
}
|
|
}
|
|
@@ -2416,7 +2416,7 @@ public class CallActivity extends CallBaseActivity {
|
|
}
|
|
}
|
|
|
|
|
|
private void setCallState(CallStatus callState) {
|
|
private void setCallState(CallStatus callState) {
|
|
- if (currentCallStatus == null || !currentCallStatus.equals(callState)) {
|
|
|
|
|
|
+ if (currentCallStatus == null || currentCallStatus != callState) {
|
|
currentCallStatus = callState;
|
|
currentCallStatus = callState;
|
|
if (handler == null) {
|
|
if (handler == null) {
|
|
handler = new Handler(Looper.getMainLooper());
|
|
handler = new Handler(Looper.getMainLooper());
|