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

securesipcall: Store secure state and refresh ui adequately.

Refs #40939
parent 8162f4c3
No related branches found
No related tags found
No related merge requests found
......@@ -283,10 +283,9 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
public void displaySAS(Conference updated, final String securedCallID) {
Log.i(TAG, "displaySAS");
mCallbacks.updateDisplayedConference(updated);
SipCall call = getConference().getCallById(securedCallID);
SecureSipCall display = (SecureSipCall) getConference().getCallById(securedCallID);
if (call != null && call instanceof SecureSipCall) {
SecureSipCall display = (SecureSipCall) call;
if (display != null) {
if (!display.isConfirmedSAS()) {
final Button sas = (Button) getView().findViewById(R.id.confirm_sas);
sas.setText("Confirm SAS: " + display.getSAS());
......@@ -405,11 +404,35 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
dX = Math.cos(Math.toRadians(angle_part * i - 90)) * radiusCalls;
dY = Math.sin(Math.toRadians(angle_part * i - 90)) * radiusCalls;
getBubbleFor(getConference().getParticipants().get(i), (int) (model.width / 2 + dX), (int) (model.height / 2 + dY));
enableZRTP(getConference().getParticipants().get(i));
}
model.clearAttractors();
}
private void enableZRTP(SipCall sipCall) {
if (sipCall instanceof SecureSipCall) {
final SecureSipCall secured = (SecureSipCall) sipCall;
if (!secured.isConfirmedSAS()) {
final Button sas = (Button) getView().findViewById(R.id.confirm_sas);
sas.setText("Confirm SAS: " + secured.getSAS());
sas.setVisibility(View.VISIBLE);
sas.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
mCallbacks.getService().confirmSAS(secured.getCallId());
sas.setVisibility(View.INVISIBLE);
} catch (RemoteException e) {
e.printStackTrace();
}
}
});
}
}
}
private void initIncomingCallDisplay() {
Log.i(TAG, "Start incoming display");
......
......@@ -283,7 +283,7 @@ public class CallListFragment extends CallableWrapperFragment {
if (call.getParticipants().size() == 1) {
((TextView) convertView.findViewById(R.id.call_title)).setText(call.getParticipants().get(0).getmContact().getmDisplayName());
long duration = System.currentTimeMillis() / 1000 - (call.getParticipants().get(0).getTimestampStart_());
long duration = (System.currentTimeMillis() - (call.getParticipants().get(0).getTimestampStart_())) / 1000;
((TextView) convertView.findViewById(R.id.call_time)).setText(String.format("%d:%02d:%02d", duration / 3600, (duration % 3600) / 60,
(duration % 60)));
......
......@@ -97,7 +97,7 @@ public class SecureSipCall extends SipCall {
}
public boolean isConfirmedSAS() {
return confirmedSAS;
return false;
}
public void setConfirmedSAS(boolean confirmedSAS) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment