mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 06:15:12 +00:00
replace deprecated ParticipantFlags with InCallFlags
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
f70f94e6be
commit
76aaafb024
@ -1277,11 +1277,11 @@ public class CallActivity extends CallBaseActivity {
|
||||
}
|
||||
|
||||
private void performCall() {
|
||||
Integer inCallFlag;
|
||||
int inCallFlag;
|
||||
if (isVoiceOnlyCall) {
|
||||
inCallFlag = (int) Participant.ParticipantFlags.IN_CALL_WITH_AUDIO.getValue();
|
||||
inCallFlag = Participant.InCallFlags.WITH_AUDIO;
|
||||
} else {
|
||||
inCallFlag = (int) Participant.ParticipantFlags.IN_CALL_WITH_AUDIO_AND_VIDEO.getValue();
|
||||
inCallFlag = Participant.InCallFlags.WITH_VIDEO;
|
||||
}
|
||||
|
||||
int apiVersion = ApiUtils.getCallApiVersion(conversationUser, new int[]{ApiUtils.APIv4, 1});
|
||||
|
@ -311,8 +311,7 @@ public class CallNotificationActivity extends CallBaseActivity {
|
||||
}
|
||||
|
||||
private boolean isInCallWithVideo(int callFlag) {
|
||||
return (Participant.ParticipantFlags.IN_CALL_WITH_VIDEO.getValue() == callFlag
|
||||
|| Participant.ParticipantFlags.IN_CALL_WITH_AUDIO_AND_VIDEO.getValue() == callFlag);
|
||||
return (callFlag >= Participant.InCallFlags.WITH_VIDEO);
|
||||
}
|
||||
|
||||
private void setUpAfterConversationIsKnown() {
|
||||
|
@ -82,23 +82,6 @@ public class Participant {
|
||||
|
||||
public boolean selected;
|
||||
|
||||
public ParticipantFlags getParticipantFlags() {
|
||||
ParticipantFlags participantFlags = ParticipantFlags.NOT_IN_CALL;
|
||||
if (inCall != null) {
|
||||
if (inCall instanceof Long) {
|
||||
participantFlags = ParticipantFlags.fromValue((Long) inCall);
|
||||
} else if (inCall instanceof Boolean) {
|
||||
if ((boolean) inCall) {
|
||||
participantFlags = ParticipantFlags.IN_CALL;
|
||||
} else {
|
||||
participantFlags = ParticipantFlags.NOT_IN_CALL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return participantFlags;
|
||||
}
|
||||
|
||||
public Long getAttendeeId() {
|
||||
return attendeeId;
|
||||
}
|
||||
@ -346,40 +329,4 @@ public class Participant {
|
||||
public static final int WITH_VIDEO = 4;
|
||||
public static final int WITH_PHONE = 8;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public enum ParticipantFlags {
|
||||
NOT_IN_CALL(0),
|
||||
IN_CALL(1),
|
||||
IN_CALL_WITH_AUDIO(3),
|
||||
IN_CALL_WITH_VIDEO(5),
|
||||
IN_CALL_WITH_AUDIO_AND_VIDEO(7);
|
||||
|
||||
private long value;
|
||||
|
||||
ParticipantFlags(long value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static ParticipantFlags fromValue(long value) {
|
||||
if (value == 0) {
|
||||
return NOT_IN_CALL;
|
||||
} else if (value == 1) {
|
||||
return IN_CALL;
|
||||
} else if (value == 3) {
|
||||
return IN_CALL_WITH_AUDIO;
|
||||
} else if (value == 5) {
|
||||
return IN_CALL_WITH_VIDEO;
|
||||
} else if (value == 7) {
|
||||
return IN_CALL_WITH_AUDIO_AND_VIDEO;
|
||||
} else {
|
||||
return NOT_IN_CALL;
|
||||
}
|
||||
}
|
||||
|
||||
public long getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user