summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Lee <anthonylee@google.com>2015-04-24 15:25:29 -0700
committerAnthony Lee <anthonylee@google.com>2015-04-28 07:13:34 -0700
commit17455a3d39350a39eb995897929977d793358365 (patch)
tree4765cf4b4edff6c8a96f1ecb02c6faef5b99d11a
parent2a550449bcb4a6cff2fa96f7e7bf147dc485d5eb (diff)
downloadframeworks_base-17455a3d39350a39eb995897929977d793358365.zip
frameworks_base-17455a3d39350a39eb995897929977d793358365.tar.gz
frameworks_base-17455a3d39350a39eb995897929977d793358365.tar.bz2
Add plumbing for merge failures and renable button. (3/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: I0355ada46b484c6db4bee656c77386dd61be5e1f
-rw-r--r--telecomm/java/android/telecom/Connection.java12
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java8
-rw-r--r--telecomm/java/android/telecom/ConnectionServiceAdapter.java15
-rw-r--r--telecomm/java/android/telecom/ConnectionServiceAdapterServant.java17
-rw-r--r--telecomm/java/android/telecom/RemoteConnectionService.java7
-rw-r--r--telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl2
6 files changed, 61 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 9ced4ae..97d599b 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -339,6 +339,7 @@ public abstract class Connection implements IConferenceable {
public void onConferenceParticipantsChanged(Connection c,
List<ConferenceParticipant> participants) {}
public void onConferenceStarted() {}
+ public void onConferenceMergeFailed(Connection c) {}
}
public static abstract class VideoProvider {
@@ -1547,6 +1548,17 @@ public abstract class Connection implements IConferenceable {
}
/**
+ * Notifies listeners that the merge request failed.
+ *
+ * @hide
+ */
+ protected final void notifyConferenceMergeFailed() {
+ for (Listener l : mListeners) {
+ l.onConferenceMergeFailed(this);
+ }
+ }
+
+ /**
* Notifies listeners of a change to conference participant(s).
*
* @param conferenceParticipants The participants.
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index aad7fcb..9843824 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -562,6 +562,14 @@ public abstract class ConnectionService extends Service {
mAdapter.setIsConferenced(id, conferenceId);
}
}
+
+ @Override
+ public void onConferenceMergeFailed(Connection connection) {
+ String id = mIdByConnection.get(connection);
+ if (id != null) {
+ mAdapter.onConferenceMergeFailed(id);
+ }
+ }
};
/** {@inheritDoc} */
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
index d026a28..a87dbe7 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
@@ -203,6 +203,21 @@ final class ConnectionServiceAdapter implements DeathRecipient {
}
/**
+ * Indicates that the merge request on this call has failed.
+ *
+ * @param callId The unique ID of the call being conferenced.
+ */
+ void onConferenceMergeFailed(String callId) {
+ for (IConnectionServiceAdapter adapter : mAdapters) {
+ try {
+ Log.d(this, "merge failed for call %s", callId);
+ adapter.setConferenceMergeFailed(callId);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
* Indicates that the call no longer exists. Can be used with either a call or a conference
* call.
*
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 429f296..db815ba 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -59,6 +59,7 @@ final class ConnectionServiceAdapterServant {
private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20;
private static final int MSG_ADD_EXISTING_CONNECTION = 21;
private static final int MSG_ON_POST_DIAL_CHAR = 22;
+ private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23;
private final IConnectionServiceAdapter mDelegate;
@@ -220,6 +221,15 @@ final class ConnectionServiceAdapterServant {
}
break;
}
+ case MSG_SET_CONFERENCE_MERGE_FAILED: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.setConferenceMergeFailed((String) args.arg1);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
}
}
};
@@ -280,6 +290,13 @@ final class ConnectionServiceAdapterServant {
}
@Override
+ public void setConferenceMergeFailed(String callId) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = callId;
+ mHandler.obtainMessage(MSG_SET_CONFERENCE_MERGE_FAILED, args).sendToTarget();
+ }
+
+ @Override
public void setIsConferenced(String callId, String conferenceCallId) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = callId;
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index 43a92cb..5319793 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -171,6 +171,13 @@ final class RemoteConnectionService {
}
@Override
+ public void setConferenceMergeFailed(String callId) {
+ // Nothing to do here.
+ // The event has already been handled and there is no state to update
+ // in the underlying connection or conference objects
+ }
+
+ @Override
public void addConferenceCall(
final String callId,
ParcelableConference parcel) {
diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
index 7e7e9cc..67e2edb 100644
--- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
@@ -56,6 +56,8 @@ oneway interface IConnectionServiceAdapter {
void setIsConferenced(String callId, String conferenceCallId);
+ void setConferenceMergeFailed(String callId);
+
void addConferenceCall(String callId, in ParcelableConference conference);
void removeCall(String callId);