Leveraging webOS Technologies on Automotive

LG Electronics Silicon Valley Lab

Lokesh Kumar Goel

Steve Lemke

Roy Sutton

webOS Open Source Edition (OSE)

1/23

  • Powerful and Easy-to-use Open Software Platform
  • Highly Optimized Open Source Web App Framework
  • Open Platform for All Industries and Participants

webOS Open Source Edition(OSE) is now available at http://webosose.org

webOS OSE Components: Layered View

2/23

webOS OSE Components: Dynamic View

3/23

Luna Bus

Product Specific

Services

Node.js
Service

Framework

Media (A/V) Manager

Other Native Apps

Luna Surface Manager

Web Apps

Qt/QtWayland

System App

Manager

QML Apps

webOS

Web Runtime

Web App

Manager

Enact

Frame-

work

Memory Manager

Update Manager

Download/Upload Manager

Diagnostic Services

DRM/KMS

webOS OSE components interesting for AGL

4/23

Gap in AGL

webOS component

Features

HTML5 App runtime

webOS WAM + Enact

  • Full featured HTML5/JS web-appruntime
  • Independent of QT
  • Common engine between browser app and App-runtime
  • Powered by chromium
  • Enact: Easy to develop and customize apps

Full featured enhanced compositor

Qtwayland LSM

  • Independent of Qt LGPLv3 code
  • Enhanced features like window groups, appId management, partial composition, full app lifecycle
  • Customizable and replaceable System UI and compositor

Download Service

Download Manager

  • Centralized download management for different services/apps
  • Download/Upload/History/Encryption of Files to/from device
  • Centralized Access control

Centralized Memory Management

Memory Manager

  • Monitor and set scale on kernel memory thresholds
  • Perform system/component wise memory management
  • Perform Device/UX specific memory optimization

Other Needs

Update Manager, Diagnostic Services, Media Manager, etc...

LGE: Contacts

5/23

Name

Skype ID

Email

Jose Dapena Paz (Webengine - Spain)

jose_dapena

jose.dapena@lge.com

Jani Hautakangas (Webengine - Finland)

jani.hautakangas

jani.hautakangas@lge.com

Andre Rosa (Webengine - California)

andre.goddard

andre.rosa@lge.com

Lokesh Kumar Goel (WebOS leader - California)

lokesh.k.goel

lokeshkumar.goel@lge.com

Steve Lemke (WebOS Leader - California)

lemketron

steve.lemke@lge.com

Roy Sutton (Enact - California)

thandril

roy.sutton@lge.com

6/23

WebApp-Runtime for AGL Proposal

WAM Introduction in AGL AMM tokyo Feb 2018

7/23

webOS WebRuntime for AGL: Proposed Process Architecture

Renderer

process

content layer

Renderer

process

WebAppLauncher

WebAppLauncher

(Shared Browser Process)

WebAppLauncher

(app-specific SMACK permissions)

libwindowmanager

libhomescreen

Renderer

process

content layer

Blink

Binder for HVAC & other AGL services

WebAppManager

WAM

pluggables

HTML5 Apps Support on AGL - Features

9/23

  • Web App lifecycle (launch, close, suspend/resume).
  • CPU Optimization (launch time, suspend/resume, fast task switching).
  • Does not require Qt/QtWebengine
  • Recovery Mechanism: recovers ‘no response’ apps.
  • Access Control: controls access to system resources depending on the web app’s trust level.
  • Responding to Low Memory: provides an interface for low memory responses.

HTML5 Apps Support on AGL - Source Code

10/23

Proof of concept from LG-SVL codecamp

AGL meta layer at webOS OSE github:

Source in AGL branches:

WAM and Enact Demo on AGL

11/23

  • WebAppManager runs four different html5 apps
    • MemoryMatch
    • Annex
    • HVAC-Enact (Enact AGL HVAC Proof of Concept)
    • Youtube

Next Steps: Chromium

12/23

  • Port webOS WebView to Chromium ToT
  • Port libcbe to Chromium ToT (optional)
  • Add AGL window manager support for Ozone Wayland
  • Bugfixing
  • x Port JS extension support
  • F Multimedia acceleration (optional)
  • F Multiseat - Multiscreen (optional)

Next Steps: WAM

13/23

  • Implement security model proposal (AFM/binder/…).
  • Integration with AGL window manager.
  • x JS injection support for AGL (pluggable for talking to binder).
  • Port WAM to Linux desktop
  • Identify and implement refactors in WAM
  • Qt-less WAM
  • C++14 (optional)

Next Steps: System Integration

14/23

  • Recipes cleanup
  • Update for Funky Flounder
  • Port to specific reference targets

Introduction

Roy Sutton

June 2018

