File tree Expand file tree Collapse file tree
base/src/main/java/com/smartdevicelink/managers/screen Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333
3434import androidx .annotation .NonNull ;
3535
36- import com .livio .BuildConfig ;
3736import com .smartdevicelink .managers .file .filetypes .SdlArtwork ;
3837import com .smartdevicelink .proxy .rpc .OnButtonEvent ;
3938import com .smartdevicelink .proxy .rpc .OnButtonPress ;
@@ -283,8 +282,16 @@ public void setStates(@NonNull List<SoftButtonState> states) {
283282 DebugTool .logError (TAG , "A SoftButtonObject must have states with different names." );
284283 return ;
285284 }
286- if (states .isEmpty ()) {
287- DebugTool .logError (TAG , "A SoftButtonState list must contain at least one state" );
285+
286+ boolean hasStateWithCurrentName = false ;
287+ for (SoftButtonState state : states ) {
288+ if (state .getName ().equals (currentStateName )) {
289+ hasStateWithCurrentNameName = true ;
290+ break ;
291+ }
292+ }
293+ if (!hasStateWithCurrentName ) {
294+ DebugTool .logError (TAG , "A SoftButtonObject must have a state with currentStateName." );
288295 return ;
289296 }
290297
Original file line number Diff line number Diff line change 3333
3434import androidx .annotation .NonNull ;
3535
36- import com .livio .BuildConfig ;
3736import com .smartdevicelink .managers .file .filetypes .SdlArtwork ;
3837import com .smartdevicelink .proxy .rpc .SoftButton ;
3938import com .smartdevicelink .proxy .rpc .enums .SoftButtonType ;
You can’t perform that action at this time.
0 commit comments