smartdevicelink / sdl_requirements

Collection of requirements/technical tasks for new sdl_core features
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

Processing not PNG file type, not DYNAMIC image type with parameter `isTemplate = true` #53

Closed GetmanetsIrina closed 6 years ago

GetmanetsIrina commented 6 years ago

Question is related to proposal https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0062-template-images.md.

What if isTemplate = true parameter will be used with not PNG file? What if isTemplate = true parameter will be used with STATIC image type? What is expected SDL and HMI behavior?

KhrystynaDubovyk commented 6 years ago

@kshala-ford, please advise on the question above.

KhrystynaDubovyk commented 6 years ago

@robinmk, please advise on SDL-HMI expected behavior for the following cases:

Case 1 Case 2
Pre-conditions Pre-conditions
not PNG image was added via PutFile PNG image was added via PutFile
Steps Steps
mob app sends a RPC with uploaded image
and isTemplate = true in Image structure
mob app sends a RPC with uploaded image
and isTemplate = true
and STATIC image type in Image structure
Expected Expected
SDL -> HMI ?
SDL -> app: RPC (resultCode)
SDL -> HMI ?
SDL -> app: RPC (resultCode)
kshala-ford commented 6 years ago

thanks @KhrystynaDubovyk for bringing this up. According to this comment we now need to identify error cases.

Regarding Case 1

I would say HMI should ignore isTemplate = true. SDL should simply forward the request to HMI. It's can be seen by the HMI as a PNG file that does not contain any transparent area. The RPC response should be success = true and resultCode = WARNING. The response info message can be that isTemplate was ignored because the provided image does not include alpha/transparent channel.

Reason: Following the goal of SDL proposal 0042 RPCs like Show or CreateInteractionChoiceSet must not fail if it can be avoided.

Regarding Case 2

Similar to Case 1 SDL should simply forward the request to HMI. HMI should ignore the parameter because it only affects dynamic images.

Reason: Static images are already covered by the HMI. I think it should not even send a warning. If the image type is STATIC the HMI should not even check for isTemplate.

Case 1 Expected Case 2 Expected
SDL -> HMI including isTemplate if set by app SDL -> HMI including isTemplate if set by app
SDL -> app: RPC success (WARNING). SDL -> app: RPC success (SUCCESS)

@robinmk Are you OK with that?

robinmk commented 6 years ago

@kshala-ford , Agree for Case 1

@KhrystynaDubovyk ,

  1. What happens today if the referenced image is actually of type 'DYNAMIC' but the request which is sent out from the app specifies it as 'STATIC'? I believe the request would be rejected as 'INVALID_DATA'

  2. If the RPC request references a value which of type 'STATIC' and has the 'isTemplate' flag set to 'True', then I agree with what Kujtim said - Forward the request to HMI and HMI should ignore the 'isTemplate' flag.

KhrystynaDubovyk commented 6 years ago

@robinmk, @kshala-ford

  1. What happens today if the referenced image is actually of type 'DYNAMIC' but the request which is sent out from the app specifies it as 'STATIC'?

currently SDL transfers the request to the HMI and gets UNSUPPORTED_RESOURCE response from HMI.

@robinmk, is this behaviour acceptable?

robinmk commented 6 years ago

hmm...So HMI checks for the list of static images and finds that it does not support that particular image. Since the app is informed about the failure, the design is acceptable to me. @kshala-ford , what do you think?

kshala-ford commented 6 years ago

@robinmk I'm OK with that

KhrystynaDubovyk commented 6 years ago

Many thanks.