Add plumbing for merge failures and renable button. (1/4)
The merge failure is not plumbed up through any layer that
can trap the callback and act on it. The first part of this
fix is to create that plumbing. Then we need to reenable the
merge button. At this point in time, we leverage the fact
that forcing the call to reassess its capabilities will poke
the InCallUI to reenable the merge button. In the future, we
should plumb the merge failure all the way to InCallUI and
not only handle the button but display UI to the user. The UI
is currently being displayed by CallNotifier which is the wrong
place. See b/20530631 for more details.
Bug: 20229905
Change-Id: I9fa11bcc0197c92c959e379bd0d89bfcf2b202bb
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 518224b..f7abd6c 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -51,6 +51,7 @@
private static final int MSG_HANDOVER_STATE_CHANGED = 3;
private static final int MSG_DISCONNECT = 4;
private static final int MSG_MULTIPARTY_STATE_CHANGED = 5;
+ private static final int MSG_CONFERENCE_MERGE_FAILED = 6;
private final Handler mHandler = new Handler() {
@Override
@@ -95,6 +96,8 @@
if (isMultiParty) {
notifyConferenceStarted();
}
+ case MSG_CONFERENCE_MERGE_FAILED:
+ notifyConferenceMergeFailed();
break;
}
}
@@ -213,6 +216,14 @@
public void onMultipartyStateChanged(boolean isMultiParty) {
handleMultipartyStateChange(isMultiParty);
}
+
+ /**
+ * Handles the event that the request to merge calls failed.
+ */
+ @Override
+ public void onConferenceMergedFailed() {
+ handleConferenceMergeFailed();
+ }
};
private com.android.internal.telephony.Connection mOriginalConnection;
@@ -731,6 +742,15 @@
}
/**
+ * Handles a failure when merging calls into a conference.
+ * {@link com.android.internal.telephony.Connection.Listener#onConferenceMergedFailed()}
+ * listener.
+ */
+ private void handleConferenceMergeFailed(){
+ mHandler.obtainMessage(MSG_CONFERENCE_MERGE_FAILED).sendToTarget();
+ }
+
+ /**
* Handles requests to update the multiparty state received via the
* {@link com.android.internal.telephony.Connection.Listener#onMultipartyStateChanged(boolean)}
* listener.