diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java index e5f5803be2..872e09b815 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java @@ -81,11 +81,23 @@ public void testSetPrimaryGraphic() { assertEquals(screenManager.getPrimaryGraphic(), testArtwork); } + public void testSetPrimaryGraphicWithBlankImage() { + screenManager.setPrimaryGraphic(null); + assertNotNull(screenManager.getPrimaryGraphic()); + assertEquals(screenManager.getPrimaryGraphic().getName(), "blankArtwork"); + } + public void testSetSecondaryGraphic() { screenManager.setSecondaryGraphic(testArtwork); assertEquals(screenManager.getSecondaryGraphic(), testArtwork); } + public void testSetSecondaryGraphicWithBlankImage() { + screenManager.setSecondaryGraphic(null); + assertNotNull(screenManager.getSecondaryGraphic()); + assertEquals(screenManager.getSecondaryGraphic().getName(), "blankArtwork"); + } + public void testAlignment() { screenManager.setTextAlignment(TextAlignment.LEFT_ALIGNED); assertEquals(screenManager.getTextAlignment(), TextAlignment.LEFT_ALIGNED); diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java index aaad2df24f..d063f52e30 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java @@ -113,6 +113,7 @@ public void testInstantiation(){ assertEquals(textAndGraphicManager.currentHMILevel, HMILevel.HMI_NONE); assertFalse(textAndGraphicManager.isDirty); assertEquals(textAndGraphicManager.getState(), BaseSubManager.SETTING_UP); + assertNotNull(textAndGraphicManager.getBlankArtwork()); } public void testGetMainLines(){ @@ -533,7 +534,7 @@ public void testDispose() { assertNull(textAndGraphicManager.getTextField2Type()); assertNull(textAndGraphicManager.getTextField3Type()); assertNull(textAndGraphicManager.getTextField4Type()); - assertNull(textAndGraphicManager.getBlankArtwork()); + assertNotNull(textAndGraphicManager.getBlankArtwork()); assertNull(textAndGraphicManager.currentScreenData); assertNull(textAndGraphicManager.inProgressUpdate); assertNull(textAndGraphicManager.queuedImageUpdate); diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java index 3cad283e99..4a25fc12ba 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java +++ b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java @@ -662,7 +662,7 @@ private List findNonNullMetadataFields(){ SdlArtwork getBlankArtwork(){ - if (blankArtwork != null){ + if (blankArtwork == null){ blankArtwork = new SdlArtwork(); blankArtwork.setType(FileType.GRAPHIC_PNG); blankArtwork.setName("blankArtwork");