SlideShare a Scribd company logo
1
Android Treble:
Blessing or Trouble?
YouTubeTM
Livestream
March 27th
2018
Karim Yaghmour
@karimyaghmour
karim.yaghmour@opersys.com
2
These slides are made available to you under a Creative Commons Share-
Alike 3.0 license. The full terms of this license are here:
https://creativecommons.org/licenses/by-sa/3.0/
Attribution requirements and misc., PLEASE READ:
● This slide must remain as-is in this specific location (slide #2), everything
else you are free to change; including the logo :-)
● Use of figures in other documents must feature the below “Originals at”
URL immediately under that figure and the below copyright notice where
appropriate.
● You are free to fill in the “Delivered and/or customized by” space on the
right as you see fit.
● You are FORBIDEN from using the default “About” slide as-is or any of its
contents.
● You are FORBIDEN from using any content provided by 3rd parties without
the EXPLICIT consent from those parties.
(C) Copyright 2018, Opersys inc.
These slides created by: Karim Yaghmour
Originals at: www.opersys.com/community/docs
Delivered and/or customized by
3
About
● Author of:
● Introduced Linux Trace Toolkit in 1999
● Originated Adeos and relayfs (kernel/relay.c)
● Training, Custom Dev, Consulting, ...
4
Agenda
1. Introduction
2. Motivations
3. Enforcement
4. Traditional Android Release Flow
5. Treble's Intended Release Flow
6. Underneath the Framework
7. Linux Kernel
8. HIDL
9. VNDK
10.VINTF
11.VTS
12.Implications
13.Recommendations
5
1. Introduction
● Goals
● Release History
● Architecture
● Distribution scheme before 8.x / Treble
● What's added by Treble?
6
1.1. Goals
● Discuss Project Treble's motivations
● Describe differences with classic release flow
● Detail Project Treble's parts
● Outline implications and recommendations
7
1.2. Release History
● 2008 - Sept.: Android 1.0 is released
● 2009 - Feb.: Android 1.1
● 2009 - Apr.: Android 1.5 / Cupcake
● 2009 - Sept.: Android 1.6 / Donut
● 2009 - Oct.: Android 2.0/2.1 / Eclair
● 2010 - May: Android 2.2 / Froyo
● 2010 - Dec.: Android 2.3 / Gingerbread
● 2011 - Jan : Android 3.0 / Honeycomb – Tablet-optimized
● 2011 – May: Android 3.1 – USB host support
● 2011 – Nov: Android 4.0 / Ice-Cream Sandwich – merge Gingerbread and Honeycomb
● 2012 – Jun: Android 4.1 / Jelly Bean – Platform Optimization
● 2012 – Nov: Android 4.2 / Jelly Bean - Multi-user support
● 2013 -- July: Android 4.3 / Jelly Bean -- BLE / GLES 3.0
● 2013 -- Oct: Android 4.4 / KitKat -- Low RAM optimizations
● 2014 -- Nov: Android 5.0 / Lollipop - ART and other pixie dust
● 2015 -- Mar: Android 5.1 / Lollipop - Multi-SIM card
● 2015 -- Oct: Android 6.0 / Marshmallow -- New permission model
● 2016 – Aug: Android 7.0 / Nougat – Multi-window
● 2016 – Oct: Android 7.1 / Nougat – A/B updates
● 2017 – Aug: Android 8.0 / Oreo – Treble / PIP
● 2017 – Dec: Android 8.1 / Oreo – Low-end device optimizations
8
1.3. Architecture
9
1.4. Distribution scheme before 8.x
● Google releases new version of Android
● Ecosystem customizes it to new devices –
sometimes quite extensively
● Google enforces Compatibility Test Suite (CTS) –
guaranteeing developer API conformance
● Devices get certified and ship with GMS
● ....
● Devices rarely got upgrades
10
2. Motivations
● Updates: Android vs. iOS
● Android version propagation history
● “Official” Google Treble pitch
● Nature of Android
11
2.1. Updates: Android vs. iOS
Data from Apple as of January 18, 2018
https://developer.apple.com/support/app-store/
iOS Android
Data from Google as of February 5, 2018
https://developer.android.com/about/dashboards/
2.3.x Gingerbread
4.0.x Ice Cream Sandwich
4.1.x Jelly Bean
4.2.x Jelly Bean
4.3.x Jelly Bean
4.4.x KitKat
5.0.x Lollipop
5.1.x Lollipop
6.x Marshmallow
7.0.x Nougat
7.1.x Nougat
8.0.x. Oreo
8.1.x. Oreo
Earlier
IOS 10
IOS 11
12
2.2. Version propagation history
●
Implications:
●
Android comes out with cool new features
●
Perception is iOS gets them first
● Disclaimer: This is my reading
100%
90%
80%
70%
60%
50%
40%
30%
20%
10%
0%
D
ec
2009
Feb
2010
Apr 2010
Jun
2010
Aug
2010
O
ct 2010
D
ec
2010
Feb
2011
Apr 2011
Jun
2011
Aug
2011
O
ct 2011
D
ec
2011
Feb
2012
Apr 2012
Jun
2012
Aug
2012
O
ct 2012
D
ec
2012
Feb
2013
Apr 2013
Jun
2013
Aug
2013
D
ec
2013
Feb
2014
Apr 2014
O
ct 2013
Jun
2014
Aug
2014
D
ec
2014
Feb
2015
O
ct 2014*
*nodata
Apr 2015
Jun
2015
Aug
2015
*nodata
Jul 2015*
O
ct 2015
D
ec
2015
Feb
2016
Apr 2016
Jun
2016
100%
90%
80%
70%
60%
50%
40%
30%
20%
10%
0%
Aug
2016
O
ct 2016*
D
ec
2016
*nodata
Feb
2017
Apr 2017
Jun
2017
Android version
1.1
1.5
1.6
2.0
2.0.1
2.1
2.2
2.3-2.3.2
2.3.3-2.3.7
3.0
3.1
3.2
4.0-4.0.2
4.0.3-4.0.4
4.1
4.2
4.3
4.4
Cupcake
Donut
Eclair
Froyo
Gingerbread
Honeycomb
Ice Cream
Sandwich
Jelly Bean
KitKat
Gingerbread
Eclair
Eclair
Honeycomb
Honeycomb
Jelly Bean
Jelly Bean
5.0 Lollipop
Ice Cream
Sandwich
5.1 Lollipop
6.0 Marshmallow
7.0-7.1 Nougat
13
2.3. “Official” Google Treble pitch
● From source.android.com:
“The Android 8.0 release includes Project Treble, a major re-
architect of the Android OS framework designed to make it
easier, faster, and less costly for manufacturers to update
devices to a new version of Android.”
● In short:
● Recognition that updates are a problem
● Identification of update issues:
– Difficult
– Long
– Costly
14
2.4. Nature of Android
● Anyone is free to download Android
● Google enforces certification for GMS
● Google has no ability to force upgrades
● Google can only incentivize
15
3. Enforcement
● “To ensure forward compatibility of vendor implementations, the
new vendor interface is validated by the Vendor Test Suite (VTS),
which is analogous to the Compatibility Test Suite (CTS).”
● In sum:
● Path to upgrade has been charted
● But ... Comply or we won't certify
● Not much choice – Android is the “only game in town” aside from
Apple's iOS.
● Worthy end-goal:
● 4 to 5 years of upgrades on a single device
16
4. Traditional Android Release Flow
● Release flow
● Simplified internals view
● Example phone circa early 2014
● Upgrade after 5.x/Lollipop release
● Upgrade after 6.x/Marshmallow release
17
4.1. Release Flow
18
4.2. Simplified Internals View
19
4.3. Example Phone Circa Early 2014
● Just for the sake of example ...
● Say you bought a phone in early 2014:
● Samsung device
● Qualcomm chipset
● Verizon network
● Runs Android 4.4/KitKat at time of purchase
Note: brands/companies used for illustration purposes only, no specific device is implied.
20
4.4. Upgrade after 5.x/Lollipop release
5.x Release
QualcommQualcomm
Are they still
selling this chip? 5.x BSP
Samsung
Are they still
selling this phone or
is it important?
5.x Upgrade
Verizon
Are customers
still buying this?5.x Gets to Users
November 2014
21
4.5. Upgrade to 6.x/Marshmallow?
October 2015
6.x/Marshmallow
Qualcomm
Really? ???
Samsung
Really, Really??
???
Verizon
Really, Really, Really??!?!?!
22
5. Treble's Intended Release Flow
● Initial release flow
● New internals paradigm
● Overall reworked internals
● Targeted upgrade flow
● Theory of future release cycles
● Requirement
23
5.1. Initial Release Flow
8.x Release
QualcommQualcomm
8.x BSP
Samsung
8.x-based SKU
Verizon
8.x-based Device
24
5.2. New Internals Paradigm
25
5.3. Overall Reworked Internals
26
5.4. Targeted Upgrade Flow
27
5.5. Theory of Future Release Cycles
9.x Release
10.x Release
...
28
5.6. Requirement
● Google must continue to support old vendor
interfaces.
● For an initial 8.x device, future framework release
must support 8.x hardware enablement:
● 9.x / P
● 10.x / Q
●
11.x / R
●
...
● Aim seems to be 4-5 releases
29
6. Underneath the Framework
● Architecture
● Integration points
● Certification before Treble
● Certification after Treble
● What's added by Treble?
30
6.1. Architecture
31
6.2. Integration Points
SE
32
6.3. Certification Before Treble
Compatibility Test Suite
33
6.4. Certification After Treble
Compatibility Test Suite
SE
Vendor Test Suite
Vendor Test Suite
34
6.5. What's added by Treble?
● Linux kernel requirements
● HIDL – Hardware Interface Definition Language
● VNDK – Vendor NDK
● VINTF – Vendor Interface
● VTS – Vendor Test Suite
35
HIDLVNDK
VINTF
HIDL
VINTF
36
7. Linux Kernel
● Basics
● Release flow
● Real-life
● Treble and the kernel
● Links
37
7.1. Basics
● Necessary for Android
● Existed prior to Android
● Decision to use based on Linux succcess
● Google downstream from kernel developers
38
7.2. Release Flow
0
Linux Kernel
Release
39
7.3. Real-Life
● End-of-Life kernels very common on Android
● Security issues
● While invisible, major implications for user
● Inconsistent kernel versions between vendors
● Inconsistent updates between vendors
40
7.4. Treble and the Kernel
● Separate deliverables based on each player's role in the update
ecosystem.
● VTS-enforced aspects
● Basic rules for:
● Kernel versions – use of LTS
● Basic config
● System call ABI/API
● FS + FS features
● LTS 4.4 supported for 6 years instead of 2
● Kernel customization through:
● Kernel config overrides
● Loadable modules
● DT overlays
41
7.5. Links
● Main doc from Google:
● https://source.android.com/devices/architecture/kernel/
● LTS:
● https://www.kernel.org/category/releases.html
42
8. HIDL
● HAL's role
● Traditional HAL before 8.x
● HIDL
● Links
43
8.1. HAL's Role
● Per-device-type hardware abstraction
● Example:
● SurfaceFlinger uses hwcomposer HAL
● Location uses gps HAL
● Lights uses lights HAL
● Etc.
● Google specifies HAL signature
● Manufacturer/SoC vendor provides HAL implementation
● Reference implementations:
● Leads devices found in AOSP
● SoC vendor reference designs/boards in BSP
44
8.2. Traditional HAL Before 8.x
● Google specifies HALs as “C” header files
● HAL module author uses header in implementation
● Resulting binary shipped as part of release
● Modules loaded at boot time by system services
● Headers could (and did) change between versions
● Required reworking, rebuilding, reshipping new
version
● To update to a new version of Android:
● All modules had to be updated, be they trivial or difficult
45
8.3. HIDL
● “Hardware Interface Definition Language”
● New layer under system services
● Formalized and versioned HAL interface definitions
●
Similar to AIDL, yet different
●
Example HIDLs in 8.x/Oreo:
● graphics/composer 2.1
● gnss 1.0
● Etc.
●
Once published, a given HIDL definition is immutable:
● Even in 9.x/P, graphics/composer 2.1 and gnss 1.0 will be the same as in 8.x.
● Fresh port assumes using latest HAL sig available
● Most importantly:
● Modules created against a given signature should continue to work so long as that
signature is supported.
● Depends on Google, but incentives are aligned
● More on this in tomorrow's presentation
46
8.4. Links
● General doc:
● https://source.android.com/devices/architecture/hidl/
● C++
● https://source.android.com/devices/architecture/hidl-
cpp/
● Java
● https://source.android.com/devices/architecture/hidl-
java/
47
9. VNDK
● Before
● What VNDK does
● Links
48
9.1. Before
● “Anything goes” under the hood
● Sometimes taken to extremes
● Ex. major handset manufacturer w/ hot new device:
●
Expecting:
– Trade press scrutiny
– Benchmarks
● So ... tweak everything for performance and battery:
– Libraries
– Core components
– Anything and everything under the sun
● Result: Significant delta between canonical AOSP and real
code/binaries shipping in devices.
● Therefore: Difficult to upgrade
49
9.2. What VNDK Does
● Provides a pre-defined way to mitigate/manage
differences between Google-minted libs and vendor libs.
● Quite a few concepts introduced by VNDK to define
library categories and explain how they are to be used.
● Boring/Tedious explanation (very dry)
● Refer to official doc
● Will need to assign this to someone on your team
● Google is trying to play funambulist on this
50
9.3. Links
● Main doc:
● https://source.android.com/devices/architecture/vndk/
51
10. VINTF
● Basics
● Architecture
● Details
● Links
52
10.1. Basics
● Need to formalize version “handshake” between
device and OTA service on upgrade.
● Specifically, need to match:
● HIDL versions
● Kernel specifics
● SE policies
● Android Verified Boot (AVB) version
● Solution:
● Vendor Interface Object (VINTF)
53
10.2. Architecture
54
10.3. Details
● Device manifest:
● Is device's HW enablement supported by framework?
● Framework manifest:
● Does new framework provide what the device needs?
● Device compatibility matrix:
● What does device expect of new framework?
● Framework compatibility matrix:
● What does new framework expect of device?
● Google doc specifies:
● Manifest format
● Compatibility matrices
● Matching rules
● Need a good understanding as well
● Likely needs a person to be responsible for this as well
55
10.4. Links
● Main doc:
● https://source.android.com/devices/architecture/vintf/
56
11. VTS
● Similar to CTS
● Ensures that all the above is followed
● Test categories:
● HIDL HAL Tests
● Kernel Tests
● LTP
● Linux Kselftest
● VNDK (Vendor Native Development Kit) Tests
● Performance Tests
● Fuzz Tests
● Security Tests
● Even w/o certification, passing CTS will simplify OTA
57
● Links:
● Main doc:
– https://source.android.com/compatibility/vts/
● More details (user manual, etc.):
– https://android.googlesource.com/platform/test/vts/
+/master/README.md
58
12. Implications
●
Significant reduction in customization for GMS
●
Non-exhaustive no-go list:
● System service internals
● HAL definition reworking/extension
● Core library replacement by tweaking dependent components' APIs
● Tweaking existing SE policies
●
Any change that impacts OTA
● Any change that breaks VTS
●
Even permitted changes are complex, ex:
● Tweaking libraries vs. VNDK rules
● Using vendor-specific services instead of tweaking existing ones
59
● Big benefit in adhering to “vanilla” even if no GMS interest:
● Simplified OTA
● If no GMS, still as open as before to tweak everything:
● Price = reduced OTA capability, likely no path to ugprade, etc.
● Greater scrutiny required over SoC/partner work to ensure Treble
“conformance”.
● Incentive is there for SoC vendors since some of their customers
need GMS certification.
● Varying degrees of quality from board vendors and outsourcing
partners:
● Do your homework
60
13. Recommendations
● Several years before Treble benefits materialize
● Solid ground established by Google
● Likely some organic learning left to iron kinks out
● In the mean time:
● Make sure you have a firm understanding of how Treble changes your Android device
design, development, integration and support plans.
● Have your technical teams review the Treble documentation made available by
Google and possibly seek training so they can start familiarizing themselves with its
intricacies.
● If certification is on your agenda, start paying special attention to the VTS in your
planning. If you have CTS as part of your checklists, a good start is adding
equivalent entries for VTS.
● When selecting partners or suppliers, make sure their work and/or the software they
deliver falls in line with Treble's requirements, especially if certification is a target.
61
Thank you ...
karim.yaghmour@opersys.com
62
Acknowledgements:
● Several diagrams distributed by Google under
CC-BY-SA license or ASL 2.0.

More Related Content

PDF
Android's HIDL: Treble in the HAL
PPT
Learning AOSP - Android Booting Process
PDF
Explore Android Internals
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
PDF
Embedded Android : System Development - Part I
PDF
Embedded Android Workshop with Pie
PDF
Android Things : Building Embedded Devices
PPT
Learning AOSP - Android Linux Device Driver
Android's HIDL: Treble in the HAL
Learning AOSP - Android Booting Process
Explore Android Internals
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Embedded Android : System Development - Part I
Embedded Android Workshop with Pie
Android Things : Building Embedded Devices
Learning AOSP - Android Linux Device Driver

What's hot (20)

PDF
Accessing Hardware on Android
ODP
Q4.11: Porting Android to new Platforms
PDF
Embedded Android : System Development - Part II (Linux device drivers)
PDF
Embedded Android : System Development - Part II (HAL)
PPT
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
PDF
Booting Android: bootloaders, fastboot and boot images
PDF
Embedded Android : System Development - Part IV (Android System Services)
PPTX
Android Booting Sequence
PDF
Android device driver structure introduction
PPTX
Android internals By Rajesh Khetan
PDF
Android Boot Time Optimization
ODP
Embedded Android : System Development - Part III
PDF
PDF
Low Level View of Android System Architecture
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
PDF
Embedded Android : System Development - Part IV
PDF
Embedded Android : System Development - Part III (Audio / Video HAL)
PDF
Building aosp
PPTX
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
PPT
Android booting sequece and setup and debugging
Accessing Hardware on Android
Q4.11: Porting Android to new Platforms
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Booting Android: bootloaders, fastboot and boot images
Embedded Android : System Development - Part IV (Android System Services)
Android Booting Sequence
Android device driver structure introduction
Android internals By Rajesh Khetan
Android Boot Time Optimization
Embedded Android : System Development - Part III
Low Level View of Android System Architecture
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part III (Audio / Video HAL)
Building aosp
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android booting sequece and setup and debugging
Ad

