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 I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
Linaro
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
National Cheng Kung University
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
Opersys inc.
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
Opersys inc.
 
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
The Linux Foundation
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
Opersys inc.
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
Yu-Hsin Hung
 
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
The Linux Foundation
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
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
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
Opersys inc.
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
Linaro
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
National Cheng Kung University
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
Min-Yih Hsu
 
Android Audio System
Android Audio SystemAndroid Audio System
Android Audio System
Yi-Hsiang Huang
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
Anil Kumar Pugalia
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
Nanik Tolaram
 

What's hot (20)

Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
 
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
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
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
Android Audio System
Android Audio SystemAndroid Audio System
Android Audio System
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 

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
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
Emertxe Information Technologies Pvt Ltd
 
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
 

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
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
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
 

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

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
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
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
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
 
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
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
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)
 
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
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

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