replace check for boolean variant of inCallFlag

(boolean variant is deprecated since nc14)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-01-06 16:47:18 +01:00 committed by Marcel Hibbe (Rebase PR Action)
parent 76aaafb024
commit 175f479d0f
2 changed files with 11 additions and 21 deletions

View File

@ -1279,9 +1279,9 @@ public class CallActivity extends CallBaseActivity {
private void performCall() { private void performCall() {
int inCallFlag; int inCallFlag;
if (isVoiceOnlyCall) { if (isVoiceOnlyCall) {
inCallFlag = Participant.InCallFlags.WITH_AUDIO; inCallFlag = Participant.InCallFlags.IN_CALL + Participant.InCallFlags.WITH_AUDIO;
} else { } else {
inCallFlag = Participant.InCallFlags.WITH_VIDEO; inCallFlag = Participant.InCallFlags.IN_CALL + Participant.InCallFlags.WITH_VIDEO;
} }
int apiVersion = ApiUtils.getCallApiVersion(conversationUser, new int[]{ApiUtils.APIv4, 1}); int apiVersion = ApiUtils.getCallApiVersion(conversationUser, new int[]{ApiUtils.APIv4, 1});
@ -1523,6 +1523,7 @@ public class CallActivity extends CallBaseActivity {
} }
private void hangup(boolean shutDownView) { private void hangup(boolean shutDownView) {
Log.d(TAG, "hangup! shutDownView=" + shutDownView);
stopCallingSound(); stopCallingSound();
dispose(null); dispose(null);
@ -1538,9 +1539,7 @@ public class CallActivity extends CallBaseActivity {
videoCapturer = null; videoCapturer = null;
} }
if (binding.selfVideoRenderer != null) { binding.selfVideoRenderer.release();
binding.selfVideoRenderer.release();
}
if (audioSource != null) { if (audioSource != null) {
audioSource.dispose(); audioSource.dispose();
@ -1625,7 +1624,6 @@ public class CallActivity extends CallBaseActivity {
hasMCU = hasExternalSignalingServer && webSocketClient != null && webSocketClient.hasMCU(); hasMCU = hasExternalSignalingServer && webSocketClient != null && webSocketClient.hasMCU();
Log.d(TAG, " hasMCU is " + hasMCU); Log.d(TAG, " hasMCU is " + hasMCU);
// The signaling session is the same as the Nextcloud session only when the MCU is not used. // The signaling session is the same as the Nextcloud session only when the MCU is not used.
String currentSessionId = callSession; String currentSessionId = callSession;
if (hasMCU) { if (hasMCU) {
@ -1635,17 +1633,11 @@ public class CallActivity extends CallBaseActivity {
Log.d(TAG, " currentSessionId is " + currentSessionId); Log.d(TAG, " currentSessionId is " + currentSessionId);
for (HashMap<String, Object> participant : users) { for (HashMap<String, Object> participant : users) {
if (!participant.get("sessionId").equals(currentSessionId)) { // own session is skipped long inCallFlag = (long)participant.get("inCall");
Object inCallObject = participant.get("inCall"); if (!participant.get("sessionId").equals(currentSessionId)) {
boolean isNewSession; boolean isNewSession;
if (inCallObject instanceof Boolean) { Log.d(TAG, " inCallFlag of participant " + participant.get("sessionId").toString().substring(0,4) + " : " + inCallFlag);
isNewSession = (boolean) inCallObject; isNewSession = inCallFlag != 0;
} else {
Log.d(TAG,
" inCallObject of participant " + participant.get("sessionId").toString().substring(0,4) +
" : " + inCallObject);
isNewSession = ((long) inCallObject) != 0;
}
if (isNewSession) { if (isNewSession) {
newSessions.add(participant.get("sessionId").toString()); newSessions.add(participant.get("sessionId").toString());
@ -1653,10 +1645,8 @@ public class CallActivity extends CallBaseActivity {
oldSessions.add(participant.get("sessionId").toString()); oldSessions.add(participant.get("sessionId").toString());
} }
} else { } else {
Object inCallObject = participant.get("inCall"); Log.d(TAG, " inCallFlag of currentSessionId: " + inCallFlag);
Log.d(TAG, " inCallObject of currentSessionId: " + inCallObject); if (inCallFlag == 0){
if(((long) inCallObject) == 0){
Log.d(TAG, " hangup!!!!!!!!!!");
hangup(true); hangup(true);
} }
} }

View File

@ -311,7 +311,7 @@ public class CallNotificationActivity extends CallBaseActivity {
} }
private boolean isInCallWithVideo(int callFlag) { private boolean isInCallWithVideo(int callFlag) {
return (callFlag >= Participant.InCallFlags.WITH_VIDEO); return (callFlag >= Participant.InCallFlags.IN_CALL + Participant.InCallFlags.WITH_VIDEO);
} }
private void setUpAfterConversationIsKnown() { private void setUpAfterConversationIsKnown() {