Skip to content

Commit 28a8bfe

Browse files
Fix never upload AddSubmenu RPC (menu cell w/ subcells) primary image on RPC connections v5.0 - v7.0
1 parent 4626dca commit 28a8bfe

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuReplaceOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.subMenuCommandsForCells;
4949
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.transferCellIDsFromCells;
5050
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.transferCellListenersFromCells;
51+
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.windowCapabilitySupportsPrimaryImage;
5152

5253
import com.livio.taskmaster.Task;
5354
import com.smartdevicelink.managers.CompletionListener;
@@ -465,9 +466,8 @@ List<MenuCell> cellsWithRemovedPropertiesFromCells(List<MenuCell> cells, WindowC
465466
// Strip away fields that cannot be used to determine uniqueness visually including fields not supported by the HMI
466467
cell.setVoiceCommands(null);
467468

468-
// Don't check ImageFieldName.subMenuIcon because it was added in 7.0 when the feature was added in 5.0.
469-
// Just assume that if cmdIcon is not available, the submenu icon is not either.
470-
if (!hasImageFieldOfName(windowCapability, ImageFieldName.cmdIcon)) {
469+
// If we're >= 5.0 && < 7.0, but don't have command icon image, no icon. If we're < 5.0 || >= 7.0 and don't have submenu icon, no icon.
470+
if (!windowCapabilitySupportsPrimaryImage(internalInterface.get(), windowCapability, cell)) {
471471
cell.setIcon(null);
472472
}
473473

base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuReplaceUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static Set<SdlArtwork> findAllArtworksToBeUploadedFromCells(ISdl internalInterfa
147147
static boolean windowCapabilitySupportsPrimaryImage(ISdl internalInterface, WindowCapability windowCapability, MenuCell cell) {
148148
boolean supportsImage;
149149
if (cell.isSubMenuCell()) {
150-
if (isRPCVersionBetween5And7(internalInterface)) {
150+
if (isRPCVersionBetween5And7(internalInterface) && hasImageFieldOfName(windowCapability, ImageFieldName.cmdIcon)) {
151151
supportsImage = true;
152152
} else {
153153
supportsImage = hasImageFieldOfName(windowCapability, ImageFieldName.subMenuIcon);

0 commit comments

Comments
 (0)