Skip to content

Commit 4593a88

Browse files
Updte findAllArtworksToBeUploadedFromCells() to check if images are supported
1 parent cdadf4e commit 4593a88

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void onComplete(boolean success) {
198198
}
199199

200200
private void uploadMenuArtworks(final CompletionListener listener) {
201-
List<SdlArtwork> artworksToBeUploaded = new ArrayList<>(findAllArtworksToBeUploadedFromCells(updatedMenu, fileManager.get(), windowCapability));
201+
List<SdlArtwork> artworksToBeUploaded = new ArrayList<>(findAllArtworksToBeUploadedFromCells(internalInterface.get(), updatedMenu, fileManager.get(), windowCapability));
202202
if (artworksToBeUploaded.isEmpty()) {
203203
listener.onComplete(true);
204204
return;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void transferCellListenersFromCells(List<MenuCell> fromCells, List<MenuCe
118118
}
119119
}
120120

121-
static Set<SdlArtwork> findAllArtworksToBeUploadedFromCells(List<MenuCell> cells, FileManager fileManager, WindowCapability windowCapability) {
121+
static Set<SdlArtwork> findAllArtworksToBeUploadedFromCells(ISdl internalInterface, List<MenuCell> cells, FileManager fileManager, WindowCapability windowCapability) {
122122
// Make sure we can use images in the menus
123123
if (!hasImageFieldOfName(windowCapability, ImageFieldName.cmdIcon)) {
124124
return new HashSet<>();
@@ -127,15 +127,15 @@ static Set<SdlArtwork> findAllArtworksToBeUploadedFromCells(List<MenuCell> cells
127127
Set<SdlArtwork> artworks = new HashSet<>();
128128
for (MenuCell cell : cells) {
129129
if (fileManager != null) {
130-
if (fileManager.fileNeedsUpload(cell.getIcon())) {
130+
if (windowCapabilitySupportsPrimaryImage(internalInterface, windowCapability, cell) && fileManager.fileNeedsUpload(cell.getIcon())) {
131131
artworks.add(cell.getIcon());
132132
}
133-
if (hasImageFieldOfName(windowCapability, ImageFieldName.menuCommandSecondaryImage) && fileManager.fileNeedsUpload(cell.getSecondaryArtwork())) {
133+
if (windowCapabilitySupportsSecondaryImage(windowCapability, cell) && fileManager.fileNeedsUpload(cell.getSecondaryArtwork())) {
134134
artworks.add(cell.getSecondaryArtwork());
135135
}
136136
}
137137
if (cell.isSubMenuCell() && !cell.getSubCells().isEmpty()) {
138-
artworks.addAll(findAllArtworksToBeUploadedFromCells(cell.getSubCells(), fileManager, windowCapability));
138+
artworks.addAll(findAllArtworksToBeUploadedFromCells(internalInterface, cell.getSubCells(), fileManager, windowCapability));
139139
}
140140
}
141141

0 commit comments

Comments
 (0)