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 ChoiceSetManager Bugs #1293

Merged
merged 1 commit into from
Jun 5, 2019

Conversation

joeljfischer
Copy link
Contributor

Fixes #1290

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

Unit tests were run and smoke tests performed

Summary

This PR forces the ChoiceSetManager to work on Ford Sync 3 units even when they pass back bad DisplayCapabilities and calls the preloadChoices completionHandler if it fails.

Changelog

Bug Fixes
  • Forces the ChoiceSetManager to work on Ford Sync 3 units even when they pass back bad DisplayCapabilities and calls the preloadChoices completionHandler if it fails.

CLA

* Call preload handler if it fails
@joeljfischer joeljfischer added the bug A defect in the library label May 31, 2019
@joeljfischer joeljfischer added this to the 6.3.0 milestone May 31, 2019
@joeljfischer joeljfischer self-assigned this May 31, 2019
@joeljfischer joeljfischer added this to In progress in v6.3 via automation May 31, 2019
v6.3 automation moved this from In progress to Reviewer approved Jun 4, 2019
@joeljfischer joeljfischer merged commit 03c394a into develop Jun 5, 2019
v6.3 automation moved this from Reviewer approved to Done Jun 5, 2019
@joeljfischer joeljfischer deleted the bugfix/issue_1290_sync3_choice_sets_fail branch June 5, 2019 18:05
@rbright55
Copy link

This is also an issue on SYNC Gen 1.1 and is a problem for app partners who want to upgrade to the newest SDK but also support as many vehicles as possible.
It may be better to just remove the check for the display capabilities since the RPC response will also indicate if it is supported or not.

Proposed solution:

- (nullable SDLCreateInteractionChoiceSet *)sdl_choiceFromCell:(SDLChoiceCell *)cell {
    NSArray<NSString *> *vrCommands = nil;
    if (cell.voiceCommands == nil) {
        vrCommands = self.isVROptional ? nil : @[[NSString stringWithFormat:@"%hu", cell.choiceId]];
    } else {
        vrCommands = cell.voiceCommands;
    }
    
    if(![self.displayCapabilities hasTextFieldOfName:SDLTextFieldNameMenuName]) {
        SDLLogW(@"This display may not support SDLCreateInteractionChoiceSet. It may not be shown. Cell: %@", cell);
    }
    NSString *menuName = cell.text;
    NSString *secondaryText = cell.secondaryText;
    NSString *tertiaryText = cell.tertiaryText;
    SDLImage *image = cell.artwork != nil ? cell.artwork.imageRPC : nil;
    SDLImage *secondaryImage = cell.secondaryArtwork != nil ? cell.secondaryArtwork.imageRPC : nil;

    SDLChoice *choice = [[SDLChoice alloc] initWithId:cell.choiceId menuName:menuName vrCommands:(NSArray<NSString *> * _Nonnull)vrCommands image:image secondaryText:secondaryText secondaryImage:secondaryImage tertiaryText:tertiaryText];
    return [[SDLCreateInteractionChoiceSet alloc] initWithId:(UInt32)choice.choiceID.unsignedIntValue choiceSet:@[choice]];
}

@theresalech
Copy link
Contributor

@rbright55 can you please submit a new issue with this information? Thanks!

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
No open projects
v6.3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants