SlideShare a Scribd company logo
Making a
Headless-Android
Device
Lessons Learned
NDC TechTown, 2017
Patricia Aas & Johan Herland
Pictures from pixabay.com (CC0)
Patricia Aas
Vivaldi Technologies
Cisco Systems
Opera Software
Twitter: @pati_gallardo
Johan Herland
Cisco Systems
Opera Software
Git Dev Community
Twitter: @jherland
Outline
- Why?
- Architecture
- Devices
- Composition
- Chromium
- Lessons Learned
So… What do we know?
And why should you care?
Full Android
Using Google’s AOSP, or a more
customized Android Board Support
Package (BSP) from a chip vendor.
Embedded Linux
No Android parts.
Typically based on
glibc, busybox, etc.
Unchartered Territory
Important questions
Do you have:
- Existing codebase?
- Upstream BSP?
- 3rd party dependencies?
What kind of device:
- Display?
- Single or multiple apps?
- Custom H/W?
Architecture : Deep Dive
Full Stack Android
- Java App ecosystem
- Graphics infrastructure
- Supported by modern SoCs
- Linux kernel w/Android features
- Libc : Bionic
Embedded Linux
- Stable/well-known components
- “Mix-and-match”
- C/C++ or web apps
- “Vanilla” kernel (or not...)
- Libc : GNU glibc
Bionic
- Developed specifically for Android
- Focus: small size and speed
- Compatibility:
- Almost all of C11 and POSIX
- Some GNU/BSD extensions
- C++ : “It’s complicated”
GNU glibc
- Used “everywhere”
- Focus:
- Application support
- Standards compliance
- Completeness
- Compatibility: Yes ☺
Platform Architecture - Embedded Linux
Linux kernel
Device drivers GNU glibc
Libraries (SSL, SQLite, etc.) System utils (systemd, busybox)H/W abstraction (OpenGL, alsalib, etc.)
Compositor (XServer, Wayland)
Application framework (Qt, GTK, Chromium)
Apps
Services/daemons (sshd, httpd)
Your application
Platform Architecture - Full Stack Android
Linux kernel (w/Android features: binder, wakelocks, etc.)
Device drivers Bionic libc
H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.)
Services (SurfaceFlinger, AudioFlinger, etc.)
Android runtime (ART;
previously Dalvik JVM)
Android Application Framework
Android Apps
System utils (init, ADB, toolbox)
Your application
Platform Architecture - Headless Android based on Bionic
Linux kernel (w/Android features: binder, wakelocks, etc.)
Device drivers Bionic libc
H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.)
Services? (SurfaceFlinger, etc.)
System utils (init, ADB, toolbox)
Your application
Platform Architecture - Headless Android based on glibc
Linux kernel (w/Android features: binder, wakelocks, etc.)
Device drivers Bionic libc
H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.)
Services? (SurfaceFlinger, etc.)
System utils (systemd, busybox)
GNU glibc
Hybris?
Your application
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Devices
Display Composition
- No display
- Single full-screen app
- Multiple apps
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
No Display
Traditional Embedded
- Appliance / IOT
No Graphics Integration
No Composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon
No bionic dependencies
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon
OpenWRT et al
Single full-screen app
Single-purpose device :
- Digital signage
- Kiosk-style device
- Videoconferencing endpoint
Needs Graphics Integration
No Complex Composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Needs glibc/bionic bridge
for graphics integration
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Cisco Sparkboard Cisco Spark Room Series
Cisco TelePresence MX/SX
Tesla Car OS?
OpenWRT et al
Multiple Apps
Consumer Device :
- Phone
- Tablet
- Smart TV
Needs App Store (e.g. Google Play)
Needs Complex Composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Needs glibc/bionic bridge
Needs complex composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Kindle Fire Boot2Qt (1st version) Sailfish (Jolla), Ubuntu Touch
Cisco Sparkboard Cisco Spark Room Series
Samsung Tizen, LG webOS
Cisco TelePresence MX/SX
Tesla Car OS?
OpenWRT et al
Composition
Composition
Need to get pixels on screen
- Compose just one window
with OpenGL
- Compose multiple windows
using external composer /
Hardware Composer
The Hardware Composer
Standardized Android porting
API for rendering to the screen.
Takes a set of surfaces and
composes them to the full frame
for the screen.
LibHybris : Runtime Linker Magic
What is LibHybris?
Dynamically loads and links
bionic libc and bionic linked libs
into a glibc process
Gives access to the bionic libs in
a glibc process
Creator : Carsten Munk
Linux kernel (w/Android features: binder, wakelocks, etc.)
Headless Glibc Android using LibHybris
Your Compositor / GUI App
LibHybris
Bionic
SurfaceFlinger / HWC
OpenGL shared lib
GUI lib
GNU glibc
Other libs
A bionic GPU process?
Pipe GPU commands over a
local pipe to a bionic process
that does the composition.
Linux kernel (w/Android features: binder, wakelocks, etc.)
Headless Glibc Android using a Bionic GPU Process + IPC
GUI AppCompositor
GUI lib
GNU glibc
IPC-GL client
SurfaceFlinger / HWC
OpenGL shared lib
Bionic
IPC
Other libs
IPC-GL server
Using Chromium as GUI
Composing With Chromium
- Single App : Single
fullscreen webapp
(e.g. Electron model)
- Multi App : Browser model,
several webapps composed
together
Process Architecture
- Multi-process
- GPU access and composition
is done in a separate process
Lessons Learned
CC image courtesy of penjelly on Flickr
Existing Codebase
Porting to Java?
Porting from glibc to Bionic?
Rewrite to Android APIs?
What about other APIs you use?
- Do they exist in Android?
3rd-party dependencies?
Port to Bionic? Really !?
Will upstream accept the port?
Remove deps if possible!
What about alternative deps?
Push towards glibc platform!
Bringup & Maintenance
Minimize custom hardware!
Decouple customizations from
upstream BSP/platform
Keep changes out of the BSP
- Above the Android APIs
- Or below user space
(kernel drivers, device tree)
Maintaining Patches
Avoid patches when you can!
Minimize changes to the BSP itself
Decouple your changes from the guts of
Android
Structure your patches!
Patches across many different repos:
- Common scheme for maintenance
- Enumerate your current patchset
- Integrating new upstream release:
- Remove and Refresh
Big Ball of Mud
Plan for updates!
AOSP / BSP : Every year
3rd-party dependencies : Varies
Strict security policies (e.g. OpenSSL)
Chromium : Every month
Chip vendor : Hopefully never!
Too many patches!
- Can’t update Android version
- Can’t update 3rd-party libs
- Security pipeline clogged
- Project stalled!
Wrap it up!
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Your code + 3rd-party
dependencies built
against Bionic
Your code +
3rd-party
dependencies
built against
glibc
Bionic / Glibc
bridge
needed for
graphics &
composition
No display
Multi app
Single app
Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
Java app/service
One “home screen” app
App Store (Google’s Play
Store if CDD-compliant)
Multiple apps composited
by XServer/Wayland
EGL Window/Framebuffer
C/C++ app/service C/C++ app/daemon C/C++ app/daemon
Multiple apps composited
by SurfaceFlinger/HWC
via e.g. Hybris
Multiple apps composited
by SurfaceFlinger/HWC
SurfaceFlinger/HWC SurfaceFlinger/HWC via
e.g. Hybris
Plan for maintenance
Questions?
Feedback, please
Swag!