Similar to Android Treble: Blessing or Trouble? (20)

PDF
Embedded Android Workshop with Oreo
PPTX
Android Seminar Presentation [March 2019]
PPTX
Android for-all
PPTX
EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
PPTX
Mobile Application Development Unit 1.pptx
PPTX
Android operating system
PPTX
Android Project By Susovan
PPTX
PPT on Android
PPTX
Android - An Operating System
PPTX
Mobile Application development
PPTX
Android OS
PPTX
Why android is the most popular mobile operating system in the world(2)
PPTX
Android
PPTX
Android operating system
PPTX
PPTX
Android operating system
PDF
Embedded Android Workshop with Nougat
PPTX
Android introduction, history, version list till 9.0 Pie
PPTX
Introduction to Andriod
PDF
IRJET- Recent Versions on Android and Survey on the Versions Lollipop, Marshm...
Embedded Android Workshop with Oreo
Android Seminar Presentation [March 2019]
Android for-all
EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
Mobile Application Development Unit 1.pptx
Android operating system
Android Project By Susovan
PPT on Android
Android - An Operating System
Mobile Application development
Android OS
Why android is the most popular mobile operating system in the world(2)
Android
Android operating system
Android operating system
Embedded Android Workshop with Nougat
Android introduction, history, version list till 9.0 Pie
Introduction to Andriod
IRJET- Recent Versions on Android and Survey on the Versions Lollipop, Marshm...
Ad

More from Opersys inc. (20)

PDF
Android Automotive
PDF
Android 10 Internals Update
PDF
Android Security Internals
PDF
Scheduling in Android
PDF
Android Things Internals
PDF
Android Platform Debugging and Development
PDF
Embedded Android Workshop with Nougat
PDF
Android Things: Android for IoT
PDF
Android Things Internals
PDF
Scheduling in Android
PDF
Brillo / Weave Internals
PDF
Android Platform Debugging and Development
PDF
Memory Management in Android
PDF
Embedded Android Workshop with Nougat
PDF
Brillo / Weave Internals
PDF
Project Ara
PDF
Android Platform Debugging and Development
PDF
Memory Management in Android
PDF
Brillo/Weave Internals
PDF
Embedded Android Workshop with Marshmallow
Android Automotive
Android 10 Internals Update
Android Security Internals
Scheduling in Android
Android Things Internals
Android Platform Debugging and Development
Embedded Android Workshop with Nougat
Android Things: Android for IoT
Android Things Internals
Scheduling in Android
Brillo / Weave Internals
Android Platform Debugging and Development
Memory Management in Android
Embedded Android Workshop with Nougat
Brillo / Weave Internals
Project Ara
Android Platform Debugging and Development
Memory Management in Android
Brillo/Weave Internals
Embedded Android Workshop with Marshmallow

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
Download FL Studio Crack Latest version 2025 ?
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Cost to Outsource Software Development in 2025
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
history of c programming in notes for students .pptx
PPTX
assetexplorer- product-overview - presentation
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
Complete Guide to Website Development in Malaysia for SMEs
medical staffing services at VALiNTRY
Download FL Studio Crack Latest version 2025 ?
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Cost to Outsource Software Development in 2025
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
wealthsignaloriginal-com-DS-text-... (1).pdf
Advanced SystemCare Ultimate Crack + Portable (2025)
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Salesforce Agentforce AI Implementation.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Monitoring Stack: Grafana, Loki & Promtail
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Computer Software and OS of computer science of grade 11.pptx
history of c programming in notes for students .pptx
assetexplorer- product-overview - presentation
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Complete Guide to Website Development in Malaysia for SMEs

Android Treble: Blessing or Trouble?

  • 1. 1 Android Treble: Blessing or Trouble? YouTubeTM Livestream March 27th 2018 Karim Yaghmour @karimyaghmour [email protected]
  • 2. 2 These slides are made available to you under a Creative Commons Share- Alike 3.0 license. The full terms of this license are here: https://creativecommons.org/licenses/by-sa/3.0/ Attribution requirements and misc., PLEASE READ: ● This slide must remain as-is in this specific location (slide #2), everything else you are free to change; including the logo :-) ● Use of figures in other documents must feature the below “Originals at” URL immediately under that figure and the below copyright notice where appropriate. ● You are free to fill in the “Delivered and/or customized by” space on the right as you see fit. ● You are FORBIDEN from using the default “About” slide as-is or any of its contents. ● You are FORBIDEN from using any content provided by 3rd parties without the EXPLICIT consent from those parties. (C) Copyright 2018, Opersys inc. These slides created by: Karim Yaghmour Originals at: www.opersys.com/community/docs Delivered and/or customized by
  • 3. 3 About ● Author of: ● Introduced Linux Trace Toolkit in 1999 ● Originated Adeos and relayfs (kernel/relay.c) ● Training, Custom Dev, Consulting, ...
  • 4. 4 Agenda 1. Introduction 2. Motivations 3. Enforcement 4. Traditional Android Release Flow 5. Treble's Intended Release Flow 6. Underneath the Framework 7. Linux Kernel 8. HIDL 9. VNDK 10.VINTF 11.VTS 12.Implications 13.Recommendations
  • 5. 5 1. Introduction ● Goals ● Release History ● Architecture ● Distribution scheme before 8.x / Treble ● What's added by Treble?
  • 6. 6 1.1. Goals ● Discuss Project Treble's motivations ● Describe differences with classic release flow ● Detail Project Treble's parts ● Outline implications and recommendations
  • 7. 7 1.2. Release History ● 2008 - Sept.: Android 1.0 is released ● 2009 - Feb.: Android 1.1 ● 2009 - Apr.: Android 1.5 / Cupcake ● 2009 - Sept.: Android 1.6 / Donut ● 2009 - Oct.: Android 2.0/2.1 / Eclair ● 2010 - May: Android 2.2 / Froyo ● 2010 - Dec.: Android 2.3 / Gingerbread ● 2011 - Jan : Android 3.0 / Honeycomb – Tablet-optimized ● 2011 – May: Android 3.1 – USB host support ● 2011 – Nov: Android 4.0 / Ice-Cream Sandwich – merge Gingerbread and Honeycomb ● 2012 – Jun: Android 4.1 / Jelly Bean – Platform Optimization ● 2012 – Nov: Android 4.2 / Jelly Bean - Multi-user support ● 2013 -- July: Android 4.3 / Jelly Bean -- BLE / GLES 3.0 ● 2013 -- Oct: Android 4.4 / KitKat -- Low RAM optimizations ● 2014 -- Nov: Android 5.0 / Lollipop - ART and other pixie dust ● 2015 -- Mar: Android 5.1 / Lollipop - Multi-SIM card ● 2015 -- Oct: Android 6.0 / Marshmallow -- New permission model ● 2016 – Aug: Android 7.0 / Nougat – Multi-window ● 2016 – Oct: Android 7.1 / Nougat – A/B updates ● 2017 – Aug: Android 8.0 / Oreo – Treble / PIP ● 2017 – Dec: Android 8.1 / Oreo – Low-end device optimizations
  • 9. 9 1.4. Distribution scheme before 8.x ● Google releases new version of Android ● Ecosystem customizes it to new devices – sometimes quite extensively ● Google enforces Compatibility Test Suite (CTS) – guaranteeing developer API conformance ● Devices get certified and ship with GMS ● .... ● Devices rarely got upgrades
  • 10. 10 2. Motivations ● Updates: Android vs. iOS ● Android version propagation history ● “Official” Google Treble pitch ● Nature of Android
  • 11. 11 2.1. Updates: Android vs. iOS Data from Apple as of January 18, 2018 https://developer.apple.com/support/app-store/ iOS Android Data from Google as of February 5, 2018 https://developer.android.com/about/dashboards/ 2.3.x Gingerbread 4.0.x Ice Cream Sandwich 4.1.x Jelly Bean 4.2.x Jelly Bean 4.3.x Jelly Bean 4.4.x KitKat 5.0.x Lollipop 5.1.x Lollipop 6.x Marshmallow 7.0.x Nougat 7.1.x Nougat 8.0.x. Oreo 8.1.x. Oreo Earlier IOS 10 IOS 11
  • 12. 12 2.2. Version propagation history ● Implications: ● Android comes out with cool new features ● Perception is iOS gets them first ● Disclaimer: This is my reading 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% D ec 2009 Feb 2010 Apr 2010 Jun 2010 Aug 2010 O ct 2010 D ec 2010 Feb 2011 Apr 2011 Jun 2011 Aug 2011 O ct 2011 D ec 2011 Feb 2012 Apr 2012 Jun 2012 Aug 2012 O ct 2012 D ec 2012 Feb 2013 Apr 2013 Jun 2013 Aug 2013 D ec 2013 Feb 2014 Apr 2014 O ct 2013 Jun 2014 Aug 2014 D ec 2014 Feb 2015 O ct 2014* *nodata Apr 2015 Jun 2015 Aug 2015 *nodata Jul 2015* O ct 2015 D ec 2015 Feb 2016 Apr 2016 Jun 2016 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% Aug 2016 O ct 2016* D ec 2016 *nodata Feb 2017 Apr 2017 Jun 2017 Android version 1.1 1.5 1.6 2.0 2.0.1 2.1 2.2 2.3-2.3.2 2.3.3-2.3.7 3.0 3.1 3.2 4.0-4.0.2 4.0.3-4.0.4 4.1 4.2 4.3 4.4 Cupcake Donut Eclair Froyo Gingerbread Honeycomb Ice Cream Sandwich Jelly Bean KitKat Gingerbread Eclair Eclair Honeycomb Honeycomb Jelly Bean Jelly Bean 5.0 Lollipop Ice Cream Sandwich 5.1 Lollipop 6.0 Marshmallow 7.0-7.1 Nougat
  • 13. 13 2.3. “Official” Google Treble pitch ● From source.android.com: “The Android 8.0 release includes Project Treble, a major re- architect of the Android OS framework designed to make it easier, faster, and less costly for manufacturers to update devices to a new version of Android.” ● In short: ● Recognition that updates are a problem ● Identification of update issues: – Difficult – Long – Costly
  • 14. 14 2.4. Nature of Android ● Anyone is free to download Android ● Google enforces certification for GMS ● Google has no ability to force upgrades ● Google can only incentivize
  • 15. 15 3. Enforcement ● “To ensure forward compatibility of vendor implementations, the new vendor interface is validated by the Vendor Test Suite (VTS), which is analogous to the Compatibility Test Suite (CTS).” ● In sum: ● Path to upgrade has been charted ● But ... Comply or we won't certify ● Not much choice – Android is the “only game in town” aside from Apple's iOS. ● Worthy end-goal: ● 4 to 5 years of upgrades on a single device
  • 16. 16 4. Traditional Android Release Flow ● Release flow ● Simplified internals view ● Example phone circa early 2014 ● Upgrade after 5.x/Lollipop release ● Upgrade after 6.x/Marshmallow release
  • 19. 19 4.3. Example Phone Circa Early 2014 ● Just for the sake of example ... ● Say you bought a phone in early 2014: ● Samsung device ● Qualcomm chipset ● Verizon network ● Runs Android 4.4/KitKat at time of purchase Note: brands/companies used for illustration purposes only, no specific device is implied.
  • 20. 20 4.4. Upgrade after 5.x/Lollipop release 5.x Release QualcommQualcomm Are they still selling this chip? 5.x BSP Samsung Are they still selling this phone or is it important? 5.x Upgrade Verizon Are customers still buying this?5.x Gets to Users November 2014
  • 21. 21 4.5. Upgrade to 6.x/Marshmallow? October 2015 6.x/Marshmallow Qualcomm Really? ??? Samsung Really, Really?? ??? Verizon Really, Really, Really??!?!?!
  • 22. 22 5. Treble's Intended Release Flow ● Initial release flow ● New internals paradigm ● Overall reworked internals ● Targeted upgrade flow ● Theory of future release cycles ● Requirement
  • 23. 23 5.1. Initial Release Flow 8.x Release QualcommQualcomm 8.x BSP Samsung 8.x-based SKU Verizon 8.x-based Device
  • 27. 27 5.5. Theory of Future Release Cycles 9.x Release 10.x Release ...
  • 28. 28 5.6. Requirement ● Google must continue to support old vendor interfaces. ● For an initial 8.x device, future framework release must support 8.x hardware enablement: ● 9.x / P ● 10.x / Q ● 11.x / R ● ... ● Aim seems to be 4-5 releases
  • 29. 29 6. Underneath the Framework ● Architecture ● Integration points ● Certification before Treble ● Certification after Treble ● What's added by Treble?
  • 32. 32 6.3. Certification Before Treble Compatibility Test Suite
  • 33. 33 6.4. Certification After Treble Compatibility Test Suite SE Vendor Test Suite Vendor Test Suite
  • 34. 34 6.5. What's added by Treble? ● Linux kernel requirements ● HIDL – Hardware Interface Definition Language ● VNDK – Vendor NDK ● VINTF – Vendor Interface ● VTS – Vendor Test Suite
  • 36. 36 7. Linux Kernel ● Basics ● Release flow ● Real-life ● Treble and the kernel ● Links
  • 37. 37 7.1. Basics ● Necessary for Android ● Existed prior to Android ● Decision to use based on Linux succcess ● Google downstream from kernel developers
  • 39. 39 7.3. Real-Life ● End-of-Life kernels very common on Android ● Security issues ● While invisible, major implications for user ● Inconsistent kernel versions between vendors ● Inconsistent updates between vendors
  • 40. 40 7.4. Treble and the Kernel ● Separate deliverables based on each player's role in the update ecosystem. ● VTS-enforced aspects ● Basic rules for: ● Kernel versions – use of LTS ● Basic config ● System call ABI/API ● FS + FS features ● LTS 4.4 supported for 6 years instead of 2 ● Kernel customization through: ● Kernel config overrides ● Loadable modules ● DT overlays
  • 41. 41 7.5. Links ● Main doc from Google: ● https://source.android.com/devices/architecture/kernel/ ● LTS: ● https://www.kernel.org/category/releases.html
  • 42. 42 8. HIDL ● HAL's role ● Traditional HAL before 8.x ● HIDL ● Links
  • 43. 43 8.1. HAL's Role ● Per-device-type hardware abstraction ● Example: ● SurfaceFlinger uses hwcomposer HAL ● Location uses gps HAL ● Lights uses lights HAL ● Etc. ● Google specifies HAL signature ● Manufacturer/SoC vendor provides HAL implementation ● Reference implementations: ● Leads devices found in AOSP ● SoC vendor reference designs/boards in BSP
  • 44. 44 8.2. Traditional HAL Before 8.x ● Google specifies HALs as “C” header files ● HAL module author uses header in implementation ● Resulting binary shipped as part of release ● Modules loaded at boot time by system services ● Headers could (and did) change between versions ● Required reworking, rebuilding, reshipping new version ● To update to a new version of Android: ● All modules had to be updated, be they trivial or difficult
  • 45. 45 8.3. HIDL ● “Hardware Interface Definition Language” ● New layer under system services ● Formalized and versioned HAL interface definitions ● Similar to AIDL, yet different ● Example HIDLs in 8.x/Oreo: ● graphics/composer 2.1 ● gnss 1.0 ● Etc. ● Once published, a given HIDL definition is immutable: ● Even in 9.x/P, graphics/composer 2.1 and gnss 1.0 will be the same as in 8.x. ● Fresh port assumes using latest HAL sig available ● Most importantly: ● Modules created against a given signature should continue to work so long as that signature is supported. ● Depends on Google, but incentives are aligned ● More on this in tomorrow's presentation
  • 46. 46 8.4. Links ● General doc: ● https://source.android.com/devices/architecture/hidl/ ● C++ ● https://source.android.com/devices/architecture/hidl- cpp/ ● Java ● https://source.android.com/devices/architecture/hidl- java/
  • 47. 47 9. VNDK ● Before ● What VNDK does ● Links
  • 48. 48 9.1. Before ● “Anything goes” under the hood ● Sometimes taken to extremes ● Ex. major handset manufacturer w/ hot new device: ● Expecting: – Trade press scrutiny – Benchmarks ● So ... tweak everything for performance and battery: – Libraries – Core components – Anything and everything under the sun ● Result: Significant delta between canonical AOSP and real code/binaries shipping in devices. ● Therefore: Difficult to upgrade
  • 49. 49 9.2. What VNDK Does ● Provides a pre-defined way to mitigate/manage differences between Google-minted libs and vendor libs. ● Quite a few concepts introduced by VNDK to define library categories and explain how they are to be used. ● Boring/Tedious explanation (very dry) ● Refer to official doc ● Will need to assign this to someone on your team ● Google is trying to play funambulist on this
  • 50. 50 9.3. Links ● Main doc: ● https://source.android.com/devices/architecture/vndk/
  • 51. 51 10. VINTF ● Basics ● Architecture ● Details ● Links
  • 52. 52 10.1. Basics ● Need to formalize version “handshake” between device and OTA service on upgrade. ● Specifically, need to match: ● HIDL versions ● Kernel specifics ● SE policies ● Android Verified Boot (AVB) version ● Solution: ● Vendor Interface Object (VINTF)
  • 54. 54 10.3. Details ● Device manifest: ● Is device's HW enablement supported by framework? ● Framework manifest: ● Does new framework provide what the device needs? ● Device compatibility matrix: ● What does device expect of new framework? ● Framework compatibility matrix: ● What does new framework expect of device? ● Google doc specifies: ● Manifest format ● Compatibility matrices ● Matching rules ● Need a good understanding as well ● Likely needs a person to be responsible for this as well
  • 55. 55 10.4. Links ● Main doc: ● https://source.android.com/devices/architecture/vintf/
  • 56. 56 11. VTS ● Similar to CTS ● Ensures that all the above is followed ● Test categories: ● HIDL HAL Tests ● Kernel Tests ● LTP ● Linux Kselftest ● VNDK (Vendor Native Development Kit) Tests ● Performance Tests ● Fuzz Tests ● Security Tests ● Even w/o certification, passing CTS will simplify OTA
  • 57. 57 ● Links: ● Main doc: – https://source.android.com/compatibility/vts/ ● More details (user manual, etc.): – https://android.googlesource.com/platform/test/vts/ +/master/README.md
  • 58. 58 12. Implications ● Significant reduction in customization for GMS ● Non-exhaustive no-go list: ● System service internals ● HAL definition reworking/extension ● Core library replacement by tweaking dependent components' APIs ● Tweaking existing SE policies ● Any change that impacts OTA ● Any change that breaks VTS ● Even permitted changes are complex, ex: ● Tweaking libraries vs. VNDK rules ● Using vendor-specific services instead of tweaking existing ones
  • 59. 59 ● Big benefit in adhering to “vanilla” even if no GMS interest: ● Simplified OTA ● If no GMS, still as open as before to tweak everything: ● Price = reduced OTA capability, likely no path to ugprade, etc. ● Greater scrutiny required over SoC/partner work to ensure Treble “conformance”. ● Incentive is there for SoC vendors since some of their customers need GMS certification. ● Varying degrees of quality from board vendors and outsourcing partners: ● Do your homework
  • 60. 60 13. Recommendations ● Several years before Treble benefits materialize ● Solid ground established by Google ● Likely some organic learning left to iron kinks out ● In the mean time: ● Make sure you have a firm understanding of how Treble changes your Android device design, development, integration and support plans. ● Have your technical teams review the Treble documentation made available by Google and possibly seek training so they can start familiarizing themselves with its intricacies. ● If certification is on your agenda, start paying special attention to the VTS in your planning. If you have CTS as part of your checklists, a good start is adding equivalent entries for VTS. ● When selecting partners or suppliers, make sure their work and/or the software they deliver falls in line with Treble's requirements, especially if certification is a target.
  • 62. 62 Acknowledgements: ● Several diagrams distributed by Google under CC-BY-SA license or ASL 2.0.