diff options
author | wangqi <wangqi@google.com> | 2018-01-23 18:01:00 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-23 18:07:33 -0800 |
commit | dd5f1a58c8453d56e334a54e0035392abd14c21c (patch) | |
tree | f356658a52295c4b97cebb3769d56551442fba2d | |
parent | aa8a26e9cd6d4c355f32516bbbf8361b32d8772b (diff) |
Updated call number by NW is not displayed
CallCardPresenter updates a call number if the number is updated by NW.
But the logic is worng. The comparing numbers are always same. Because
it compares with the same objects in DialerCall#areSameNumber.
This is a upstream change from:
https://android-review.googlesource.com/c/platform/packages/apps/Dialer/+/556000
originating number is shown in the call screen.
Bug: 70201489
Test: manual - Verified that a call number that changed from a
PiperOrigin-RevId: 183022988
Change-Id: I04305998e77ca120b1248636c63984b3d20f0db1
-rw-r--r-- | java/com/android/incallui/CallCardPresenter.java | 16 | ||||
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 11 |
2 files changed, 14 insertions, 13 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index eed076d3d..bdbbe8f7c 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -117,7 +117,9 @@ public class CallCardPresenter private final Handler handler = new Handler(); private DialerCall primary; + private String primaryNumber; private DialerCall secondary; + private String secondaryNumber; private ContactCacheEntry primaryContactInfo; private ContactCacheEntry secondaryContactInfo; @Nullable private ContactsPreferences contactsPreferences; @@ -284,17 +286,27 @@ public class CallCardPresenter LogUtil.v("CallCardPresenter.onStateChange", "primary call: " + primary); LogUtil.v("CallCardPresenter.onStateChange", "secondary call: " + secondary); + String primaryNumber = null; + String secondaryNumber = null; + if (primary != null) { + primaryNumber = primary.getNumber(); + } + if (secondary != null) { + secondaryNumber = secondary.getNumber(); + } final boolean primaryChanged = !(DialerCall.areSame(this.primary, primary) - && DialerCall.areSameNumber(this.primary, primary)); + && TextUtils.equals(this.primaryNumber, primaryNumber)); final boolean secondaryChanged = !(DialerCall.areSame(this.secondary, secondary) - && DialerCall.areSameNumber(this.secondary, secondary)); + && TextUtils.equals(this.secondaryNumber, secondaryNumber)); this.secondary = secondary; + this.secondaryNumber = secondaryNumber; DialerCall previousPrimary = this.primary; this.primary = primary; + this.primaryNumber = primaryNumber; if (this.primary != null) { InCallPresenter.getInstance().onForegroundCallChanged(this.primary); diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index a30367f7f..e581ba3b0 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -394,17 +394,6 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return call1.getId().equals(call2.getId()); } - public static boolean areSameNumber(DialerCall call1, DialerCall call2) { - if (call1 == null && call2 == null) { - return true; - } else if (call1 == null || call2 == null) { - return false; - } - - // otherwise compare call Numbers - return TextUtils.equals(call1.getNumber(), call2.getNumber()); - } - public void addListener(DialerCallListener listener) { Assert.isMainThread(); listeners.add(listener); |