From cd4131baaa96aae98a1d4bcb623113e07f5d2a07 Mon Sep 17 00:00:00 2001 From: Henigan Date: Wed, 6 Oct 2021 10:57:03 -0400 Subject: Align to JavaScript Behavior --- .../managers/screen/choiceset/PreloadPresentChoicesOperation.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java index 4c9d5a3b5..8c6ebca6f 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java @@ -629,9 +629,13 @@ class PreloadPresentChoicesOperation extends Task { private void updateChoiceSet(ChoiceSet choiceSet, HashSet loadedCells, HashSet cellsToUpload) { ArrayList choiceSetCells = new ArrayList<>(); + ArrayList loadedCellsList = new ArrayList<>(loadedCells); + ArrayList CellsToUploadList = new ArrayList<>(cellsToUpload); for (ChoiceCell cell : choiceSet.getChoices()) { - if (loadedCells.contains(cell) || cellsToUpload.contains(cell)) { - choiceSetCells.add(cell); + if (loadedCells.contains(cell)) { + choiceSetCells.add(loadedCellsList.get(loadedCellsList.indexOf(cell))); + } else if (cellsToUpload.contains(cell)) { + choiceSetCells.add(CellsToUploadList.get(CellsToUploadList.indexOf(cell))); } } this.choiceSet.setChoices((List) choiceSetCells.clone()); -- cgit v1.2.1