More Related Content

What's hot

Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
Opersys inc.
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
sudhir singh yadav
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
Android 10
Android 10Android 10
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
Emertxe Information Technologies Pvt Ltd
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
Md. Zahid Hossain Shoeb
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Emertxe Information Technologies Pvt Ltd
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
RuggedBoardGroup
 
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
William Liang
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
Nanik Tolaram
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
Shay Cohen
 

What's hot (20)

Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Android 10
Android 10Android 10
Android 10
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 

Similar to Making a Headless Android Device

Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)
Patricia Aas
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
dfages
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioMizanur Sarker
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
jakjak36
 
Mobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDKMobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDK
Intel® Software
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
Lars Vogel
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
Intel® Software
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015
Nilay Binjola
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
Bhavya Siddappa
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App Development
Andri Yadi
 
Graphical libraries
Graphical librariesGraphical libraries
Graphical libraries
guestbd40369
 
Introduction to the Android NDK
Introduction to the Android NDKIntroduction to the Android NDK
Introduction to the Android NDK
Sebastian Mauer
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
Ramesh Prasad
 
Add the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKitAdd the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKit
Igalia
 
Portinig Application, Drivers And Os
Portinig Application, Drivers And OsPortinig Application, Drivers And Os
Portinig Application, Drivers And Osmomobangalore
 
