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

Implement SDL-0221 Remote Control - Allow Multiple Modules per Module Type #1361

Conversation

SatbirTanda
Copy link
Contributor

Fixes #1272

This PR is ready for review.

Risk

This PR makes minor API changes.

Testing Plan

Added Unit Tests

Summary

Create 2 new RPCs (GetInteriorVehicleDataConsent & ReleaseInteriorVehicleDataModule) and add moduleId and moduleType param to existing classes. Deprecate SDLSeatLocation and a few initializers.

CLA

@SatbirTanda SatbirTanda force-pushed the feature/#1272/multiple_modules branch from 3a29126 to 1a533e3 Compare July 29, 2019 12:05
@NicoleYarroch NicoleYarroch added enhancement proposal Accepted SDL Evolution Proposal labels Jul 29, 2019
@NicoleYarroch NicoleYarroch added this to the 6.4.0 milestone Jul 29, 2019
@NicoleYarroch NicoleYarroch added this to In progress in v6.4 via automation Jul 29, 2019
@joeljfischer joeljfischer requested review from NicoleYarroch and removed request for NicoleYarroch July 29, 2019 13:21
@theresalech
Copy link
Contributor

@SatbirTanda as there is a currently an Evolution Proposal in review regarding this feature (here), we will need to wait for that proposal to be voted on by the SDLC Steering Committee before reviewing this PR. The vote is scheduled to take place 2019-07-30.

@SatbirTanda
Copy link
Contributor Author

@theresalech ready for review

Copy link
Contributor

@justingluck93 justingluck93 left a comment

Choose a reason for hiding this comment

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

Also please make sure to add SeatLocationCapability to the SDLSystemCapabilityManager in order for a developer to access this information.

/**
* Information about a RC module, including its id.
*
* SDLModuleInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Please mark this as optional in the documention

@@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* SDLModuleInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Mark documentation to state this is optional

@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* SDLModuleInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Please be sure to mark all optimal parameters as optional if needed.

@@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* SDLModuleInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add that this is optional in documentation

Copy link
Contributor

Choose a reason for hiding this comment

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

see SDLSystemCapabilityManager.h for examples

@@ -42,30 +42,6 @@ - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOO
return self;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

There should be an init that includes the new parameter with all properties like you did in the other capabilities files.

@@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* SDLModuleInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the documentation to state this is optional

@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* SDLModuleInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update documentation to state this is optional

@@ -42,30 +42,6 @@ - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOO
return self;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this class have an init that includes moduleInfo like you did in SDLAudioControlCapabilities.h

@@ -197,7 +197,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* SDLModuleInfo
*/
@property (strong, nonatomic) SDLModuleInfo *moduleInfo;
@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo;

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this class should have an init that includes moduleInfo like you did in SDLAudioControlCapabilities.h

@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was a convince init not added that includes the menuID?

@SatbirTanda
Copy link
Contributor Author

SatbirTanda commented Aug 22, 2019

@theresalech ready for rereview

Copy link
Contributor

@justingluck93 justingluck93 left a comment

Choose a reason for hiding this comment

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

Just some small minor things left, looks good overall

@@ -15,14 +15,23 @@ NS_ASSUME_NONNULL_BEGIN

@interface SDLButtonPress : SDLRPCRequest

- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType;
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId instead"));;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId instead"));;
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId: instead"));;

- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType;
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId instead"));;

- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId;
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId;

@@ -32,6 +32,19 @@ - (instancetype)initWithButtonName:(SDLButtonName) buttonName moduleType:(SDLMod
return self;
}

- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId {
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId {

@SatbirTanda
Copy link
Contributor Author

@theresalech ready for review

Copy link
Contributor

@justingluck93 justingluck93 left a comment

Choose a reason for hiding this comment

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

Everything looks good from a code review. I still have to test this feature against core.

Copy link
Contributor

@justingluck93 justingluck93 left a comment

Choose a reason for hiding this comment

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

While testing I found one more thing that needs to be addressed, all the file imports you added to SmartDeviceLink.podspec also needs to be added to SmartDeviceLink-iOS.podspec. Please make those changes. Please also double check that all needed files have be added to those two files.

@SatbirTanda
Copy link
Contributor Author

@theresalech ready for re-review

Copy link
Contributor

@justingluck93 justingluck93 left a comment

Choose a reason for hiding this comment

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

One more minor update, it appears Request Handlers are not working for the new RPCs. To fix this please add SDLDidReceiveGetInteriorVehicleDataConsentResponse and SDLDidReceiveReleaseInteriorVehicleDataModuleResponse to SDLNotificationConstants.ms allResponseNamesarray

@SatbirTanda
Copy link
Contributor Author

@theresalech ready for review

@justingluck93
Copy link
Contributor

Changes look good. Still need to test against core when core issues are fixed.

@AStasiuk
Copy link

@justingluck93, there are no opened issues in core right now. Could you please specify about which issues are talking about?

@justingluck93
Copy link
Contributor

The issues is with an open PR smartdevicelink/sdl_core#2984 not anything currently in core. It deals with getting consent to control a module.

@AStasiuk
Copy link

@justingluck93 , could you please specify preconditions, steps for reproduction and SDL logs.
Suggested to put all this info in smartdevicelink/sdl_core#2984

@IGapchuk
Copy link

IGapchuk commented Sep 2, 2019

@SatbirTanda Please be informed, that SDL Core's behavior has been changed during SDL Core's changes review. Please take a look at the following comments:

that describe the new behavior for getting consent to control a module for all accessMode flows:

1. If accessMode=AUTO_ALLOW, return true by default
2. If accessMode=AUTO_DENY, check if another app is using the resource
   a. If the resource is IN_USE, return false
   b. If the resource is FREE, return true
3. If accessMode=ASK_DRIVER, check if the consent is cached
 a. If it is cached, return that result
 b. If it is NOT cached, check if another app is using the resource
    i) If the resource is FREE(and the user in the resource’s serviceArea), return true
    ii) If the resource is IN_USE, prompt the driver for consent 
   b. If it is NOT cached, then prompt the driver for consent

Also in these comments, you can find references to commits with appropriate changes in SDL Core.
If you will have comments on these changes, please feel free to provide us with them.

@justingluck93
Copy link
Contributor

One last thing. I just got information that the Mobile api needs to be changed slightly.

GetInteriorVehicleDataConsent response class needs to be updated.

The allowed property is now NOT mandatory.

<param name=“allowed” type=“Boolean” array=“true” mandatory=“*true*“>
was changed to
<param name=“allowed” type=“Boolean” array=“true” mandatory=“*false*“>

Please make this change in all needed places.

Copy link
Contributor

@justingluck93 justingluck93 left a comment

Choose a reason for hiding this comment

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

Just some minor changes due to a change in the mobile API


Required
*/
@property (strong, nonatomic) NSArray<NSNumber<SDLBool> *> *allowed;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should now be changed to

Suggested change
@property (strong, nonatomic) NSArray<NSNumber<SDLBool> *> *allowed;
@property (strong, nonatomic, nullable) NSArray<NSNumber<SDLBool> *> *allowed;

}
#pragma clang diagnostic pop

- (void)setAllowed:(NSArray<NSNumber<SDLBool> *> *)allowed {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- (void)setAllowed:(NSArray<NSNumber<SDLBool> *> *)allowed {
- (void)setAllowed:(nullable NSArray<NSNumber<SDLBool> *> *)allowed {

[self.parameters sdl_setObject:allowed forName:SDLRPCParameterNameAllowed];
}

- (NSArray<NSNumber<SDLBool> *> *)allowed {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- (NSArray<NSNumber<SDLBool> *> *)allowed {
- (nullable NSArray<NSNumber<SDLBool> *> *)allowed {

@SatbirTanda
Copy link
Contributor Author

@theresalech ready for review

v6.4 automation moved this from Review in progress to Reviewer approved Sep 4, 2019
@joeljfischer joeljfischer merged commit 8b78386 into smartdevicelink:develop Sep 4, 2019
v6.4 automation moved this from Reviewer approved to Done Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Accepted SDL Evolution Proposal
Projects
No open projects
v6.4
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants