Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update warning messages based on PR suggestions
  • Loading branch information
noah-livio committed Mar 25, 2022
commit 36eb638e238fe200a35e2c822191c29dd8a8b605
Original file line number Diff line number Diff line change
Expand Up @@ -217,27 +217,27 @@ List<VoiceCommand> removeEmptyVoiceCommands(List<VoiceCommand> voiceCommands) {
List<VoiceCommand> validatedVoiceCommands = new ArrayList<>();
for (VoiceCommand voiceCommand : voiceCommands) {
if (voiceCommand == null) {
DebugTool.logWarning(TAG, "Null voice command removed");
DebugTool.logWarning(TAG, "Voice command is null, it will not be uploaded");
continue;
}
List<String> voiceCommandStrings = new ArrayList<>();
for (String voiceCommandString : voiceCommand.getVoiceCommands()) {
if (voiceCommandString == null) {
DebugTool.logWarning(TAG, "Null voice command string removed");
DebugTool.logWarning(TAG, "Removing null string from voice command");
continue;
}
String trimmedString = voiceCommandString.trim();
if (trimmedString.length() > 0) {
voiceCommandStrings.add(trimmedString);
} else {
DebugTool.logWarning(TAG, "Empty voice command string removed");
DebugTool.logWarning(TAG, "Empty string removed from voice command");
}
}
if (voiceCommandStrings.size() > 0) {
voiceCommand.setVoiceCommands(voiceCommandStrings);
validatedVoiceCommands.add(voiceCommand);
} else {
DebugTool.logWarning(TAG, "Empty voice command removed");
DebugTool.logWarning(TAG, "Voice command will not be uploaded as it contained no valid strings");
}
}
return validatedVoiceCommands;
Expand Down