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

Fix case where head unit uses incorrect name for PredefinedLayout NON-MEDIA #451

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/js/src/manager/SystemCapabilityManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,16 @@ class SystemCapabilityManager extends _SubManagerBase {
if (defaultMainWindow.getImageFields() !== null && defaultMainWindow.getImageFields() !== undefined) {
convertedCapabilities.setImageFields(defaultMainWindow.getImageFields());
}
convertedCapabilities.setTemplatesAvailable(defaultMainWindow.getTemplatesAvailable());

// Ford Sync bug returning incorrect template name for "NON-MEDIA" https://github.com/smartdevicelink/sdl_javascript_suite/issues/450
const templatesAvailable = defaultMainWindow.getTemplatesAvailable();
for (let index = 0; index < templatesAvailable.length; index++) {
if (templatesAvailable[index] === 'NON_MEDIA') {
templatesAvailable[index] = 'NON-MEDIA';
break;
}
}
convertedCapabilities.setTemplatesAvailable(templatesAvailable);
convertedCapabilities.setNumCustomPresetsAvailable(defaultMainWindow.getNumCustomPresetsAvailable());
convertedCapabilities.setMediaClockFormats([]); // mandatory field but allows empty array
// if there are imageTypes in the response, we must assume graphics are supported
Expand Down