diff options
author | wangqi <wangqi@google.com> | 2017-10-03 17:35:40 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-03 17:35:40 +0000 |
commit | 45ea75ca8f3b2f01bc955d39d28fe2ce18a2f254 (patch) | |
tree | 90fffe63a2df2c1e80f3dc64298dd20d58e823b9 | |
parent | 5b6ac2ced6713a4cd2cf89acde7156cc5cbb08e8 (diff) | |
parent | 0c396de3c969d42cdd2a2d93280f6567b5295aae (diff) |
Merge "Fix bug that phone number is shown for local contacts."
am: 0c396de3c9
Change-Id: I146f5a4ae2eaf82714b7e7b539cfd68895a22039
5 files changed, 14 insertions, 0 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index be9b3ef6c..d49d556a6 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -712,6 +712,7 @@ public class CallCardPresenter showContactPhoto, hasWorkCallProperty, false /* isSpam */, + false /* isLocalContact */, false /* answeringDisconnectsOngoingCall */, shouldShowLocation(), null /* contactInfoLookupKey */, @@ -760,6 +761,7 @@ public class CallCardPresenter showContactPhoto, hasWorkCallProperty || isWorkContact, mPrimary.isSpam(), + mPrimaryContactInfo.isLocalContact(), mPrimary.answeringDisconnectsForegroundVideoCall(), shouldShowLocation(), mPrimaryContactInfo.lookupKey, diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java index 39c4c2fda..2a9394526 100644 --- a/java/com/android/incallui/ContactInfoCache.java +++ b/java/com/android/incallui/ContactInfoCache.java @@ -721,6 +721,10 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { boolean isEmergencyNumber; boolean isVoicemailNumber; + public boolean isLocalContact() { + return contactLookupResult == ContactLookupResult.Type.LOCAL_CONTACT; + } + @Override public String toString() { return "ContactCacheEntry{" diff --git a/java/com/android/incallui/callpending/CallPendingActivity.java b/java/com/android/incallui/callpending/CallPendingActivity.java index 26490d973..7fc4caf5a 100644 --- a/java/com/android/incallui/callpending/CallPendingActivity.java +++ b/java/com/android/incallui/callpending/CallPendingActivity.java @@ -189,6 +189,7 @@ public class CallPendingActivity extends FragmentActivity true /* isContactPhotoShown */, false /* isWorkCall */, false /* isSpam */, + true /* isLocalContact */, false /* answeringDisconnectsOngoingCall */, false /* shouldShowLocation */, getLookupKey(), diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java index 8f54266f3..3593c991d 100644 --- a/java/com/android/incallui/contactgrid/TopRow.java +++ b/java/com/android/incallui/contactgrid/TopRow.java @@ -122,6 +122,9 @@ public class TopRow { if (primaryInfo.location == null && isIncoming) { return false; } + if (primaryInfo.isLocalContact && !isIncoming) { + return false; + } if (TextUtils.isEmpty(primaryInfo.number)) { return false; } diff --git a/java/com/android/incallui/incall/protocol/PrimaryInfo.java b/java/com/android/incallui/incall/protocol/PrimaryInfo.java index 7fe0a0f6a..69eee20ff 100644 --- a/java/com/android/incallui/incall/protocol/PrimaryInfo.java +++ b/java/com/android/incallui/incall/protocol/PrimaryInfo.java @@ -36,6 +36,7 @@ public class PrimaryInfo { public final boolean isContactPhotoShown; public final boolean isWorkCall; public final boolean isSpam; + public final boolean isLocalContact; public final boolean answeringDisconnectsOngoingCall; public final boolean shouldShowLocation; // Used for consistent LetterTile coloring. @@ -60,6 +61,7 @@ public class PrimaryInfo { false, false, false, + false, null, null, true, @@ -78,6 +80,7 @@ public class PrimaryInfo { boolean isContactPhotoShown, boolean isWorkCall, boolean isSpam, + boolean isLocalContact, boolean answeringDisconnectsOngoingCall, boolean shouldShowLocation, @Nullable String contactInfoLookupKey, @@ -95,6 +98,7 @@ public class PrimaryInfo { this.isContactPhotoShown = isContactPhotoShown; this.isWorkCall = isWorkCall; this.isSpam = isSpam; + this.isLocalContact = isLocalContact; this.answeringDisconnectsOngoingCall = answeringDisconnectsOngoingCall; this.shouldShowLocation = shouldShowLocation; this.contactInfoLookupKey = contactInfoLookupKey; |