-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix/Get Display Capabilities based on template #590
Fix/Get Display Capabilities based on template #590
Conversation
appModel.getWidgetModels().forEach(element => { | ||
let capability = SDL.templateCapabilities[element.content.templateConfiguration.template].displayCapabilities; | ||
capability.windowTypeSupported = windowTypeSupportedWidget; | ||
displayCapabilities.concat(capability) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displayCapabilities.concat(capability) | |
displayCapabilities.push(capability); |
Even after I modified this line, the widget capability seems to be cut off by Core. When the HMI sends with displayCapabilities.length == 2
I am still getting displayCapabilities.length == 1
on mobile. Not sure why, but the Widget I created was the bare minimum and I didn't send a Show.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://github.com/smartdevicelink/sdl_core/blob/master/src/components/interfaces/HMI_API.xml#L3815, it looks like the OnSystemCapabilityUpdated
notification should only contain capabilities for the updated window. Added the changes in ce1db5c
So, when you send a CreateWindow
request, the returned OSCU notification should only contain the capabilities for the widget(should include the correct windowID
) but to get the capabilities for all windows you'll have to send a GetSystemCapability(DISPLAYS)
request
// MAIN window | ||
let displayCapabilities = [SDL.templateCapabilities[appModel.templateConfiguration.template].displayCapabilities]; | ||
displayCapabilities[0].windowTypeSupported = windowTypeSupportedMain; | ||
getDisplayCapabilities: function(appID, windowID){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this method just returns one displayCapability, I think naming it getDisplayCapability
might be more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Changed in ba1b347
Implements/Fixes #586
This PR is ready for review.
Testing Plan
Show
andSetDisplayLayout
and observe theOnSystemCapabilityUpdated(DISPLAYS)
notification.CreateWindow
and observe theOnSystemCapabilityUpdated(DISPLAYS)
notification.Summary
getDisplayCapabilities
in Controller.jsgetDefaultCapabilities
withgetDisplayCapabilities
in UIRPCs.jsCLA