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

remove MEDIA template from non-media app capabilities #419

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

iCollin
Copy link
Collaborator

@iCollin iCollin commented Aug 11, 2021

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

@iCollin iCollin mentioned this pull request Aug 11, 2021
var showApp = store.getState().appList.find((app) => {
return app.appID === rpc.params.appID;
});
var showAppIsMedia = showApp.appType.includes('MEDIA');
Copy link
Collaborator

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

Suggested change
var showAppIsMedia = showApp.appType.includes('MEDIA');
var showAppIsMedia = showApp.appType.includes('MEDIA') || showApp.isMediaApplication;

untested ^

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am seeing isMediaApplication sent in the UpdateAppList rpc
Screen Shot 2021-08-12 at 2 21 40 PM

Copy link
Collaborator Author

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'
Copy link
Collaborator

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

Copy link
Collaborator Author

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
@iCollin iCollin merged commit 65b39d2 into develop Aug 13, 2021
@iCollin iCollin deleted the fix/media_template_available branch August 13, 2021 19:34
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.

2 participants