Skip to content
Snippets Groups Projects
Commit 8162f4c3 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

securesipcall: Hold references to SipCall and SecureSiCall in conferences.

Refs #40939
parent c8cdcf58
No related branches found
No related tags found
No related merge requests found
...@@ -246,9 +246,7 @@ public class CallActivity extends FragmentActivity implements IMFragment.Callbac ...@@ -246,9 +246,7 @@ public class CallActivity extends FragmentActivity implements IMFragment.Callbac
@Override @Override
public void updateDisplayedConference(Conference c) { public void updateDisplayedConference(Conference c) {
Log.e(TAG, "toUpdate.getParticipants() :"+ c.getParticipants().size());
if(mDisplayedConference.equals(c)){ if(mDisplayedConference.equals(c)){
Log.e(TAG, "It's equal");
mDisplayedConference = c; mDisplayedConference = c;
} }
} }
......
...@@ -283,9 +283,10 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa ...@@ -283,9 +283,10 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
public void displaySAS(Conference updated, final String securedCallID) { public void displaySAS(Conference updated, final String securedCallID) {
Log.i(TAG, "displaySAS"); Log.i(TAG, "displaySAS");
mCallbacks.updateDisplayedConference(updated); mCallbacks.updateDisplayedConference(updated);
SecureSipCall display = (SecureSipCall) getConference().getCallById(securedCallID); SipCall call = getConference().getCallById(securedCallID);
if (display != null) { if (call != null && call instanceof SecureSipCall) {
SecureSipCall display = (SecureSipCall) call;
if (!display.isConfirmedSAS()) { if (!display.isConfirmedSAS()) {
final Button sas = (Button) getView().findViewById(R.id.confirm_sas); final Button sas = (Button) getView().findViewById(R.id.confirm_sas);
sas.setText("Confirm SAS: " + display.getSAS()); sas.setText("Confirm SAS: " + display.getSAS());
......
...@@ -96,7 +96,17 @@ public class Conference implements Parcelable { ...@@ -96,7 +96,17 @@ public class Conference implements Parcelable {
public void writeToParcel(Parcel out, int flags) { public void writeToParcel(Parcel out, int flags) {
out.writeString(id); out.writeString(id);
out.writeInt(mConfState); out.writeInt(mConfState);
out.writeTypedList(participants); ArrayList<SipCall> normal_calls = new ArrayList<SipCall>();
ArrayList<SecureSipCall> secure_calls = new ArrayList<SecureSipCall>();
for(SipCall part : participants){
if(part instanceof SecureSipCall)
secure_calls.add((SecureSipCall) part);
else
normal_calls.add(part);
}
out.writeTypedList(secure_calls);
out.writeTypedList(normal_calls);
out.writeByte((byte) (recording ? 1 : 0)); out.writeByte((byte) (recording ? 1 : 0));
out.writeTypedList(messages); out.writeTypedList(messages);
} }
...@@ -116,7 +126,10 @@ public class Conference implements Parcelable { ...@@ -116,7 +126,10 @@ public class Conference implements Parcelable {
participants = new ArrayList<SipCall>(); participants = new ArrayList<SipCall>();
id = in.readString(); id = in.readString();
mConfState = in.readInt(); mConfState = in.readInt();
ArrayList<SecureSipCall> tmp = new ArrayList<SecureSipCall>();
in.readTypedList(tmp, SecureSipCall.CREATOR);
in.readTypedList(participants, SipCall.CREATOR); in.readTypedList(participants, SipCall.CREATOR);
participants.addAll(tmp);
recording = in.readByte() == 1 ? true : false; recording = in.readByte() == 1 ? true : false;
messages = new ArrayList<SipMessage>(); messages = new ArrayList<SipMessage>();
in.readTypedList(messages, SipMessage.CREATOR); in.readTypedList(messages, SipMessage.CREATOR);
......
...@@ -85,7 +85,7 @@ public class SecureSipCall extends SipCall { ...@@ -85,7 +85,7 @@ public class SecureSipCall extends SipCall {
public SecureSipCall(SipCall call, Bundle secure){ public SecureSipCall(SipCall call, Bundle secure){
super(call.getBundle()); super(call);
confirmedSAS = secure.getBoolean(SecureSipCall.DISPLAY_SAS, false); confirmedSAS = secure.getBoolean(SecureSipCall.DISPLAY_SAS, false);
alertIfZrtpNotSupported = secure.getBoolean(SecureSipCall.DISPLAY_WARNING_ZRTP_NOT_SUPPORTED, false); alertIfZrtpNotSupported = secure.getBoolean(SecureSipCall.DISPLAY_WARNING_ZRTP_NOT_SUPPORTED, false);
displaySASOnHold = secure.getBoolean(SecureSipCall.DISPLAY_SAS_ONCE, false); displaySASOnHold = secure.getBoolean(SecureSipCall.DISPLAY_SAS_ONCE, false);
......
...@@ -56,6 +56,17 @@ public class SipCall implements Parcelable { ...@@ -56,6 +56,17 @@ public class SipCall implements Parcelable {
private int mCallType; private int mCallType;
private int mCallState = state.CALL_STATE_NONE; private int mCallState = state.CALL_STATE_NONE;
public SipCall(SipCall call) {
mCallID = call.mCallID;
mAccount = call.mAccount;
mContact = call.mContact;
isRecording = call.isRecording;
timestampStart_ = call.timestampStart_;
timestampEnd_ = call.timestampEnd_;
mCallType = call.mCallType;
mCallState = call.mCallState;
}
public boolean isSecured() { public boolean isSecured() {
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment