diff options
author | Tyler Gunn <tgunn@google.com> | 2017-06-01 21:15:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-01 21:15:06 +0000 |
commit | a32bdf7289370be5a64201ce216b1ee4cf74944f (patch) | |
tree | f6bdeada610ae4fea7dbb4582be65ef1ceae6885 | |
parent | 90660b5f9a058c452aa41478feac23f656bb206c (diff) | |
parent | 988ccc80cafa46fcb28a74bb487fbd5a6ae7e1fc (diff) | |
download | Telecomm-a32bdf7289370be5a64201ce216b1ee4cf74944f.tar.gz |
Merge "Fix lack of notification of un-parent on disconnecting conference child." into oc-dev
-rw-r--r-- | src/com/android/server/telecom/Call.java | 34 | ||||
-rw-r--r-- | src/com/android/server/telecom/CallsManager.java | 1 |
2 files changed, 20 insertions, 15 deletions
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java index 7ca9f117f..c69a3e0cd 100644 --- a/src/com/android/server/telecom/Call.java +++ b/src/com/android/server/telecom/Call.java @@ -1876,8 +1876,24 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { * @param parentCall */ void setParentAndChildCall(Call parentCall) { + boolean isParentChanging = (mParentCall != parentCall); setParentCall(parentCall); setChildOf(parentCall); + if (isParentChanging) { + notifyParentChanged(parentCall); + } + } + + /** + * Notifies listeners when the parent call changes. + * Used by {@link #setParentAndChildCall(Call)}, and in {@link CallsManager}. + * @param parentCall The new parent call for this call. + */ + void notifyParentChanged(Call parentCall) { + Log.addEvent(this, LogUtils.Events.SET_PARENT, parentCall); + for (Listener l : mListeners) { + l.onParentChanged(this); + } } /** @@ -1906,25 +1922,13 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable { * To be called after {@link #setParentCall(Call)} to complete setting the parent by adding * this call as a child of another call. * <p> - * Note: The fact that the {@link Listener#onParentChanged(Call)} callback is called here seems - * counter-intuitive; it is done here so that when this method is called from - * {@link CallsManager#createCallForExistingConnection(String, ParcelableConnection)} we can - * delay informing InCallServices of the change in parent relationship until AFTER the call has - * been added to Telecom. + * Note: if using this method alone, the caller must call {@link #notifyParentChanged(Call)} to + * ensure the InCall UI is updated with the change in parent. * @param parentCall The new parent for this call. */ void setChildOf(Call parentCall) { - if (parentCall == null) { - return; - } - - if (!parentCall.getChildCalls().contains(this)) { + if (parentCall != null && !parentCall.getChildCalls().contains(this)) { parentCall.addChildCall(this); - - Log.addEvent(this, LogUtils.Events.SET_PARENT, parentCall); - for (Listener l : mListeners) { - l.onParentChanged(this); - } } } diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java index 499061dbe..5e7443bc5 100644 --- a/src/com/android/server/telecom/CallsManager.java +++ b/src/com/android/server/telecom/CallsManager.java @@ -2542,6 +2542,7 @@ public class CallsManager extends Call.ListenerBase // Now, set the call as a child of the parent since it has been added to Telecom. This // is where we will inform InCall. call.setChildOf(parentCall); + call.notifyParentChanged(parentCall); } return call; |