4040import com .livio .taskmaster .Task ;
4141import com .smartdevicelink .managers .CompletionListener ;
4242import com .smartdevicelink .managers .ISdl ;
43- import com .smartdevicelink .managers .ManagerUtility ;
4443import static com .smartdevicelink .managers .ManagerUtility .WindowCapabilityUtility .hasImageFieldOfName ;
4544import static com .smartdevicelink .managers .ManagerUtility .WindowCapabilityUtility .hasTextFieldOfName ;
4645import com .smartdevicelink .managers .file .FileManager ;
@@ -96,7 +95,7 @@ class PreloadPresentChoicesOperation extends Task {
9695 private boolean choiceError = false ;
9796 private HashSet <ChoiceCell > loadedCells ;
9897 private final ChoiceSet choiceSet ;
99- //Start choiceId at 1 to ensure all HMIs handle it https://github.com/smartdevicelink/generic_hmi/commit/b292fbbec095b9ce11b520d47ec95b6fcff8e247
98+ // Start choiceId at 1 to ensure all HMIs handle it https://github.com/smartdevicelink/generic_hmi/commit/b292fbbec095b9ce11b520d47ec95b6fcff8e247
10099 private static Integer choiceId = 1 ;
101100 private static Boolean reachedMaxIds = false ;
102101 private static final int MAX_CHOICE_ID = 65535 ;
@@ -547,12 +546,12 @@ private void assignIdsToCells(ArrayList<ChoiceCell> cells) {
547546 Collections .sort (usedIds );
548547 ArrayList <Integer > sortedUsedIds = (ArrayList <Integer >) usedIds .clone ();
549548
550- //Loop through the cells we need ids for. Get and assign those ids
549+ // Loop through the cells we need ids for. Get and assign those ids
551550 for (int i = 0 ; i < cells .size (); i ++) {
552551 int cellId = nextChoiceIdBasedOnUsedIds (sortedUsedIds );
553552 cells .get (i ).setChoiceId (cellId );
554553
555- //Insert the ids into the usedIds sorted array in the correct position
554+ // Insert the ids into the usedIds sorted array in the correct position
556555 for (int j = 0 ; j < sortedUsedIds .size (); j ++) {
557556 if (sortedUsedIds .get (j ) > cellId ) {
558557 sortedUsedIds .add (j , cellId );
@@ -565,11 +564,11 @@ private void assignIdsToCells(ArrayList<ChoiceCell> cells) {
565564 }
566565 }
567566
568- //Find the next available choice is. Takes into account the loaded cells to ensure there are not duplicates
567+ // Find the next available choice is. Takes into account the loaded cells to ensure there are not duplicates
569568 // @param usedIds The already loaded cell ids
570569 // @return The choice id between 0 - 65535, or Not Found if no cell ids were available
571570 private int nextChoiceIdBasedOnUsedIds (ArrayList <Integer > usedIds ) {
572- //Check if we are entirely full, or if we've advanced beyond the max value, loop back
571+ // Check if we are entirely full, or if we've advanced beyond the max value, loop back
573572 if (choiceId == MAX_CHOICE_ID ) {
574573 choiceId = 1 ;
575574 reachedMaxIds = true ;
@@ -584,18 +583,18 @@ private int nextChoiceIdBasedOnUsedIds(ArrayList<Integer> usedIds) {
584583 return choiceId ;
585584 }
586585
587- //If the last value isn't the max value, just keep grabbing towards the max value
586+ // If the last value isn't the max value, just keep grabbing towards the max value
588587 int lastUsedId = usedIds .get (usedIds .size () - 1 );
589588 if (lastUsedId < MAX_CHOICE_ID ) {
590589 choiceId = lastUsedId + 1 ;
591590 return choiceId ;
592591 }
593592
594- //All our easy options are gone. Find and grab an empty slot from within the sorted list
593+ // All our easy options are gone. Find and grab an empty slot from within the sorted list
595594 for (int i = 0 ; i < usedIds .size (); i ++) {
596595 int loopId = usedIds .get (i );
597596 if (i != loopId ) {
598- //This slot is open because the cell id does not match an open sorted slot
597+ // This slot is open because the cell id does not match an open sorted slot
599598 choiceId = i ;
600599 return choiceId ;
601600 }
0 commit comments