Skip to content

Commit 666f99a

Browse files
committed
Fixes from PR feedback
1 parent e183f35 commit 666f99a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
import androidx.annotation.NonNull;
3535

36-
import com.livio.BuildConfig;
3736
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
3837
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
3938
import 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

base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
import androidx.annotation.NonNull;
3535

36-
import com.livio.BuildConfig;
3736
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
3837
import com.smartdevicelink.proxy.rpc.SoftButton;
3938
import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;

0 commit comments

Comments
 (0)