diff options
author | Julian Kast <julian@livio.com> | 2020-08-20 18:02:28 -0400 |
---|---|---|
committer | Julian Kast <julian@livio.com> | 2020-08-20 18:02:28 -0400 |
commit | 9fd2effd9fb94feb32f23d0a57ca93a2f98adcae (patch) | |
tree | 81fc206f3f8069c70ebefd52e85dd030f870c746 | |
parent | a1d63cd537f714401b16eb9340d91b2885bbbcd2 (diff) | |
download | sdl_android-9fd2effd9fb94feb32f23d0a57ca93a2f98adcae.tar.gz |
Fixed Logic with canceling task and setting currentScreenData
-rw-r--r-- | base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java | 9 |
1 files changed, 8 insertions, 1 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 a801faa75..259d5debc 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java @@ -99,7 +99,7 @@ public class TextAndGraphicUpdateOperation extends Task { @Override public void onComplete(boolean success) { if (getState() == Task.CANCELED) { - finishOperation(success); + finishOperation(false); return; } uploadImagesAndSendWhenDone(new CompletionListener() { @@ -147,6 +147,7 @@ public class TextAndGraphicUpdateOperation extends Task { Show showWithGraphics = createImageOnlyShowWithPrimaryArtwork(updatedState.getPrimaryGraphic(), updatedState.getSecondaryGraphic()); if (showWithGraphics != null) { DebugTool.logInfo(TAG, "Sending update with the successfully uploaded images"); + //Check for cancel sendShow(showWithGraphics, new CompletionListener() { @Override public void onComplete(boolean success) { @@ -185,6 +186,10 @@ public class TextAndGraphicUpdateOperation extends Task { fileManager.get().uploadArtworks(artworksToUpload, new MultipleFileCompletionListener() { @Override public void onComplete(Map<String, String> errors) { + if (getState() == Task.CANCELED) { + finishOperation(false); + return; + } if (errors != null) { DebugTool.logError(TAG, "Text and graphic manager artwork failed to upload with error: " + errors.toString()); listener.onComplete(false); @@ -460,6 +465,8 @@ public class TextAndGraphicUpdateOperation extends Task { newShow.setMainField3(show.getMainField3()); newShow.setMainField4(show.getMainField4()); newShow.setTemplateTitle(show.getTemplateTitle()); + newShow.setMetadataTags(show.getMetadataTags()); + newShow.setAlignment(show.getAlignment()); return newShow; } |