Why do you need a framework?

  • Consistent look, feel and behavior across apps
  • Consistently high performance across apps
  • Ability to make improvements across apps, quickly and efficiently
  • Avoidance of duplicated effort across app teams
  • Consistency of architecture, practices and style across app teams
    • Increased ability to share code between apps
    • Increased ability to transfer engineers between app teams
    • Reduced fragmentation

Enact Goals

  • Reduce Developer Error
  • Improve Performance
  • Reduce Time to Develop Application
  • Take Advantage of JavaScript Ecosystem
  • Adopt Modern JavaScript Features
  • Meet Needs of Internal Developers
  • Create Safe Styling API

With Enact:

> npm install -g @enact/cli

> enact create myApp

> cd myApp

> npm run serve

Development Process

  • Small team and individual exploration (Pair Programming)
  • Test Driven Development
  • Distributed Development Model (US, Korea, India)
  • Clear Goals for API and Naming
  • Evolve Tooling with Framework

Release History

  • First alpha release (1.0.0-alpha.1) - September 30, 2016
  • Most recent release (2.0.0-beta.6) - June 4, 2018
  • Consistent releases every week
  • Following Semantic Versioning

The Parts of Enact

Support Libraries

  • Spotlight
  • I18n
  • webOS
  • UI
  • eslint-config-enact
  • eslint-plugin-enact

Tooling

  • cli
  • ui-tests
  • enact-bench
  • Travis

Documentation

Samples and Patterns

  • samples
  • Sampler

Lessons Learned

  • Continuous testing and measurement is key to quality
  • There is always more to learn
  • Build on top of the work of others
  • There are no ‘silver bullets’
  • Stateless components are easy to test
  • Good tooling reduces cognitive load
  • Optimize developer productivity over other factors
  • Good process is essential for developer freedom
  • There are never enough hours in a day

Looking Forward

  • Expanding Theming Capabilities
  • New UI Libraries
  • Improve API, Documentation and Support Tools
  • React Fiber Support

Appendix

34/23

Customizable webOS WebApp Runtime

WebAppTV

WebAppXYZ

WebAppMgr WebApp Adaptation Layer

LunaBus (WebOS)

DBus

WebAppMgr Service Adaptation Layer

Security model

Pluggable

JS Extensions

WebAppMgr Core

WebApp lifecycle manager

WebApp plugin manager

WebApp event manager

WebSockets

Security model

Pluggable

JS Extensions

WAM

WebAppMgr: pluggable architecture

  • Standardized mechanism to wrap native platform IPC and APIs for ease of use in JS
  • Platform security model can also be supported by pluggable
  • AGL-specific (and web standard) APIs can be exposed:
    • Audio Visual API
    • Vehicle information API
    • Navigation engine API
    • Specific TTS/STT API
    • Specific sensors API

Example: beacom extension API

WebAppMgr: on top of Chromium

Support for latest standards:

  • W3C/HTML5 DOM, Form and Styles
  • Device APIs: touch events, device orientation, network information
  • Graphics APIs: Canvas 2d context, SVG, WebGL
  • Media APIs: audio/video tags, web audio, user media
  • Communications: WebSockets, push messages, session history
  • Storage APIs: latest standards including IndexedDB, WebSQL, file access
  • Security APIs: CORS, CSP1.0, OOPIF

WAM feature set (1/3)

Feature

Area

Detailed Description

Proven technology

Reliability

Shipped on millions of LG webOS Smart TVs (and other devices) for over four years

Local web apps

Deployment

Provides support for running locally installed (or pre-installed) web apps

Wayland support

Window Mgmt.

Integration with Wayland compositor

System VKB support

Input

Integration with Ozone Wayland text input

Memory Management

Memory

Support for aggressive memory pressure policies

Web Container

Preloading

Improved startup time by preloading new app process

Unified web service

Security/
Memory

Shared browser process secured with sandboxing

WAM feature set (2/3)

Feature

Area

Detailed Description

WAM pluggable/ injection

Extensions

Define access to specific web extensions per application in app manifest

Native app look & feel

LifeCycle

End to end lifecycle management (app launch/close/switching)

Suspend/Resume

Lifecycle

Automatically suspends/resumes media, graphics and javascript execution

Splash screen

Lifecycle

Integration with OS application launch splash screen and first frame detection

App control

Capabilities

By app manifests, apps can control webview features like zoom, scrollbar, VKB etc.

Advanced window support

Graphics

Wayland support for multiple windows, floating windows and overlays

WAM feature set (3/3)

Feature

Area

Detailed Description

Custom resolution

Graphics

Supports different resolutions per app

Custom keys support

Input

Support for handling 5-way arrow key navigation on applications

Multi-touch support

Input

Optimized multi-touch support

Crash recovery

Reliability

Automatically recovers from crashes

Remote web inspector and tracing

Debugging

Supports remote web inspector and tracing

Per app profile

Isolation

Supports loading per app profiles

AGL_Lorient - Google Slides