summaryrefslogtreecommitdiff
path: root/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java')
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
index f7a2c7b89..5f29e0cf9 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
@@ -556,11 +556,12 @@ class TextAndGraphicUpdateOperation extends Task {
*/
private boolean shouldUpdatePrimaryImage() {
boolean templateSupportsPrimaryArtwork = templateSupportsImageField(ImageFieldName.graphic);
-
String currentScreenDataPrimaryGraphicName = (currentScreenData != null && currentScreenData.getGraphic() != null) ? currentScreenData.getGraphic().getValue() : null;
String primaryGraphicName = updatedState.getPrimaryGraphic() != null ? updatedState.getPrimaryGraphic().getName() : null;
- return templateSupportsPrimaryArtwork
- && !CompareUtils.areStringsEqual(currentScreenDataPrimaryGraphicName, primaryGraphicName, true, true);
+
+ boolean graphicMatchesExisting = CompareUtils.areStringsEqual(currentScreenDataPrimaryGraphicName, primaryGraphicName, true, true);
+
+ return templateSupportsPrimaryArtwork && !graphicMatchesExisting;
}
/**
@@ -570,14 +571,16 @@ class TextAndGraphicUpdateOperation extends Task {
*/
private boolean shouldUpdateSecondaryImage() {
boolean templateSupportsSecondaryArtwork = templateSupportsImageField(ImageFieldName.secondaryGraphic);
-
String currentScreenDataSecondaryGraphicName = (currentScreenData != null && currentScreenData.getSecondaryGraphic() != null) ? currentScreenData.getSecondaryGraphic().getValue() : null;
String secondaryGraphicName = updatedState.getSecondaryGraphic() != null ? updatedState.getSecondaryGraphic().getName() : null;
+
+ boolean graphicMatchesExisting = CompareUtils.areStringsEqual(currentScreenDataSecondaryGraphicName, secondaryGraphicName, true, true);
+
// 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.
if (internalInterface.get().getSdlMsgVersion().getMajorVersion() >= 5) {
- return templateSupportsSecondaryArtwork && !CompareUtils.areStringsEqual(currentScreenDataSecondaryGraphicName, secondaryGraphicName, true, true);
+ return templateSupportsSecondaryArtwork && !graphicMatchesExisting;
} else {
- return templateSupportsImageField(ImageFieldName.graphic);
+ return templateSupportsImageField(ImageFieldName.graphic) && !graphicMatchesExisting;
}
}