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

Soft buttons are not shown after changing the template from LARGE_GRAPHIC_ONLY to LARGE_GRAPHIC_WITH_SOFTBUTTONS #1474

Closed
zhouxin627 opened this issue Nov 15, 2019 · 8 comments
Assignees
Labels
bug A defect in the library

Comments

@zhouxin627
Copy link
Contributor

zhouxin627 commented Nov 15, 2019

Bug Report

Soft buttons are not shown after changing the template from LARGE_GRAPHIC_ONLY to LARGE_GRAPHIC_WITH_SOFTBUTTONS

Preconditions
  1. The App supports changing the template from LARGE_GRAPHIC_ONLY to LARGE_GRAPHIC_WITH_SOFTBUTTONS
Reproduction Steps
  1. AppRegister
  2. Launch App on HU,After OnHMIStatus(FULL),SetDisplayLayout(TILES_ONLY)
  3. Recieve SDLSetDisplayLayoutResponse, then set 8 Softbuttons through sdlManager.screenManager.softButtonObjects
    (reference:https://www.smartdevicelink.com/en/guides/iOS/displaying-a-user-interface/text-images-and-buttons/#swift_2)
  4. App Send SetDisplayLayout(LARGE_GRAPHIC_ONLY)
  5. Recieve SDLSetDisplayLayoutResponse, then set ScreenManager for new template like below:
[Self.sdlManager.screenManager beginUpdates];
Self.sdlManager.screenManager.softButtonObjects = [];
Self.sdlManager.screenManager.textAlignment = SDLTextAlignmentCenter;
Self.sdlManager.screenManager.textField1 = nil;
Self.sdlManager.screenManager.textField2 = nil;
Self.sdlManager.screenManager.textField3 = nil;
Self.sdlManager.screenManager.textField4 = nil;
  1. After template changed completed,App Send SetDisplayLayout(LARGE_GRAPHIC_WITH_SOFTBUTTONS)
  2. Recieve SDLSetDisplayLayoutResponse, then set 8 Softbuttons(with different Buttonname from Step3) and other textFields through ScreenManager (reference https://www.smartdevicelink.com/en/guides/iOS/displaying-a-user-interface/text-images-and-buttons/#swift_2)
Expected Behavior

Soft buttons should be shown

Observed Behavior

After Step3, TILES_ONLY template is shown with 8 softbuttons OK
After Step5, LARGE_GRAPHIC_ONLY template is shown (No Softbuttons) OK
After Step7, LARGE_GRAPHIC_WITH_SOFTBUTTONS template is shown,with step3's Softbuttons(can't be renewed anymore) NOT OK

The reason might be that the SDLSoftButtonReplaceOperation thread is occupied with the previous task processing LARGE_GRAPHIC_ONLY all the time.

OS & Version Information
  • iOS Version:10.2
  • SDL iOS Version:6.3.0
  • Testing Against: Testing Against: SDL Core 5.1.3 + HMI running on our development environment.
Occurrence:

100%

Recovery Method:

Disconnect/connect USB cable

Test Case, Sample Code, and / or Example App

Logs:
Log.zip

@joeljfischer
Copy link
Contributor

There's a few problems here. First, your reproduction steps aren't filled out properly. They don't contain any information on when you're sending soft buttons, for example.

Second, I don't believe the expected behavior is correct. There are no soft buttons to be displayed on the LARGE_GRAPHIC_ONLY template, so they're not carried over to the LARGE_GRAPHIC_WITH_SOFTBUTTONS template. The soft button manager is not responsible for re-sending the soft buttons when the template changes. The HMI is responsible for carrying over the soft buttons onto the new template. If you want to display the soft buttons in your use-case, you would need to re-send them.

@zhouxin627
Copy link
Contributor Author

Hi, @joeljfischer Sorry, perhaps I didn't make myself clear. I have modified my reproduction steps and observed behavior. Please check it again. Thanks.

@joeljfischer
Copy link
Contributor

@zhouxin627 Thanks for updating the issue, it's easier to follow now. Since I don't have your HMI, allow me to ask a few questions that may help us debug the issue.

If the SoftButtonReplaceOperation is getting stuck, it may be getting stuck because it's waiting for a response from Core (which is waiting for a response from the HMI). Have you placed breakpoints in the SDLSoftButtonReplaceOperation response handlers or checked the logs to see if the response is coming back? It's hard for me to tell from the logs you've provided. You can set additional logs with when you're changing templates, etc.

@zhouxin627
Copy link
Contributor Author

Hi @joeljfischer We checked the following logs, all the responses were coming back.
request_response.txt
I have attached the App's logs for your reference.
TestAppLog.xlsx

@NicoleYarroch
Copy link
Contributor

@zhouxin627

I went through the steps you provided with the Manticore (https://smartdevicelink.com/resources/manticore/) emulator and I did not have any issues with sending the soft buttons after switching between the TILES_ONLY, LARGE_GRAPHIC_ONLY, and LARGE_GRAPHIC_WITH_SOFTBUTTONS templates.

I noticed that in the code sample you provided in step 5 that you do not call [Self.sdlManager.screenManager endUpdates]; I suspect that this might be your issue because when you call beginUpdates, the screen manager is paused until endUpdates is called by the developer.

@zhouxin627
Copy link
Contributor Author

@NicoleYarroch

Thank you for the response.
In fact, we called [Self.sdlManager.screenManager endUpdates]; in step 5 but forgot to write it down.
I have also tested the issue with the Manticore emulator and my result is the same as yours,
but I think the reason for this is that Manticore provides an incorrect response after SetDisplayLayout(Large_graphic_only).

The incorrect response is as follows:

2019-11-26 21:08:07.336715+0800 CommonFunAppAdmin3[3717:931391] sdl_supportsSoftButtonImages softButtonCapabilities =
 { imageSupported = 1; longPressAvailable = 0; shortPressAvailable = 1; upDownAvailable = 0; } 

Large_graphic_only does not have soft buttons so the correct response should not have softButtonCapabilities.

I have attached an excel document for providing more details.
explanation.xlsx

@NicoleYarroch
Copy link
Contributor

@zhouxin627 Thanks for your detailed report! I manage to recreate the bug and created a PR to fix the issue: #1484. Please let me know if it fixes your issue.

@zhouxin627
Copy link
Contributor Author

Hi, @NicoleYarroch The issue has been fixed. Thank you.

@joeljfischer joeljfischer mentioned this issue Jan 7, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

No branches or pull requests

3 participants