* #38608: fix ghost call in conference hang up
diff --git a/src/org/sflphone/fragments/CallListFragment.java b/src/org/sflphone/fragments/CallListFragment.java
index 825d16d..d306609 100644
--- a/src/org/sflphone/fragments/CallListFragment.java
+++ b/src/org/sflphone/fragments/CallListFragment.java
@@ -194,7 +194,6 @@
} catch (RemoteException e) {
e.printStackTrace();
}
-
}
@Override
@@ -280,14 +279,6 @@
}
- public ArrayList<Conference> getDataset() {
- return calls;
- }
-
- public void remove(Conference transfer) {
-
- }
-
public void updateDataset(ArrayList<Conference> list) {
calls.clear();
calls.addAll(list);
@@ -411,10 +402,7 @@
Conference c = data.getParcelableExtra("target");
transfer = data.getParcelableExtra("transfer");
try {
-
mCallbacks.getService().attendedTransfer(transfer.getParticipants().get(0).getCallId(), c.getParticipants().get(0).getCallId());
- mConferenceAdapter.remove(transfer);
- mConferenceAdapter.remove(c);
mConferenceAdapter.notifyDataSetChanged();
} catch (RemoteException e) {
// TODO Auto-generated catch block
diff --git a/src/org/sflphone/model/Conference.java b/src/org/sflphone/model/Conference.java
index 3c30c9b..2e60e8f 100644
--- a/src/org/sflphone/model/Conference.java
+++ b/src/org/sflphone/model/Conference.java
@@ -50,7 +50,7 @@
return participants.get(0).isRinging();
}
- public void removeParticipant(String toRemove) {
+ public void removeParticipant(SipCall toRemove) {
participants.remove(toRemove);
}
@@ -111,6 +111,7 @@
}
};
+
private Conference(Parcel in) {
participants = new ArrayList<SipCall>();
id = in.readString();
diff --git a/src/org/sflphone/service/CallManagerCallBack.java b/src/org/sflphone/service/CallManagerCallBack.java
index 40ae6ac..7cc6f4a 100644
--- a/src/org/sflphone/service/CallManagerCallBack.java
+++ b/src/org/sflphone/service/CallManagerCallBack.java
@@ -80,21 +80,17 @@
mService.mHistoryManager.insertNewEntry(mService.getConferences().get(callID));
mService.getConferences().remove(callID);
} else {
- ArrayList<Conference> it = new ArrayList<Conference>(mService.getConferences().values());
- boolean found = false;
- int i = 0;
- while (!found && i < it.size()) {
- Conference tmp = it.get(i);
-
- for (SipCall call : tmp.getParticipants()) {
- if (call.getCallId().contentEquals(callID)) {
- mService.mHistoryManager.insertNewEntry(call);
- mService.getConferences().get(tmp.getId()).removeParticipant(call.getCallId());
- found = true;
+ Iterator<Map.Entry<String, Conference>> it = mService.getConferences().entrySet().iterator();
+ while (it.hasNext()) {
+ Conference tmp = it.next().getValue();
+ for (SipCall c : tmp.getParticipants()) {
+ if (c.getCallId().contentEquals(callID)) {
+ mService.mHistoryManager.insertNewEntry(c);
+ mService.getConferences().get(tmp.getId()).removeParticipant(c);
+ break;
}
}
- ++i;
}
}
@@ -200,7 +196,7 @@
for (SipCall c : tmp.getParticipants()) {
if (c.getCallId().contentEquals(all_participants.get(i))) {
created.addParticipant(c);
- mService.getConferences().get(tmp.getId()).removeParticipant(c.getCallId());
+ mService.getConferences().get(tmp.getId()).removeParticipant(c);
}
}
}
@@ -279,10 +275,10 @@
}
}
} else if (toModify.getParticipants().size() > newParticipants.size()) {
-
+ Log.i(TAG, "toModify.getParticipants().size() > newParticipants.size()");
for (SipCall participant : toModify.getParticipants()) {
if (!newParticipants.contains(participant.getCallId())) {
- mService.removeCallFromConference(toModify.getId(), participant.getCallId());
+ mService.detachCallFromConference(toModify.getId(), participant);
}
}
}
diff --git a/src/org/sflphone/service/SipService.java b/src/org/sflphone/service/SipService.java
index c5de94d..3bee57a 100644
--- a/src/org/sflphone/service/SipService.java
+++ b/src/org/sflphone/service/SipService.java
@@ -86,16 +86,18 @@
public void addCallToConference(String confId, String callId) {
if(mConferences.get(callId) != null){
// We add a simple call to a conference
+ Log.i(TAG, "// We add a simple call to a conference");
mConferences.get(confId).addParticipant(mConferences.get(callId).getParticipants().get(0));
mConferences.remove(callId);
} else {
+ Log.i(TAG, "addCallToConference");
Iterator<Map.Entry<String, Conference>> it = mConferences.entrySet().iterator();
while (it.hasNext()) {
Conference tmp = it.next().getValue();
for (SipCall c : tmp.getParticipants()) {
if (c.getCallId().contentEquals(callId)) {
mConferences.get(confId).addParticipant(c);
- mConferences.get(tmp.getId()).removeParticipant(c.getCallId());
+ mConferences.get(tmp.getId()).removeParticipant(c);
}
}
}
@@ -103,10 +105,11 @@
}
- public void removeCallFromConference(String confId, String callId) {
- SipCall call = mConferences.get(confId).getCallById(callId);
+ public void detachCallFromConference(String confId, SipCall call) {
+ Log.i(TAG, "detachCallFromConference");
Conference separate = new Conference(call);
mConferences.put(separate.getId(), separate);
+ mConferences.get(confId).removeParticipant(call);
}