Update CDMA conference capabilities on recalculate.
Before merge/swap was set when the conference was initially created,
but not updated afterwards. This meant that if a conference later
received an incoming call, it would not be updated to show SWAP.
Bug: 18321767
Change-Id: I907c3bbb38c7cfe26aaa7d881a72110a3d2d29eb
diff --git a/src/com/android/services/telephony/CdmaConference.java b/src/com/android/services/telephony/CdmaConference.java
index 5372548..2d5ee47 100755
--- a/src/com/android/services/telephony/CdmaConference.java
+++ b/src/com/android/services/telephony/CdmaConference.java
@@ -37,15 +37,15 @@
private int mCapabilities = PhoneCapabilities.MUTE;
- public CdmaConference(PhoneAccountHandle phoneAccount, int capabilities) {
+ public CdmaConference(PhoneAccountHandle phoneAccount) {
super(phoneAccount);
- setCapabilities(mCapabilities | capabilities);
setActive();
}
private void updateCapabilities() {
setCapabilities(mCapabilities);
}
+
/**
* Invoked when the Conference and all it's {@link Connection}s should be disconnected.
*/
diff --git a/src/com/android/services/telephony/CdmaConferenceController.java b/src/com/android/services/telephony/CdmaConferenceController.java
index d6d5659..e2f0b50 100644
--- a/src/com/android/services/telephony/CdmaConferenceController.java
+++ b/src/com/android/services/telephony/CdmaConferenceController.java
@@ -149,18 +149,20 @@
// 1) Create a new conference connection if it doesn't exist.
if (mConference == null) {
Log.i(this, "Creating new Cdma conference call");
- CdmaConnection newConnection = mCdmaConnections.get(mCdmaConnections.size() - 1);
- if (newConnection.isOutgoing()) {
- // Only an outgoing call can be merged with an ongoing call.
- mConference = new CdmaConference(null, PhoneCapabilities.MERGE_CONFERENCE);
- } else {
- // If the most recently added connection was an incoming call, enable
- // swap instead of merge.
- mConference = new CdmaConference(null, PhoneCapabilities.SWAP_CONFERENCE);
- }
+ mConference = new CdmaConference(null);
isNewlyCreated = true;
}
+ CdmaConnection newConnection = mCdmaConnections.get(mCdmaConnections.size() - 1);
+ if (newConnection.isOutgoing()) {
+ // Only an outgoing call can be merged with an ongoing call.
+ mConference.setCapabilities(PhoneCapabilities.MERGE_CONFERENCE);
+ } else {
+ // If the most recently added connection was an incoming call, enable
+ // swap instead of merge.
+ mConference.setCapabilities(PhoneCapabilities.SWAP_CONFERENCE);
+ }
+
// 2) Add any new connections to the conference
List<Connection> existingChildConnections =
new ArrayList<>(mConference.getConnections());