summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/contactgrid
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/incallui/contactgrid')
-rw-r--r--java/com/android/incallui/contactgrid/BottomRow.java16
-rw-r--r--java/com/android/incallui/contactgrid/ContactGridManager.java28
-rw-r--r--java/com/android/incallui/contactgrid/TopRow.java12
3 files changed, 28 insertions, 28 deletions
diff --git a/java/com/android/incallui/contactgrid/BottomRow.java b/java/com/android/incallui/contactgrid/BottomRow.java
index f9fc870dc..610eeca39 100644
--- a/java/com/android/incallui/contactgrid/BottomRow.java
+++ b/java/com/android/incallui/contactgrid/BottomRow.java
@@ -82,7 +82,7 @@ public class BottomRow {
boolean isSpamIconVisible = false;
boolean shouldPopulateAccessibilityEvent = true;
- if (isIncoming(state) && primaryInfo.isSpam) {
+ if (isIncoming(state) && primaryInfo.isSpam()) {
label = context.getString(R.string.contact_grid_incoming_suspected_spam);
isSpamIconVisible = true;
isHdIconVisible = false;
@@ -99,7 +99,7 @@ public class BottomRow {
}
} else {
label = getLabelForPhoneNumber(primaryInfo);
- shouldPopulateAccessibilityEvent = primaryInfo.nameIsNumber;
+ shouldPopulateAccessibilityEvent = primaryInfo.nameIsNumber();
}
return new Info(
@@ -114,15 +114,15 @@ public class BottomRow {
}
private static CharSequence getLabelForPhoneNumber(PrimaryInfo primaryInfo) {
- if (primaryInfo.location != null) {
- return primaryInfo.location;
+ if (primaryInfo.location() != null) {
+ return primaryInfo.location();
}
- if (!primaryInfo.nameIsNumber && !TextUtils.isEmpty(primaryInfo.number)) {
- CharSequence spannedNumber = spanDisplayNumber(primaryInfo.number);
- if (primaryInfo.label == null) {
+ if (!primaryInfo.nameIsNumber() && !TextUtils.isEmpty(primaryInfo.number())) {
+ CharSequence spannedNumber = spanDisplayNumber(primaryInfo.number());
+ if (primaryInfo.label() == null) {
return spannedNumber;
} else {
- return TextUtils.concat(primaryInfo.label, " ", spannedNumber);
+ return TextUtils.concat(primaryInfo.label(), " ", spannedNumber);
}
}
return null;
diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java
index 58d318892..6dec7646f 100644
--- a/java/com/android/incallui/contactgrid/ContactGridManager.java
+++ b/java/com/android/incallui/contactgrid/ContactGridManager.java
@@ -85,7 +85,7 @@ public class ContactGridManager {
private final TextView deviceNumberTextView;
private final View deviceNumberDivider;
- private PrimaryInfo primaryInfo = PrimaryInfo.createEmptyPrimaryInfo();
+ private PrimaryInfo primaryInfo = PrimaryInfo.empty();
private PrimaryCallState primaryCallState = PrimaryCallState.createEmptyPrimaryCallState();
private final LetterTileDrawable letterTile;
private boolean isInMultiWindowMode;
@@ -213,7 +213,7 @@ public class ContactGridManager {
}
boolean hasPhoto =
- primaryInfo.photo != null && primaryInfo.photoType == ContactPhotoType.CONTACT;
+ primaryInfo.photo() != null && primaryInfo.photoType() == ContactPhotoType.CONTACT;
if (!hasPhoto && !showAnonymousAvatar) {
avatarImageView.setVisibility(View.GONE);
return false;
@@ -271,17 +271,17 @@ public class ContactGridManager {
* </ul>
*/
private void updatePrimaryNameAndPhoto() {
- if (TextUtils.isEmpty(primaryInfo.name)) {
+ if (TextUtils.isEmpty(primaryInfo.name())) {
contactNameTextView.setText(null);
} else {
contactNameTextView.setText(
- primaryInfo.nameIsNumber
- ? PhoneNumberUtilsCompat.createTtsSpannable(primaryInfo.name)
- : primaryInfo.name);
+ primaryInfo.nameIsNumber()
+ ? PhoneNumberUtilsCompat.createTtsSpannable(primaryInfo.name())
+ : primaryInfo.name());
// Set direction of the name field
int nameDirection = View.TEXT_DIRECTION_INHERIT;
- if (primaryInfo.nameIsNumber) {
+ if (primaryInfo.nameIsNumber()) {
nameDirection = View.TEXT_DIRECTION_LTR;
}
contactNameTextView.setTextDirection(nameDirection);
@@ -292,23 +292,23 @@ public class ContactGridManager {
avatarImageView.setVisibility(View.GONE);
} else if (avatarSize > 0 && updateAvatarVisibility()) {
boolean hasPhoto =
- primaryInfo.photo != null && primaryInfo.photoType == ContactPhotoType.CONTACT;
+ primaryInfo.photo() != null && primaryInfo.photoType() == ContactPhotoType.CONTACT;
// Contact has a photo, don't render a letter tile.
if (hasPhoto) {
avatarImageView.setBackground(
DrawableConverter.getRoundedDrawable(
- context, primaryInfo.photo, avatarSize, avatarSize));
+ context, primaryInfo.photo(), avatarSize, avatarSize));
// Contact has a name, that isn't a number.
} else {
letterTile.setCanonicalDialerLetterTileDetails(
- primaryInfo.name,
- primaryInfo.contactInfoLookupKey,
+ primaryInfo.name(),
+ primaryInfo.contactInfoLookupKey(),
LetterTileDrawable.SHAPE_CIRCLE,
LetterTileDrawable.getContactTypeFromPrimitives(
primaryCallState.isVoiceMailNumber,
- primaryInfo.isSpam,
+ primaryInfo.isSpam(),
primaryCallState.isBusinessNumber,
- primaryInfo.numberPresentation,
+ primaryInfo.numberPresentation(),
primaryCallState.isConference));
// By invalidating the avatarImageView we force a redraw of the letter tile.
// This is required to properly display the updated letter tile iconography based on the
@@ -413,7 +413,7 @@ public class ContactGridManager {
deviceNumberTextView.setText(
context.getString(R.string.contact_grid_callback_number, primaryCallState.callbackNumber));
deviceNumberTextView.setVisibility(View.VISIBLE);
- if (primaryInfo.shouldShowLocation) {
+ if (primaryInfo.shouldShowLocation()) {
deviceNumberDivider.setVisibility(View.VISIBLE);
}
}
diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java
index 556b11ba0..5eb38f98c 100644
--- a/java/com/android/incallui/contactgrid/TopRow.java
+++ b/java/com/android/incallui/contactgrid/TopRow.java
@@ -81,7 +81,7 @@ public class TopRow {
// Show phone number if it's not displayed in name (center row) or location field (bottom
// row).
if (shouldShowNumber(primaryInfo, true /* isIncoming */)) {
- label = TextUtils.concat(label, " ", spanDisplayNumber(primaryInfo.number));
+ label = TextUtils.concat(label, " ", spanDisplayNumber(primaryInfo.number()));
}
}
} else if (VideoUtils.hasSentVideoUpgradeRequest(state.sessionModificationState)
@@ -97,7 +97,7 @@ public class TopRow {
label = context.getString(R.string.incall_remotely_held);
} else if (state.state == State.ACTIVE
&& shouldShowNumber(primaryInfo, false /* isIncoming */)) {
- label = spanDisplayNumber(primaryInfo.number);
+ label = spanDisplayNumber(primaryInfo.number());
} else if (state.state == State.CALL_PENDING && !TextUtils.isEmpty(state.customLabel)) {
label = state.customLabel;
} else {
@@ -115,18 +115,18 @@ public class TopRow {
}
private static boolean shouldShowNumber(PrimaryInfo primaryInfo, boolean isIncoming) {
- if (primaryInfo.nameIsNumber) {
+ if (primaryInfo.nameIsNumber()) {
return false;
}
// Don't show number since it's already shown in bottom row of incoming screen if there is no
// location info.
- if (primaryInfo.location == null && isIncoming) {
+ if (primaryInfo.location() == null && isIncoming) {
return false;
}
- if (primaryInfo.isLocalContact && !isIncoming) {
+ if (primaryInfo.isLocalContact() && !isIncoming) {
return false;
}
- if (TextUtils.isEmpty(primaryInfo.number)) {
+ if (TextUtils.isEmpty(primaryInfo.number())) {
return false;
}
return true;