summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Alsharifi <599206+bilal-alsharifi@users.noreply.github.com>2021-10-21 14:13:59 -0400
committerGitHub <noreply@github.com>2021-10-21 14:13:59 -0400
commit13a7d2f782c7136e4a03aab5f3c0dbf7bc5f77a8 (patch)
tree168b3fe8267d52c310ba32a309b9fd65e7da4195
parent60230823b341eb9e2e95f2c0649a322c7d5b9db1 (diff)
parentcd4131baaa96aae98a1d4bcb623113e07f5d2a07 (diff)
downloadsdl_android-13a7d2f782c7136e4a03aab5f3c0dbf7bc5f77a8.tar.gz
Merge pull request #1749 from smartdevicelink/bugfix/issue_1748
Get loadedCells if developer tries to present a recreated choiceset
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java8
1 files 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<ChoiceCell> loadedCells, HashSet<ChoiceCell> cellsToUpload) {
ArrayList<ChoiceCell> choiceSetCells = new ArrayList<>();
+ ArrayList<ChoiceCell> loadedCellsList = new ArrayList<>(loadedCells);
+ ArrayList<ChoiceCell> 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<ChoiceCell>) choiceSetCells.clone());