Updating SecondaryInfo value class to use AutoValue with builder pattern.
Test: CallCardPresenterTest,SecondaryInfoTest
PiperOrigin-RevId: 187481728
Change-Id: I3d2b23b5d51ea1e5ff30b8f6b6570d76c006fe86
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index ad92f57..c60da63 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -907,7 +907,7 @@
if (secondary == null) {
// Clear the secondary display info.
- inCallScreen.setSecondary(SecondaryInfo.createEmptySecondaryInfo(isFullscreen));
+ inCallScreen.setSecondary(SecondaryInfo.builder().setIsFullscreen(isFullscreen).build());
return;
}
@@ -915,39 +915,39 @@
LogUtil.i(
"CallCardPresenter.updateSecondaryDisplayInfo",
"secondary call is merge in process, clearing info");
- inCallScreen.setSecondary(SecondaryInfo.createEmptySecondaryInfo(isFullscreen));
+ inCallScreen.setSecondary(SecondaryInfo.builder().setIsFullscreen(isFullscreen).build());
return;
}
if (secondary.isConferenceCall()) {
inCallScreen.setSecondary(
- new SecondaryInfo(
- true /* show */,
- CallerInfoUtils.getConferenceString(
- context, secondary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)),
- false /* nameIsNumber */,
- null /* label */,
- secondary.getCallProviderLabel(),
- true /* isConference */,
- secondary.isVideoCall(),
- isFullscreen));
+ SecondaryInfo.builder()
+ .setShouldShow(true)
+ .setName(
+ CallerInfoUtils.getConferenceString(
+ context, secondary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)))
+ .setProviderLabel(secondary.getCallProviderLabel())
+ .setIsConference(true)
+ .setIsVideoCall(secondary.isVideoCall())
+ .setIsFullscreen(isFullscreen)
+ .build());
} else if (secondaryContactInfo != null) {
LogUtil.v("CallCardPresenter.updateSecondaryDisplayInfo", "" + secondaryContactInfo);
String name = getNameForCall(secondaryContactInfo);
boolean nameIsNumber = name != null && name.equals(secondaryContactInfo.number);
inCallScreen.setSecondary(
- new SecondaryInfo(
- true /* show */,
- secondary.updateNameIfRestricted(name),
- nameIsNumber,
- secondaryContactInfo.label,
- secondary.getCallProviderLabel(),
- false /* isConference */,
- secondary.isVideoCall(),
- isFullscreen));
+ SecondaryInfo.builder()
+ .setShouldShow(true)
+ .setName(secondary.updateNameIfRestricted(name))
+ .setNameIsNumber(nameIsNumber)
+ .setLabel(secondaryContactInfo.label)
+ .setProviderLabel(secondary.getCallProviderLabel())
+ .setIsVideoCall(secondary.isVideoCall())
+ .setIsFullscreen(isFullscreen)
+ .build());
} else {
// Clear the secondary display info.
- inCallScreen.setSecondary(SecondaryInfo.createEmptySecondaryInfo(isFullscreen));
+ inCallScreen.setSecondary(SecondaryInfo.builder().setIsFullscreen(isFullscreen).build());
}
}