diff options
author | Tyler Gunn <tgunn@google.com> | 2015-10-07 16:12:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-07 16:12:39 +0000 |
commit | cfe027f16dfb922c77f36a687af8e1b4aa796051 (patch) | |
tree | dbf99e48530c580c42f6343f21cd94ed611052f1 /InCallUI | |
parent | d123f744998e6a686fc5cb93c4e6d590c9095f5e (diff) | |
parent | 785f157fe125ce913223aa0b0415b4eed8e6090c (diff) |
am 9849b290: am 070463fa: Merge "Handle child number changes after the call starts." into mnc-dr-dev
* commit '9849b29079f43a29e65886b0d26d2a07344b8d2a':
Handle child number changes after the call starts.
Diffstat (limited to 'InCallUI')
5 files changed, 46 insertions, 2 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index fc75bf030..97f60c05f 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -113,6 +113,11 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> // no-op } + @Override + public void onChildNumberChange() { + // no-op + } + private boolean isVideoUpgradePending(Call call) { return call.getSessionModificationState() == Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST; diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index 01205ff1e..16a53b298 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -334,12 +334,13 @@ public class Call { Bundle callExtras = mTelecommCall.getDetails().getExtras(); if (callExtras != null) { - // Child address arrives when the call is first set up, so we do not need to notify the - // UI of this. + // Check for a change in the child address and notify any listeners. if (callExtras.containsKey(Connection.EXTRA_CHILD_ADDRESS)) { String childNumber = callExtras.getString(Connection.EXTRA_CHILD_ADDRESS); + if (!Objects.equals(childNumber, mChildNumber)) { mChildNumber = childNumber; + CallList.getInstance().onChildNumberChange(this); } } diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index d5972182b..783334077 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -347,6 +347,19 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> updatePrimaryDisplayInfo(); } + /** + * Handles a change to the child number by refreshing the primary call info. + */ + @Override + public void onChildNumberChange() { + Log.v(this, "onChildNumberChange"); + + if (mPrimary == null) { + return; + } + updatePrimaryDisplayInfo(); + } + private String getSubscriptionNumber() { // If it's an emergency call, and they're not populating the callback number, // then try to fall back to the phone sub info (to hopefully get the SIM's diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index 666ba9529..11b5914f7 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -176,6 +176,21 @@ public class CallList { } } + /** + * Called when the child number changes for a call. The child number can be received after a + * call is initially set up, so we need to be able to inform listeners of the change. + * + * @param call The call. + */ + public void onChildNumberChange(Call call) { + final List<CallUpdateListener> listeners = mCallUpdateListenerMap.get(call.getId()); + if (listeners != null) { + for (CallUpdateListener listener : listeners) { + listener.onChildNumberChange(); + } + } + } + public void notifyCallUpdateListeners(Call call) { final List<CallUpdateListener> listeners = mCallUpdateListenerMap.get(call.getId()); if (listeners != null) { @@ -632,5 +647,10 @@ public class CallList { * Notifies of a change to the last forwarded number for a call. */ public void onLastForwardedNumberChange(); + + /** + * Notifies of a change to the child number for a call. + */ + public void onChildNumberChange(); } } diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 3f862a243..a9b6cccbe 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -654,4 +654,9 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, public void onLastForwardedNumberChange() { // no-op } + + @Override + public void onChildNumberChange() { + // no-op + } } |