Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1738 - Soft button manager image upload fix #1811

Merged
merged 10 commits into from
Jun 21, 2022
Merged

Conversation

JulianKast
Copy link
Contributor

@JulianKast JulianKast commented Jun 2, 2022

Fixes #1738

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 updated with the new parameter and one test was added in SoftButtonManagerTest

Core Tests

Tested sending a softbutton with an image, verifying that the image displays.

        SoftButtonState softButtonState = new SoftButtonState("artworkTest", "Button", new SdlArtwork("testArtwork1", FileType.GRAPHIC_PNG, R.drawable.ic_sdl, true));

        SoftButtonObject softButtonObject = new SoftButtonObject("jk", softButtonState, new SoftButtonObject.OnEventListener() {
            @Override
            public void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress) {
            }

            @Override
            public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent) {

            }
        });
        sdlManager.getScreenManager().setSoftButtonObjects(Collections.singletonList(softButtonObject));

Core version / branch / commit hash / module tested against: Core 8.1, Manticore and Sync 3
HMI name / version / branch / commit hash / module tested against: Generic_HMI

Summary

This PR works around a bug when connecting to Sync 2.0 head units that causes the app to attempt to upload a dynamic soft button images that will never work. This wastes bandwidth and time.

The issue happens because Sync 2.0 doesn't support softButtonCapabilities, so the library assumes all capabilities are available. However, Sync 2.0 does report that all graphics are unsupported in RAIR.displayCapabilities.graphicSupported.

Static images are supported by Sync 2.0 and should still upload on softbuttons.

Changelog

Bug Fixes
  • Fixes attempted uploads of image data on SDL 2.0

CLA

@JulianKast JulianKast changed the title check isGraphicSupported in SoftButtonManager Block images form uploading in SoftbuttonManager if graphics are not supported on older systems Jun 2, 2022
@JulianKast JulianKast changed the base branch from master to develop June 2, 2022 18:52
@codecov
Copy link

codecov bot commented Jun 2, 2022

Codecov Report

Merging #1811 (0258a4f) into develop (16b2ab6) will increase coverage by 0.04%.
The diff coverage is 68.51%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1811      +/-   ##
=============================================
+ Coverage      54.02%   54.07%   +0.04%     
- Complexity      5522     5533      +11     
=============================================
  Files            562      562              
  Lines          25757    25809      +52     
  Branches        3382     3395      +13     
=============================================
+ Hits           13916    13956      +40     
- Misses         10577    10584       +7     
- Partials        1264     1269       +5     
Impacted Files Coverage Δ
...icelink/managers/screen/BaseSoftButtonManager.java 56.25% <66.66%> (+0.43%) ⬆️
...nk/managers/screen/SoftButtonReplaceOperation.java 60.78% <68.75%> (+2.45%) ⬆️
...ink/managers/screen/BaseTextAndGraphicManager.java 64.16% <0.00%> (-0.42%) ⬇️
...rtdevicelink/streaming/video/SdlRemoteDisplay.java 51.21% <0.00%> (ø)
...com/smartdevicelink/util/MediaStreamingStatus.java 64.76% <0.00%> (+0.95%) ⬆️
...artdevicelink/managers/screen/SoftButtonState.java 63.15% <0.00%> (+10.52%) ⬆️

Copy link
Contributor

@joeljfischer joeljfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small items

…n uploading graphic when no capability is retrieved
@JulianKast JulianKast changed the title Block images form uploading in SoftbuttonManager if graphics are not supported on older systems 1738 - Soft button manager image upload fix Jun 9, 2022
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.

ScreenManager tries to upload images even if they are not supported (SDL 2.0)
3 participants