Skip to content

Commit af19401

Browse files
HeniganHenigan
authored andcommitted
Start choiceId at 1
1 parent eb90da3 commit af19401

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ class PreloadPresentChoicesOperation extends Task {
9696
private boolean choiceError = false;
9797
private HashSet<ChoiceCell> loadedCells;
9898
private final ChoiceSet choiceSet;
99-
private static Integer choiceId = 0;
99+
//Start choiceId at 1 to ensure all HMIs handle it https://github.com/smartdevicelink/generic_hmi/commit/b292fbbec095b9ce11b520d47ec95b6fcff8e247
100+
private static Integer choiceId = 1;
100101
private static Boolean reachedMaxIds = false;
101102
private static final int MAX_CHOICE_ID = 65535;
102103
private final Integer cancelID;
@@ -182,7 +183,7 @@ public void onExecute() {
182183
}
183184

184185
if (this.loadedCells == null || this.loadedCells.isEmpty()) {
185-
choiceId = 0;
186+
choiceId = 1;
186187
reachedMaxIds = false;
187188
}
188189

@@ -570,7 +571,7 @@ private void assignIdsToCells(ArrayList<ChoiceCell> cells) {
570571
private int nextChoiceIdBasedOnUsedIds(ArrayList<Integer> usedIds) {
571572
//Check if we are entirely full, or if we've advanced beyond the max value, loop back
572573
if (choiceId == MAX_CHOICE_ID) {
573-
choiceId = 0;
574+
choiceId = 1;
574575
reachedMaxIds = true;
575576
}
576577

0 commit comments

Comments
 (0)