summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SmartDeviceLink/private/SDLMenuManager.m6
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m6
2 files changed, 10 insertions, 2 deletions
diff --git a/SmartDeviceLink/private/SDLMenuManager.m b/SmartDeviceLink/private/SDLMenuManager.m
index 1a9a62403..a01861d6f 100644
--- a/SmartDeviceLink/private/SDLMenuManager.m
+++ b/SmartDeviceLink/private/SDLMenuManager.m
@@ -567,7 +567,11 @@ UInt32 const MenuCellIdMin = 1;
SDLArtwork *secondaryArtwork = cell.secondaryArtwork;
if (artwork != nil && !artwork.isStaticIcon && ![self.fileManager hasUploadedFile:artwork]) {
return NO;
- } else if ([self.windowCapability hasImageFieldOfName:SDLImageFieldNameMenuCommandSecondaryImage] || [self.windowCapability hasImageFieldOfName:SDLImageFieldNameMenuSubMenuSecondaryImage]) {
+ } else if (cell.subCells.count > 0 && [self.windowCapability hasImageFieldOfName:SDLImageFieldNameMenuSubMenuSecondaryImage]) {
+ if (secondaryArtwork != nil && !secondaryArtwork.isStaticIcon && ![self.fileManager hasUploadedFile:secondaryArtwork]) {
+ return NO;
+ }
+ } else if (cell.subCells.count == 0 && [self.windowCapability hasImageFieldOfName:SDLImageFieldNameMenuCommandSecondaryImage]) {
if (secondaryArtwork != nil && !secondaryArtwork.isStaticIcon && ![self.fileManager hasUploadedFile:secondaryArtwork]) {
return NO;
}
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m
index b9113e3ce..0a4045f5a 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m
@@ -80,9 +80,13 @@ describe(@"menu manager", ^{
SDLImageField *commandIconField = [[SDLImageField alloc] init];
commandIconField.name = SDLImageFieldNameCommandIcon;
+ SDLImageField *subMenuSecondaryArtworkField = [[SDLImageField alloc] init];
+ subMenuSecondaryArtworkField.name = SDLImageFieldNameMenuSubMenuSecondaryImage;
+ SDLImageField *commandSecondaryArtworkField = [[SDLImageField alloc] init];
+ commandSecondaryArtworkField.name = SDLImageFieldNameMenuCommandSecondaryImage;
SDLWindowCapability *windowCapability = [[SDLWindowCapability alloc] init];
windowCapability.windowID = @(SDLPredefinedWindowsDefaultWindow);
- windowCapability.imageFields = @[commandIconField];
+ windowCapability.imageFields = @[commandIconField, subMenuSecondaryArtworkField, commandSecondaryArtworkField];
windowCapability.imageTypeSupported = @[SDLImageTypeDynamic, SDLImageTypeStatic];
windowCapability.menuLayoutsAvailable = @[SDLMenuLayoutList, SDLMenuLayoutTiles];
testManager.windowCapability = windowCapability;