Skip to content

Commit d07884c

Browse files
author
Julian Kast
committed
Fixed shouldUpdateSecondaryImage to be more precise
1 parent 6840282 commit d07884c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,16 @@ private boolean shouldUpdatePrimaryImage() {
569569
* @return true if secondaryGraphic should be updated, false if not
570570
*/
571571
private boolean shouldUpdateSecondaryImage() {
572-
boolean templateSupportsSecondaryArtwork = (templateSupportsImageField(ImageFieldName.graphic) || templateSupportsImageField(ImageFieldName.secondaryGraphic));
572+
boolean templateSupportsSecondaryArtwork = templateSupportsImageField(ImageFieldName.secondaryGraphic);
573573

574574
String currentScreenDataSecondaryGraphicName = (currentScreenData != null && currentScreenData.getSecondaryGraphic() != null) ? currentScreenData.getSecondaryGraphic().getValue() : null;
575575
String secondaryGraphicName = updatedState.getSecondaryGraphic() != null ? updatedState.getSecondaryGraphic().getName() : null;
576-
return templateSupportsSecondaryArtwork
577-
&& !CompareUtils.areStringsEqual(currentScreenDataSecondaryGraphicName, secondaryGraphicName, true, true);
576+
// Cannot detect if there is a secondary image below v5.0, so we'll just try to detect if the primary image is allowed and allow the secondary image if it is.
577+
if (internalInterface.get().getSdlMsgVersion().getMajorVersion() > 5) {
578+
return templateSupportsSecondaryArtwork && !CompareUtils.areStringsEqual(currentScreenDataSecondaryGraphicName, secondaryGraphicName, true, true);
579+
} else {
580+
return templateSupportsImageField(ImageFieldName.graphic);
581+
}
578582
}
579583

580584
/**

0 commit comments

Comments
 (0)