-
Notifications
You must be signed in to change notification settings - Fork 27
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
remove MEDIA template from non-media app capabilities #419
Conversation
src/js/Controllers/UIController.js
Outdated
var showApp = store.getState().appList.find((app) => { | ||
return app.appID === rpc.params.appID; | ||
}); | ||
var showAppIsMedia = showApp.appType.includes('MEDIA'); |
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.
HMIApplicationStruct has an additional (redundant) parameter to identify an app type. isMediaApplication
var showAppIsMedia = showApp.appType.includes('MEDIA'); | |
var showAppIsMedia = showApp.appType.includes('MEDIA') || showApp.isMediaApplication; |
untested ^
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.
This param is only in the OnAppRegistered
notification and the app list state is only updated by the UpdateAppList
notification, the isMediaApplication
value is not stored anywhere in the state.
I thought this value was redundant as well, do you think it is worth adding this to the state? It wouldn't be straight forward to do because the OnAppRegistered arrives before UpdateAppList.
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.
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.
Ah I was mistaken about that. That is the proper value to check, I have changed the appType checks in 0bcbcf1
@@ -311,7 +314,9 @@ class RpcFactory { | |||
"id": rpc.id, | |||
"error": { | |||
"code": 1, | |||
"message": "The requested layout is not supported on this HMI", | |||
"message": (templateConfiguration.template === 'MEDIA' | |||
? 'Only MEDIA apps may use the MEDIA template' |
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.
Same logic should be applied to SetDisplayLayout
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.
Added in 0bcbcf1
…ut, check isMediaApplication instead of appType
Fixes #182
Summary
When sending OnSystemCapabilityUpdated, only include MEDIA template in templatesAvailable if an app is media type.
When receiving Show request, do not allow non-media app to use template MEDIA.
SetDisplayLayout is unmodified as it is deprecated.
The issue also incorrectly requests changes to the RAI response, the capabilities in the RAI response are not App specific and should not be influenced by the app type. The capabilities in the RAI response are unchanged by this PR.
CLA