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
Align System Capability Manager Behavior with Java Suite #1543
Align System Capability Manager Behavior with Java Suite #1543
Conversation
* Working on making them return with data if subscriptions are not supported as well
* Update subscription status dict
* Added logs
* Fix swift names of APIs
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.
Left some comments
* Fix the displaysObserver not being properly generated
* Add tests around non-DISPLAYS subscribed bool for subscriptions with 3 selector parameters
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.
Left some comments
Co-Authored-By: NicoleYarroch <nicole@livio.io>
…ps://github.com/smartdevicelink/sdl_ios into bugfix/issue-1535-align-systemcapabilitymanager
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.
Left some comments
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.
Documentation changes requested
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.
Left some comments on docs
Fixes #1535
This PR is ready for review.
Risk
This PR makes minor API changes.
Testing Plan
Unit Tests
subscribe
methodisCapabilitySupported
methodCore Tests
Test Obj-C subscribe with 0, 1, 2, and 3 parameters
Test Obj-C subscribe with update handler
Test Obj-C subscribe with block (deprecated)
Test isCapabilitySupported
Check method signatures for Swift
Core version / branch / commit hash / module tested against: Sync Gen 3.2 (18124_DEVTEST), Manticore v.2.4.2 (SDL Core v6.0.1)
HMI name / version / branch / commit hash / module tested against: Sync Gen 3.2 (18124_DEVTEST), Manticore v.2.4.2 (Generic HMI v0.7.2)
Summary
This PR makes additions and some minor behavioral changes to existing system capability manager methods in order to bring behavior into alignment with the Java Suite SCM as much as is reasonable.
Changelog
Enhancements
SystemCapabilityManager.subscribeToCapabilityType:withUpdateHandler:
method with more verbose error reporting than the now deprecatedSystemCapabilityManager.subscribeToCapabilityType:withBlock:
method.SystemCapabilityManager.subscribeToCapabilityType:withObserver:selector:
selector now supports up to three parameters, adding anerror
parameter and booleansubscribed
parameter.subscribe
methods now immediately return the cached value.isCapabilitySupported:
method that can be used to quickly determine if the feature is supported by the head unit or not.Bug Fixes
updateCapabilityType:completionHandler:
call or the firstsubscribe
to that capability type is made.unsubscribeFromCapabilityType:withObserver:
such that no observers remain for that type will now unsubscribe theSystemCapabilityManager
from receiving any more data about that type untilupdateCapabilityType:completionHandler:
or anothersubscribe
call is made for that type.CLA