Play With Android
Play With AndroidPlay With Android
Play With AndroidChamp Yen
 
01 02 - introduction - adroid stack
01  02 - introduction - adroid stack01  02 - introduction - adroid stack
01 02 - introduction - adroid stack
Siva Kumar reddy Vasipally
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
Opersys inc.
 

Similar to Making a Headless Android Device (20)

Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)Making a Headless Android Device (Oslo Embedded Meetup 2018)
Making a Headless Android Device (Oslo Embedded Meetup 2018)
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
 
Mobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDKMobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDK
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
 
Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015Firefox OS - Hive Pilani 2015
Firefox OS - Hive Pilani 2015
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App Development
 
Graphical libraries
Graphical librariesGraphical libraries
Graphical libraries
 
Introduction to the Android NDK
Introduction to the Android NDKIntroduction to the Android NDK
Introduction to the Android NDK
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
Add the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKitAdd the power of the Web to your embedded devices with WPE WebKit
Add the power of the Web to your embedded devices with WPE WebKit
 
Portinig Application, Drivers And Os
Portinig Application, Drivers And OsPortinig Application, Drivers And Os
Portinig Application, Drivers And Os
 
Play With Android
Play With AndroidPlay With Android
Play With Android
 
01 02 - introduction - adroid stack
01  02 - introduction - adroid stack01  02 - introduction - adroid stack
01 02 - introduction - adroid stack
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 

More from Patricia Aas

NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdfNDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
Patricia Aas
 
Telling a story
Telling a storyTelling a story
Telling a story
Patricia Aas
 
Return Oriented Programming, an introduction
Return Oriented Programming, an introductionReturn Oriented Programming, an introduction
Return Oriented Programming, an introduction
Patricia Aas
 
I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)
Patricia Aas
 
Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)
Patricia Aas
 
Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)
Patricia Aas
 
Classic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdfClassic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdf
Patricia Aas
 
Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)
Patricia Aas
 
Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)
Patricia Aas
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming Language
Patricia Aas
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
Patricia Aas
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
Patricia Aas
 
DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)
Patricia Aas
 
The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)
Patricia Aas
 
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Patricia Aas
 
The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))
Patricia Aas
 
Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)
Patricia Aas
 
Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019) Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019)
Patricia Aas
 
Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)
Patricia Aas
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
Patricia Aas
 

More from Patricia Aas (20)

NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdfNDC TechTown 2023_ Return Oriented Programming an introduction.pdf
NDC TechTown 2023_ Return Oriented Programming an introduction.pdf
 
Telling a story
Telling a storyTelling a story
Telling a story
 
Return Oriented Programming, an introduction
Return Oriented Programming, an introductionReturn Oriented Programming, an introduction
Return Oriented Programming, an introduction
 
I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)I can't work like this (KDE Academy Keynote 2021)
I can't work like this (KDE Academy Keynote 2021)
 
Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)Dependency Management in C++ (NDC TechTown 2021)
Dependency Management in C++ (NDC TechTown 2021)
 
Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)Introduction to Memory Exploitation (Meeting C++ 2021)
Introduction to Memory Exploitation (Meeting C++ 2021)
 
Classic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdfClassic Vulnerabilities (MUCplusplus2022).pdf
Classic Vulnerabilities (MUCplusplus2022).pdf
 
Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)Classic Vulnerabilities (ACCU Keynote 2022)
Classic Vulnerabilities (ACCU Keynote 2022)
 
Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)Introduction to Memory Exploitation (CppEurope 2021)
Introduction to Memory Exploitation (CppEurope 2021)
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming Language
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
 
Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020Trying to build an Open Source browser in 2020
Trying to build an Open Source browser in 2020
 
DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)
 
The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)The Anatomy of an Exploit (NDC TechTown 2019)
The Anatomy of an Exploit (NDC TechTown 2019)
 
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)
 
The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))The Anatomy of an Exploit (NDC TechTown 2019))
The Anatomy of an Exploit (NDC TechTown 2019))
 
Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)Elections, Trust and Critical Infrastructure (NDC TechTown)
Elections, Trust and Critical Infrastructure (NDC TechTown)
 
Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019) Survival Tips for Women in Tech (JavaZone 2019)
Survival Tips for Women in Tech (JavaZone 2019)
 
Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)Embedded Ethics (EuroBSDcon 2019)
Embedded Ethics (EuroBSDcon 2019)
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 

Making a Headless Android Device

  • 1.
  • 2. Making a Headless-Android Device Lessons Learned NDC TechTown, 2017 Patricia Aas & Johan Herland Pictures from pixabay.com (CC0)
  • 3. Patricia Aas Vivaldi Technologies Cisco Systems Opera Software Twitter: @pati_gallardo Johan Herland Cisco Systems Opera Software Git Dev Community Twitter: @jherland
  • 4. Outline - Why? - Architecture - Devices - Composition - Chromium - Lessons Learned
  • 5. So… What do we know?
  • 6.
  • 7. And why should you care? Full Android Using Google’s AOSP, or a more customized Android Board Support Package (BSP) from a chip vendor. Embedded Linux No Android parts. Typically based on glibc, busybox, etc.
  • 9. Important questions Do you have: - Existing codebase? - Upstream BSP? - 3rd party dependencies? What kind of device: - Display? - Single or multiple apps? - Custom H/W?
  • 11. Full Stack Android - Java App ecosystem - Graphics infrastructure - Supported by modern SoCs - Linux kernel w/Android features - Libc : Bionic Embedded Linux - Stable/well-known components - “Mix-and-match” - C/C++ or web apps - “Vanilla” kernel (or not...) - Libc : GNU glibc
  • 12. Bionic - Developed specifically for Android - Focus: small size and speed - Compatibility: - Almost all of C11 and POSIX - Some GNU/BSD extensions - C++ : “It’s complicated” GNU glibc - Used “everywhere” - Focus: - Application support - Standards compliance - Completeness - Compatibility: Yes ☺
  • 13. Platform Architecture - Embedded Linux Linux kernel Device drivers GNU glibc Libraries (SSL, SQLite, etc.) System utils (systemd, busybox)H/W abstraction (OpenGL, alsalib, etc.) Compositor (XServer, Wayland) Application framework (Qt, GTK, Chromium) Apps Services/daemons (sshd, httpd) Your application
  • 14. Platform Architecture - Full Stack Android Linux kernel (w/Android features: binder, wakelocks, etc.) Device drivers Bionic libc H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.) Services (SurfaceFlinger, AudioFlinger, etc.) Android runtime (ART; previously Dalvik JVM) Android Application Framework Android Apps System utils (init, ADB, toolbox) Your application
  • 15. Platform Architecture - Headless Android based on Bionic Linux kernel (w/Android features: binder, wakelocks, etc.) Device drivers Bionic libc H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.) Services? (SurfaceFlinger, etc.) System utils (init, ADB, toolbox) Your application
  • 16. Platform Architecture - Headless Android based on glibc Linux kernel (w/Android features: binder, wakelocks, etc.) Device drivers Bionic libc H/W Abstraction Layer (HWC, etc.) Libraries (SSL, SQLite, etc.) Services? (SurfaceFlinger, etc.) System utils (systemd, busybox) GNU glibc Hybris? Your application
  • 17. Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
  • 19. Display Composition - No display - Single full-screen app - Multiple apps
  • 20. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic
  • 21. No Display Traditional Embedded - Appliance / IOT No Graphics Integration No Composition
  • 22. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon No bionic dependencies
  • 23. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service C/C++ app/service C/C++ app/daemon C/C++ app/daemon OpenWRT et al
  • 24. Single full-screen app Single-purpose device : - Digital signage - Kiosk-style device - Videoconferencing endpoint Needs Graphics Integration No Complex Composition
  • 25. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Needs glibc/bionic bridge for graphics integration
  • 26. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Cisco Sparkboard Cisco Spark Room Series Cisco TelePresence MX/SX Tesla Car OS? OpenWRT et al
  • 27. Multiple Apps Consumer Device : - Phone - Tablet - Smart TV Needs App Store (e.g. Google Play) Needs Complex Composition
  • 28. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Needs glibc/bionic bridge Needs complex composition
  • 29. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Kindle Fire Boot2Qt (1st version) Sailfish (Jolla), Ubuntu Touch Cisco Sparkboard Cisco Spark Room Series Samsung Tizen, LG webOS Cisco TelePresence MX/SX Tesla Car OS? OpenWRT et al
  • 31. Composition Need to get pixels on screen - Compose just one window with OpenGL - Compose multiple windows using external composer / Hardware Composer
  • 32. The Hardware Composer Standardized Android porting API for rendering to the screen. Takes a set of surfaces and composes them to the full frame for the screen.
  • 33. LibHybris : Runtime Linker Magic
  • 34. What is LibHybris? Dynamically loads and links bionic libc and bionic linked libs into a glibc process Gives access to the bionic libs in a glibc process Creator : Carsten Munk
  • 35. Linux kernel (w/Android features: binder, wakelocks, etc.) Headless Glibc Android using LibHybris Your Compositor / GUI App LibHybris Bionic SurfaceFlinger / HWC OpenGL shared lib GUI lib GNU glibc Other libs
  • 36. A bionic GPU process? Pipe GPU commands over a local pipe to a bionic process that does the composition.
  • 37. Linux kernel (w/Android features: binder, wakelocks, etc.) Headless Glibc Android using a Bionic GPU Process + IPC GUI AppCompositor GUI lib GNU glibc IPC-GL client SurfaceFlinger / HWC OpenGL shared lib Bionic IPC Other libs IPC-GL server
  • 39. Composing With Chromium - Single App : Single fullscreen webapp (e.g. Electron model) - Multi App : Browser model, several webapps composed together
  • 40. Process Architecture - Multi-process - GPU access and composition is done in a separate process
  • 41. Lessons Learned CC image courtesy of penjelly on Flickr
  • 42. Existing Codebase Porting to Java? Porting from glibc to Bionic? Rewrite to Android APIs? What about other APIs you use? - Do they exist in Android?
  • 43. 3rd-party dependencies? Port to Bionic? Really !? Will upstream accept the port? Remove deps if possible! What about alternative deps? Push towards glibc platform!
  • 44. Bringup & Maintenance Minimize custom hardware! Decouple customizations from upstream BSP/platform Keep changes out of the BSP - Above the Android APIs - Or below user space (kernel drivers, device tree)
  • 46. Avoid patches when you can! Minimize changes to the BSP itself Decouple your changes from the guts of Android
  • 47. Structure your patches! Patches across many different repos: - Common scheme for maintenance - Enumerate your current patchset - Integrating new upstream release: - Remove and Refresh
  • 48. Big Ball of Mud
  • 49. Plan for updates! AOSP / BSP : Every year 3rd-party dependencies : Varies Strict security policies (e.g. OpenSSL) Chromium : Every month Chip vendor : Hopefully never!
  • 50. Too many patches! - Can’t update Android version - Can’t update 3rd-party libs - Security pipeline clogged - Project stalled!
  • 52. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris Your code + 3rd-party dependencies built against Bionic Your code + 3rd-party dependencies built against glibc Bionic / Glibc bridge needed for graphics & composition
  • 53. No display Multi app Single app Embedded LinuxFull stack Android Headless GlibcHeadless Bionic Java app/service One “home screen” app App Store (Google’s Play Store if CDD-compliant) Multiple apps composited by XServer/Wayland EGL Window/Framebuffer C/C++ app/service C/C++ app/daemon C/C++ app/daemon Multiple apps composited by SurfaceFlinger/HWC via e.g. Hybris Multiple apps composited by SurfaceFlinger/HWC SurfaceFlinger/HWC SurfaceFlinger/HWC via e.g. Hybris