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

WebEngine Projection mode #809

Merged
merged 5 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions proposals/NNNN-webengine-projection-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# WebEngine Projection mode

* Proposal: [SDL-NNNN](NNNN-webengine-projection-mode.md)
* Author: [Kujtim Shala](https://github.com/kshala-ford)
* Status: **Awaiting review**
* Impacted Platforms: [Core / JavaScript ]

## Introduction

This proposal is created based on discussion in https://github.com/smartdevicelink/sdl_evolution/issues/767.
It extends [SDl-0240 - WebEngine support for SDL JavaScript](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0240-sdl-js-pwa.md) with a projection mode (formally known as OpenHMI) that was introduce with [SDL-0031 Mobile Projection](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0031-mobile-projection.md).
This conversation was marked as resolved.
Show resolved Hide resolved

## Motivation

This chapter describes a feature made possible using a WebEngine. A WebEngine can come with a web page rendering component described as a WebView in this proposal. The proposal describes how apps based on a WebEngine can be presented not only using system templates but that can control the WebView using the app's document object.
This conversation was marked as resolved.
Show resolved Hide resolved

## Proposed solution

The app HMI type `PROJECTION` should be enabled for in-vehicle apps. When apps with this HMI type are activated, the HMI should make the web page of this app visible on the screen. This web page will become the main window of the application. The window capabilities of this open main window will be empty except for the window ID and physical button capabilities. `Show` requests that address the main window won't have any effect on the HMI. If the app sends this request, Core should return an unsuccessful response with the result code `RESOURCE_NOT_AVAILABLE`. The info field should note that the app is registered with projection mode enabled.

![Screenshot example of a web app](../assets/proposals/NNNN-webengine-projection-mode/web-app-example.jpg)

> Example of a local web app presenting the user interface with the WebView.

Widgets are still available and can be controlled using `Show` RPC. Any overlay like Alert, ChoiceSets, Slider etc. are also available to the application.

##### Policy control

The HMI type `PROJECTION` is policy controlled. On the policy server this HMI type can be added to the valid HMI type list per app ID. Only apps with permissions to use this HMI type would be allowed to register.

##### User interface guidelines (Driver Distraction rules)

With the current depth of this proposal, the HMI type should be used by 1st party OEM apps only. With future proposals and workshops the SDLC could open the HMI type to 3rd party by creating and defining proper driver distraction and user interface guidelines.

At the time of this proposal being in review, a set of driver distraction rules are being created and proposed to enable 3rd party using the projection mode. The following bullet points list items that will be described further in the ruleset:
This conversation was marked as resolved.
Show resolved Hide resolved

- minimum font size
- minimum contrast between font and background
- min/max brightness (for day and night mode)
- number of buttons
- minimum size of a button
- No customized keyboard
This conversation was marked as resolved.
Show resolved Hide resolved
- No video playback (exceptions in standstill per countries)
This conversation was marked as resolved.
Show resolved Hide resolved
- NHTSA related guidelines
o Amount of text (button and text fields)
o number of lines of text
o Complexity of use cases (number of steps to fulfill a use case)
This conversation was marked as resolved.
Show resolved Hide resolved

More items may be included in the ruleset as they become Driver Distraction affected.

##### System context and event change

Independent of the app presentation type, the HMI will continue to provide system context information from the app. An application which uses the projection mode should continue to receive `OnHMIStatus` notifications and SDL Core will still be notified about event changes.

Different to mobile app projection mode, in-vehicle apps won't be streaming video to the IVI, therefore the app and the library wouldn't listen for `OnHMIStatus.videoStreamingState` parameter to start presenting the app UI through the WebView.

## Potential downsides

The same downsides apply as for [SDL 0031 Mobile Projection](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0031-mobile-projection.md)

## Impact on existing code

To the author's knowledge there is no impact to existing code unless there are barriers implemented in SDL Core preventing an in-vehicle app from registering with the `PROJECTION` HMI type.

## Alternatives considered

There are no alternatives available that the author feels competitive to the projection mode using a WebView.