diff options
author | Julian Kast <julian@livio.com> | 2020-08-28 13:42:15 -0400 |
---|---|---|
committer | Julian Kast <julian@livio.com> | 2020-08-28 13:42:15 -0400 |
commit | d07884cf42098c4a85c36f8091e36fe156475128 (patch) | |
tree | 0bacb3c63550b0909c034478c0b0b9caec4d1a47 | |
parent | 6840282266eecd22acaa935949dc46f8d4d36cdf (diff) | |
download | sdl_android-d07884cf42098c4a85c36f8091e36fe156475128.tar.gz |
Fixed shouldUpdateSecondaryImage to be more precise
-rw-r--r-- | base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java | 10 |
1 files changed, 7 insertions, 3 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 bac8fa8bc..6f0e38fee 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java @@ -569,12 +569,16 @@ class TextAndGraphicUpdateOperation extends Task { * @return true if secondaryGraphic should be updated, false if not */ private boolean shouldUpdateSecondaryImage() { - boolean templateSupportsSecondaryArtwork = (templateSupportsImageField(ImageFieldName.graphic) || templateSupportsImageField(ImageFieldName.secondaryGraphic)); + 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; - return templateSupportsSecondaryArtwork - && !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); + } else { + return templateSupportsImageField(ImageFieldName.graphic); + } } /** |