Skip to content

Conversation

@JulianKast
Copy link
Contributor

@JulianKast JulianKast commented May 18, 2021

Fixes #1675

This PR is [ready] for review.

Risk

This PR makes [minor] API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
  • I have tested Android, Java SE, and Java EE

Unit Tests

Unit tests were added to VoiceCommandManagerTests.java

Core Tests

Test sending voice commands with extra white space on the front and back for example: " command one ", verify that extra white space is removed and the uploaded voice command is: "command one"
Test sending two voice commands one with an empty string set like " " and one normal one, verify that only the normal voice command is sent to the update operation.
Test sending voice commands only with empty strings, like " ". Verify that an error message is printed out in the logs: "New voice commands are invalid, skipping..."

Core version / branch / commit hash / module tested against: Core 7.1.1
HMI name / version / branch / commit hash / module tested against: Sdl_HMI 5.5.1

Summary

Stripped extra white space from voice commands.
Removes empty strings from being sent in voice commands.

Changelog

Enhancements
  • Stripped extra white space from voice commands.
  • Removes empty strings from being sent in voice commands.

CLA

…ceCommands and avoid sending empty strings in the update operation
@JulianKast JulianKast changed the title Update sending VoiceCommandManager to strip extra whiteSpace from voi… Update sending VoiceCommandManager to strip extra whiteSpace from voi…Fix for voice command that contains no string should be removed May 18, 2021
@JulianKast JulianKast changed the title Update sending VoiceCommandManager to strip extra whiteSpace from voi…Fix for voice command that contains no string should be removed Fix for voice command that contains no string should be removed May 18, 2021
@codecov
Copy link

codecov bot commented May 18, 2021

Codecov Report

Merging #1686 (9ee6bab) into develop (4aa6a62) will decrease coverage by 0.12%.
The diff coverage is 93.10%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1686      +/-   ##
=============================================
- Coverage      53.95%   53.83%   -0.13%     
- Complexity      5311     5447     +136     
=============================================
  Files            555      555              
  Lines          24572    25136     +564     
  Branches        3104     3263     +159     
=============================================
+ Hits           13259    13531     +272     
- Misses         10161    10426     +265     
- Partials        1152     1179      +27     
Impacted Files Coverage Δ Complexity Δ
.../managers/screen/menu/BaseVoiceCommandManager.java 76.27% <93.10%> (+10.31%) 26.00 <12.00> (+11.00)
...artdevicelink/transport/utl/SdlDeviceListener.java 8.73% <0.00%> (-1.61%) 2.00% <0.00%> (ø%)
...ink/managers/screen/BaseTextAndGraphicManager.java 63.75% <0.00%> (-0.42%) 50.00% <0.00%> (-2.00%)
...va/com/smartdevicelink/exception/SdlException.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...icelink/transport/MultiplexBluetoothTransport.java 4.56% <0.00%> (+0.27%) 14.00% <0.00%> (+6.00%)
...martdevicelink/transport/SdlBroadcastReceiver.java 3.62% <0.00%> (+0.38%) 3.00% <0.00%> (+1.00%)
...managers/screen/TextAndGraphicUpdateOperation.java 71.70% <0.00%> (+0.54%) 119.00% <0.00%> (+2.00%)
...rtdevicelink/streaming/video/SdlRemoteDisplay.java 51.21% <0.00%> (+1.21%) 5.00% <0.00%> (ø%)
.../main/java/com/smartdevicelink/util/DebugTool.java 17.20% <0.00%> (+2.15%) 12.00% <0.00%> (+1.00%)
... and 5 more

@JulianKast JulianKast merged commit be4e58b into develop May 25, 2021
@JulianKast JulianKast deleted the bugfix/issue_1675 branch May 25, 2021 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants