diff options
Diffstat (limited to 'InCallUI/src/com/android')
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 76ca4a90d..1307a3e54 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -115,6 +115,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 d82346ebb..3ec94f9df 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -554,12 +554,13 @@ public class Call { Bundle callExtras = mTelecomCall.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 a0c1cef86..0b17e1a03 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -378,6 +378,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 0f31f72aa..99def3669 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -187,6 +187,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) { @@ -650,5 +665,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 4b57278c4..fde2dc9dc 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -667,4 +667,9 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, public void onLastForwardedNumberChange() { // no-op } + + @Override + public void onChildNumberChange() { + // no-op + } } |