SlideShare a Scribd company logo
1
Android Things:
Internals and cute embedded nonsense hacks
Embedded Linux Conference 2017
Karim Yaghmour
+karimyaghmour, @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 2017, 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. A bit of history
2. Legacy Architectures
3. The Brillo/Weave Intermezzo
4. Now back to your regular programming
5. Hardware
6. โ€œThingsโ€ Architecture
7. Images
8. User-Space
9. Services / Daemons
10.APIs
11.Apps
12.What if I told you ... ?
5
1. A bit of history
โ— Embedded Linux
โ— Android
โ— Headless Android
โ— Brillo
โ— Android Things
6
1.1. Embedded Linux
โ—
A set of ad-hoc methods to package the Linux kernel with a
(minimal) filesystem.
โ—
FS content โ€œto be determinedโ€ case-by-case
โ— APIs are specific to each device/build
โ— โ€œCore softwareโ€:
โ—
BusyBox
โ—
U-Boot
โ— GNU Toolchain
โ—
Your flavor of:
โ— glibc or uClibc or eglibc
โ—
yocto or buildroot or eldk or ltib or ptxdist or ...
โ— No serious UX framework
7
1.2. Android
โ—
... apart from its ubiquitous UX ...
โ— Fully-integrated IDE: Android Studio
โ— SDK/NDK
โ— ADB
โ— Fastboot
โ— Published, well-known, and very rich APIs
โ— A large and growing developer community
โ— And still we can use โ€œembedded Linuxโ€ components:
โ— GNU toolchain, BusyBox, u- boot, glibc, ...
An actual standardized dev. env. across all product lines
8
9
1.3. Headless Android
+ =
Android Builders Summit, February 2012
10
A few months later ... ro.config.headless
11
1.4. Brillo / Weave
โ— Initial Google platform for IoT*
โ— Based on Android
โ— Announced at Google I/O 2015
โ— Never officially released
โ— Remained in โ€œdeveloper previewโ€ mode
โ— Needed to sign up for developer preview on https://developers.google.com/brillo/
โ— Sources available from android.googlesource.com
โ— โ€œAppsโ€ talk straight to HALs
โ— Note:
Material here based on sources, NOT on developer preview or any information thereof :P
* New, hip way of talking about โ€œEmbedded Systemsโ€, something that's been around for ~50+ years.
12
1.5. Android Things
โ— โ€œRebootโ€ of Google's Android IoT strategy
โ— Announced on Dec 13th, 2016
โ— Reinstates full Android environment
โ— Developers use existing Android dev tools
โ— C/C++ available through NDK
โ— Extended APIs for IoT
โ— Currently at Developer Preview 2
โ— Sources not yet available
13
2. Legacy Architectures
โ— Embedded Linux
โ— Android
โ— Binder
โ— System services
โ— HAL
14
15
16
17
18
/frameworks/base/services/java/...
/frameworks/base/services/jni/
/hardware/libhardware/
/device/[MANUF.]/[DEVICE]
/sdk/emulator/
Kernel or module
/frameworks/base/core/...
AOSP-provided
ASL
Manuf.-provided
Manuf. license
Manuf.-provided
GPL-license
19
3. The Brillo/Weave Intermezzo
โ— Architecture
โ— Sources
โ— Images
โ— User-Space
โ— Services/Daemons
โ— Weave
20
3.1. Architecture
โ— DBus
โ— Brillo
โ— Weave
21
22
Your Code
23
24
3.2. Sources
โ— Getting the sources
โ— Brillo top level
โ— Removed from Android top level
โ— Gone from external/
โ— New to external
25
3.2.1. Getting the sources
โ— Same project repo as Android:
android.googlesource.com
โ— Different manifest file
โ— Using โ€œrepoโ€:
$ย repoย initย ยญuย https://android.googlesource.com/brillo/manifest
$ย repoย sync
26
3.2.2. Brillo top level
bionic C library replacement
bootable Reference bootloader
build Build system
device Device-specific files and components
external Copy of external projects used by AOSP
frameworks Native system services and libraries
hardware Hardware support libs
libnativehelper JNI helpers
prebuilts Prebuilt binaries
product โ€œProductsโ€ running on Brillo
system Embedded Linux core
tools Brillo Development Kit
27
3.2.3. Removed from Android top level
art
cts
dalvik
dvelopers
development
docs
frameworks/base and more
libcore
ndk
packages
pdk
sdk
system/vold and more
tools/external
28
3.2.4. Removed from external/
29
3.2.5. Added to external/
bvb Brillo Verified Boot
chromite Tools to build Chrome OS
gentoo
libdivsufsort lightweight suffix array construction algorithm library
lzop LZO compression tool
30
3.3. Images
โ— AOSP x86 32-bit:
โ— 5.1M out/target/product/generic_x86/cache.img
โ— 1.3M out/target/product/generic_x86/ramdisk.img
โ— 1.3G out/target/product/generic_x86/system.img
โ— 12M out/target/product/generic_x86/userdata.img
โ— 551M out/target/product/generic_x86/userdata-qemu.img
โ— Brillo x86 64-bit:
โ— 6.2M out/target/product/brilloemulator_x86_64/boot.img
โ— 36K out/target/product/brilloemulator_x86_64/partition-table.img
โ— 158M out/target/product/brilloemulator_x86_64/system.img
โ— 201M out/target/product/brilloemulator_x86_64/userdata.img
โ— 551M out/target/product/brilloemulator_x86_64/userdata-qemu.img
31
3.4. User Space
32
3.5. Services / Daemons
โ—
dbus-daemon
โ—
servicemanager
โ—
avahi-daemon
โ—
keystore
โ—
nativeperms
โ—
peripheralman
โ—
sensorservice
โ—
wpa_supplicant
โ—
brilloaudioservice
โ—
metrics_collector
โ—
metriscsd
โ—
perfprofd
โ—
tlsdated
โ—
tpm_managerd
โ—
trunksd
โ—
update_engine
โ—
weaved
โ—
webservd
โ—
shill
โ—
firewalld
โ—
dhcpd
33
3.6. Weave
34
4. Now back to your regular
programming
โ— Android Things does away with most of Brillo
โ— Revert architecture to original
โ— Weave seems gone from the FS, but site still on
โ— Go back to system services with HALs
โ— Extend Android API for IoT
โ— Use of Android Studio and co.
โ— Optional Display
โ— Use of traditional static permissions
35
5. Hardware
From developer.android.com/things
36
6. โ€œThingsโ€ Architecture
Peripheral Manager
IoTLauncher
PIO HAL
PIO APIs
Your App
User-Space
Drivers
Peripheral
Driver
Library
37
7. Images
โ— Brillo x86 64-bit emulator:
โ— 6.2M boot.img
โ— 36K partition-table.img
โ— 158M system.img
โ—
201M userdata.img
โ— Things x86 Edison:
โ— 11M boot.img
โ— 176M gapps.img
โ—
4.6M oem.img
โ—
420M system.img
โ—
376K u-boot-edison.img
โ— 35M userdata.img
โ— Things Rpi3:
โ—
350M root + system
โ— 150M gapps
โ— AOSP x86 32-bit:
โ—
1.3G system.img
38
8. User-Space
โ— Same FS layout as Android
โ— Mostly same processes
โ— In short, unlike Brillo, it's still very much Android
39
9. Services / Daemons
โ— /system/bin/peripheralman
โ— C++ System Service
โ— Responds to dumpsys:
dumpsysย com.google.android.things.pio.IPeripheralManager
โ— Also was in Brillo
โ— Sources (6 months old):
โ— https://android.googlesource.com/platform/system/peripheralmanager/
โ— New HAL:
โ— peripheral_io.h
โ— As with other HALs:
โ— /system/lib/hw/peripheral_io.<board_name>.so
40
10. APIs
41
42
11. Apps
โ— New Launcher: IoTLauncher.apk
โ— Still responds to same intent as LauncherN.apk
โ€“ Try: aapt l -a IoTLauncher.apk
โ— Likely party firing android.intent.category.IOT_LAUNCHER
โ€“ Try: strings IoTLauncher.odex | grep IOT
โ— Gone:
โ— Home launcher (replaced by IoTLauncher)
โ— Status bar
โ— Settings (at least the content provider ... โ€œpsโ€ says the app is still running ;) )
โ— Interesting:
โ— Google services (some of them at least)
โ— Try:
โ— dumpsys gfxinfo
43
12. What if I told you ... ?
โ— What's this IoT thing ... ?
โ— Consumer
โ— Industrial/Commercial
โ— 256MB+ RAM for an embedded device, really?
...
โ— A long time ago in a galaxy far far away ...
44
RIP Project Ara
45
12.1. Hardware Architecture
46
47
12.2. Software Architecture
48
โ— Vibrator
โ— Battery
โ— Audio
โ— Baseband modem
โ— Bluetooth
โ— Camera
โ— Consumer IR
12.3. Greybus Device Classes
โ— Display
โ— GPS
โ— Keymaster
โ— Lights
โ— NFC
โ— Sensors
โ— Wifi
49
12.4. Bridged PHY Connection
Protocols
โ— USB
โ— GPIO
โ— SPI
โ— UART
โ— PWM
โ— I2C
โ— SDIO
50
51
52
12.5. Greybus for IOT
Alexandre Baillon
Baylibre
53From Alexandre's ELCE 2016 slides
54
12.6. Can I haz an Android for
real-world IOT ?
55
Thank you ...
karim.yaghmour@opersys.com

More Related Content

What's hot (20)

PDF
Android's HIDL: Treble in the HAL
Opersys inc.
ย 
PDF
Android Treble: Blessing or Trouble?
Opersys inc.
ย 
PDF
Brillo / Weave Internals
Opersys inc.
ย 
PDF
Extending Android's Platform Toolsuite
Opersys inc.
ย 
PDF
Developing Android Platform Tools
Opersys inc.
ย 
PDF
Android Things Internals
Opersys inc.
ย 
PDF
Project Ara
Opersys inc.
ย 
PDF
Embedded Android Workshop with Marshmallow
Opersys inc.
ย 
PDF
Embedded Android Workshop with Marshmallow
Opersys inc.
ย 
PDF
Embedded Android Workshop with Pie
Opersys inc.
ย 
PDF
Embedded Android Workshop
Opersys inc.
ย 
PDF
Embedded Android Workshop with Oreo
Opersys inc.
ย 
PDF
Memory Management in Android
Opersys inc.
ย 
PDF
Android Platform Debugging and Development
Opersys inc.
ย 
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
ย 
PDF
Android Security Internals
Opersys inc.
ย 
PDF
Is Android the New Embedded Linux? at AnDevCon VI
Opersys inc.
ย 
PDF
Embedded Android Workshop with Marshmallow
Karim Yaghmour
ย 
PDF
Android Internals
Opersys inc.
ย 
PDF
Android Platform Debugging and Development
Opersys inc.
ย 
Android's HIDL: Treble in the HAL
Opersys inc.
ย 
Android Treble: Blessing or Trouble?
Opersys inc.
ย 
Brillo / Weave Internals
Opersys inc.
ย 
Extending Android's Platform Toolsuite
Opersys inc.
ย 
Developing Android Platform Tools
Opersys inc.
ย 
Android Things Internals
Opersys inc.
ย 
Project Ara
Opersys inc.
ย 
Embedded Android Workshop with Marshmallow
Opersys inc.
ย 
Embedded Android Workshop with Marshmallow
Opersys inc.
ย 
Embedded Android Workshop with Pie
Opersys inc.
ย 
Embedded Android Workshop
Opersys inc.
ย 
Embedded Android Workshop with Oreo
Opersys inc.
ย 
Memory Management in Android
Opersys inc.
ย 
Android Platform Debugging and Development
Opersys inc.
ย 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
ย 
Android Security Internals
Opersys inc.
ย 
Is Android the New Embedded Linux? at AnDevCon VI
Opersys inc.
ย 
Embedded Android Workshop with Marshmallow
Karim Yaghmour
ย 
Android Internals
Opersys inc.
ย 
Android Platform Debugging and Development
Opersys inc.
ย 

Similar to Android Things Internals (20)

PDF
Android Things : Building Embedded Devices
Emertxe Information Technologies Pvt Ltd
ย 
PDF
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Opersys inc.
ย 
PDF
Leveraging Android's Linux Heritage at AnDevCon IV
Opersys inc.
ย 
PDF
Is Android the New Embedded Linux? at AnDevCon V
Opersys inc.
ย 
PDF
Is Android the New King of Embedded OSes at Embedded World 2014
Opersys inc.
ย 
PDF
Is Android the New Embedded Linux? at AnDevCon IV
Opersys inc.
ย 
PDF
Headless Android
Opersys inc.
ย 
PDF
Embedded Android Workshop with Lollipop
Opersys inc.
ย 
PDF
Embedded Android: Android beyond the smartphone
Chris Simmonds
ย 
PDF
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Opersys inc.
ย 
PDF
Embedded Android Workshop with Marshmallow
Opersys inc.
ย 
PDF
Embedded Android Workshop
Opersys inc.
ย 
PDF
Embedded Android Workshop
Opersys inc.
ย 
PDF
Embedded Android Workshop at AnDevCon VI
Opersys inc.
ย 
PDF
Embedded Android Workshop at Embedded World 2014
Opersys inc.
ย 
PDF
Embedded Android Workshop with Lollipop
Opersys inc.
ย 
PDF
Embedded Android Workshop at AnDevCon V
Opersys inc.
ย 
PDF
Working with the AOSP - Linaro Connect Asia 2013
Opersys inc.
ย 
PDF
Embedded Android Workshop at AnDevCon IV
Opersys inc.
ย 
PDF
Embedded Android Workshop at ABS 2014
Opersys inc.
ย 
Android Things : Building Embedded Devices
Emertxe Information Technologies Pvt Ltd
ย 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Opersys inc.
ย 
Leveraging Android's Linux Heritage at AnDevCon IV
Opersys inc.
ย 
Is Android the New Embedded Linux? at AnDevCon V
Opersys inc.
ย 
Is Android the New King of Embedded OSes at Embedded World 2014
Opersys inc.
ย 
Is Android the New Embedded Linux? at AnDevCon IV
Opersys inc.
ย 
Headless Android
Opersys inc.
ย 
Embedded Android Workshop with Lollipop
Opersys inc.
ย 
Embedded Android: Android beyond the smartphone
Chris Simmonds
ย 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Opersys inc.
ย 
Embedded Android Workshop with Marshmallow
Opersys inc.
ย 
Embedded Android Workshop
Opersys inc.
ย 
Embedded Android Workshop
Opersys inc.
ย 
Embedded Android Workshop at AnDevCon VI
Opersys inc.
ย 
Embedded Android Workshop at Embedded World 2014
Opersys inc.
ย 
Embedded Android Workshop with Lollipop
Opersys inc.
ย 
Embedded Android Workshop at AnDevCon V
Opersys inc.
ย 
Working with the AOSP - Linaro Connect Asia 2013
Opersys inc.
ย 
Embedded Android Workshop at AnDevCon IV
Opersys inc.
ย 
Embedded Android Workshop at ABS 2014
Opersys inc.
ย 
Ad

More from Opersys inc. (10)

PDF
Android Automotive
Opersys inc.
ย 
PDF
Android 10 Internals Update
Opersys inc.
ย 
PDF
Scheduling in Android
Opersys inc.
ย 
PDF
Scheduling in Android
Opersys inc.
ย 
PDF
Memory Management in Android
Opersys inc.
ย 
PDF
Memory Management in Android
Opersys inc.
ย 
PDF
Android Platform Debugging and Development
Opersys inc.
ย 
PDF
Memory Management in Android
Opersys inc.
ย 
PDF
Android Platform Debugging and Development
Opersys inc.
ย 
PDF
Project Ara
Opersys inc.
ย 
Android Automotive
Opersys inc.
ย 
Android 10 Internals Update
Opersys inc.
ย 
Scheduling in Android
Opersys inc.
ย 
Scheduling in Android
Opersys inc.
ย 
Memory Management in Android
Opersys inc.
ย 
Memory Management in Android
Opersys inc.
ย 
Android Platform Debugging and Development
Opersys inc.
ย 
Memory Management in Android
Opersys inc.
ย 
Android Platform Debugging and Development
Opersys inc.
ย 
Project Ara
Opersys inc.
ย 
Ad

Recently uploaded (20)

PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
ย 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
ย 
PDF
Balancing Resource Capacity and Workloads with OnePlan โ€“ Avoid Overloading Te...
OnePlan Solutions
ย 
PPTX
ChessBase 18.02 Crack + Serial Key Free Download
cracked shares
ย 
PDF
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
ย 
PPTX
SAP Public Cloud PPT , SAP PPT, Public Cloud PPT
sonawanekundan2024
ย 
PDF
Odoo Customization Services by CandidRoot Solutions
CandidRoot Solutions Private Limited
ย 
PPTX
Chess King 25.0.0.2500 With Crack Full Free Download
cracked shares
ย 
PPTX
Farrell__10e_ch04_PowerPoint.pptx Programming Logic and Design slides
bashnahara11
ย 
PPTX
Operations Profile SPDX_Update_20250711_Example_05_03.pptx
Shane Coughlan
ย 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
ย 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
ย 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
ย 
PDF
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
ย 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
ย 
PDF
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
ย 
PDF
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
ย 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
ย 
PPTX
Online Contractor Induction and Safety Induction Training Software
SHEQ Network Limited
ย 
PPTX
Processing with Claim Management Automation Solutions
Insurance Tech Services
ย 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
ย 
Presentation about Database and Database Administrator
abhishekchauhan86963
ย 
Balancing Resource Capacity and Workloads with OnePlan โ€“ Avoid Overloading Te...
OnePlan Solutions
ย 
ChessBase 18.02 Crack + Serial Key Free Download
cracked shares
ย 
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
ย 
SAP Public Cloud PPT , SAP PPT, Public Cloud PPT
sonawanekundan2024
ย 
Odoo Customization Services by CandidRoot Solutions
CandidRoot Solutions Private Limited
ย 
Chess King 25.0.0.2500 With Crack Full Free Download
cracked shares
ย 
Farrell__10e_ch04_PowerPoint.pptx Programming Logic and Design slides
bashnahara11
ย 
Operations Profile SPDX_Update_20250711_Example_05_03.pptx
Shane Coughlan
ย 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
ย 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
ย 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
ย 
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
ย 
Brief History of Python by Learning Python in three hours
adanechb21
ย 
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
ย 
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
ย 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
ย 
Online Contractor Induction and Safety Induction Training Software
SHEQ Network Limited
ย 
Processing with Claim Management Automation Solutions
Insurance Tech Services
ย 

Android Things Internals

  • 1. 1 Android Things: Internals and cute embedded nonsense hacks Embedded Linux Conference 2017 Karim Yaghmour +karimyaghmour, @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 2017, 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. A bit of history 2. Legacy Architectures 3. The Brillo/Weave Intermezzo 4. Now back to your regular programming 5. Hardware 6. โ€œThingsโ€ Architecture 7. Images 8. User-Space 9. Services / Daemons 10.APIs 11.Apps 12.What if I told you ... ?
  • 5. 5 1. A bit of history โ— Embedded Linux โ— Android โ— Headless Android โ— Brillo โ— Android Things
  • 6. 6 1.1. Embedded Linux โ— A set of ad-hoc methods to package the Linux kernel with a (minimal) filesystem. โ— FS content โ€œto be determinedโ€ case-by-case โ— APIs are specific to each device/build โ— โ€œCore softwareโ€: โ— BusyBox โ— U-Boot โ— GNU Toolchain โ— Your flavor of: โ— glibc or uClibc or eglibc โ— yocto or buildroot or eldk or ltib or ptxdist or ... โ— No serious UX framework
  • 7. 7 1.2. Android โ— ... apart from its ubiquitous UX ... โ— Fully-integrated IDE: Android Studio โ— SDK/NDK โ— ADB โ— Fastboot โ— Published, well-known, and very rich APIs โ— A large and growing developer community โ— And still we can use โ€œembedded Linuxโ€ components: โ— GNU toolchain, BusyBox, u- boot, glibc, ... An actual standardized dev. env. across all product lines
  • 8. 8
  • 9. 9 1.3. Headless Android + = Android Builders Summit, February 2012
  • 10. 10 A few months later ... ro.config.headless
  • 11. 11 1.4. Brillo / Weave โ— Initial Google platform for IoT* โ— Based on Android โ— Announced at Google I/O 2015 โ— Never officially released โ— Remained in โ€œdeveloper previewโ€ mode โ— Needed to sign up for developer preview on https://developers.google.com/brillo/ โ— Sources available from android.googlesource.com โ— โ€œAppsโ€ talk straight to HALs โ— Note: Material here based on sources, NOT on developer preview or any information thereof :P * New, hip way of talking about โ€œEmbedded Systemsโ€, something that's been around for ~50+ years.
  • 12. 12 1.5. Android Things โ— โ€œRebootโ€ of Google's Android IoT strategy โ— Announced on Dec 13th, 2016 โ— Reinstates full Android environment โ— Developers use existing Android dev tools โ— C/C++ available through NDK โ— Extended APIs for IoT โ— Currently at Developer Preview 2 โ— Sources not yet available
  • 13. 13 2. Legacy Architectures โ— Embedded Linux โ— Android โ— Binder โ— System services โ— HAL
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 19. 19 3. The Brillo/Weave Intermezzo โ— Architecture โ— Sources โ— Images โ— User-Space โ— Services/Daemons โ— Weave
  • 21. 21
  • 23. 23
  • 24. 24 3.2. Sources โ— Getting the sources โ— Brillo top level โ— Removed from Android top level โ— Gone from external/ โ— New to external
  • 25. 25 3.2.1. Getting the sources โ— Same project repo as Android: android.googlesource.com โ— Different manifest file โ— Using โ€œrepoโ€: $ย repoย initย ยญuย https://android.googlesource.com/brillo/manifest $ย repoย sync
  • 26. 26 3.2.2. Brillo top level bionic C library replacement bootable Reference bootloader build Build system device Device-specific files and components external Copy of external projects used by AOSP frameworks Native system services and libraries hardware Hardware support libs libnativehelper JNI helpers prebuilts Prebuilt binaries product โ€œProductsโ€ running on Brillo system Embedded Linux core tools Brillo Development Kit
  • 27. 27 3.2.3. Removed from Android top level art cts dalvik dvelopers development docs frameworks/base and more libcore ndk packages pdk sdk system/vold and more tools/external
  • 29. 29 3.2.5. Added to external/ bvb Brillo Verified Boot chromite Tools to build Chrome OS gentoo libdivsufsort lightweight suffix array construction algorithm library lzop LZO compression tool
  • 30. 30 3.3. Images โ— AOSP x86 32-bit: โ— 5.1M out/target/product/generic_x86/cache.img โ— 1.3M out/target/product/generic_x86/ramdisk.img โ— 1.3G out/target/product/generic_x86/system.img โ— 12M out/target/product/generic_x86/userdata.img โ— 551M out/target/product/generic_x86/userdata-qemu.img โ— Brillo x86 64-bit: โ— 6.2M out/target/product/brilloemulator_x86_64/boot.img โ— 36K out/target/product/brilloemulator_x86_64/partition-table.img โ— 158M out/target/product/brilloemulator_x86_64/system.img โ— 201M out/target/product/brilloemulator_x86_64/userdata.img โ— 551M out/target/product/brilloemulator_x86_64/userdata-qemu.img
  • 32. 32 3.5. Services / Daemons โ— dbus-daemon โ— servicemanager โ— avahi-daemon โ— keystore โ— nativeperms โ— peripheralman โ— sensorservice โ— wpa_supplicant โ— brilloaudioservice โ— metrics_collector โ— metriscsd โ— perfprofd โ— tlsdated โ— tpm_managerd โ— trunksd โ— update_engine โ— weaved โ— webservd โ— shill โ— firewalld โ— dhcpd
  • 34. 34 4. Now back to your regular programming โ— Android Things does away with most of Brillo โ— Revert architecture to original โ— Weave seems gone from the FS, but site still on โ— Go back to system services with HALs โ— Extend Android API for IoT โ— Use of Android Studio and co. โ— Optional Display โ— Use of traditional static permissions
  • 36. 36 6. โ€œThingsโ€ Architecture Peripheral Manager IoTLauncher PIO HAL PIO APIs Your App User-Space Drivers Peripheral Driver Library
  • 37. 37 7. Images โ— Brillo x86 64-bit emulator: โ— 6.2M boot.img โ— 36K partition-table.img โ— 158M system.img โ— 201M userdata.img โ— Things x86 Edison: โ— 11M boot.img โ— 176M gapps.img โ— 4.6M oem.img โ— 420M system.img โ— 376K u-boot-edison.img โ— 35M userdata.img โ— Things Rpi3: โ— 350M root + system โ— 150M gapps โ— AOSP x86 32-bit: โ— 1.3G system.img
  • 38. 38 8. User-Space โ— Same FS layout as Android โ— Mostly same processes โ— In short, unlike Brillo, it's still very much Android
  • 39. 39 9. Services / Daemons โ— /system/bin/peripheralman โ— C++ System Service โ— Responds to dumpsys: dumpsysย com.google.android.things.pio.IPeripheralManager โ— Also was in Brillo โ— Sources (6 months old): โ— https://android.googlesource.com/platform/system/peripheralmanager/ โ— New HAL: โ— peripheral_io.h โ— As with other HALs: โ— /system/lib/hw/peripheral_io.<board_name>.so
  • 41. 41
  • 42. 42 11. Apps โ— New Launcher: IoTLauncher.apk โ— Still responds to same intent as LauncherN.apk โ€“ Try: aapt l -a IoTLauncher.apk โ— Likely party firing android.intent.category.IOT_LAUNCHER โ€“ Try: strings IoTLauncher.odex | grep IOT โ— Gone: โ— Home launcher (replaced by IoTLauncher) โ— Status bar โ— Settings (at least the content provider ... โ€œpsโ€ says the app is still running ;) ) โ— Interesting: โ— Google services (some of them at least) โ— Try: โ— dumpsys gfxinfo
  • 43. 43 12. What if I told you ... ? โ— What's this IoT thing ... ? โ— Consumer โ— Industrial/Commercial โ— 256MB+ RAM for an embedded device, really? ... โ— A long time ago in a galaxy far far away ...
  • 46. 46
  • 48. 48 โ— Vibrator โ— Battery โ— Audio โ— Baseband modem โ— Bluetooth โ— Camera โ— Consumer IR 12.3. Greybus Device Classes โ— Display โ— GPS โ— Keymaster โ— Lights โ— NFC โ— Sensors โ— Wifi
  • 49. 49 12.4. Bridged PHY Connection Protocols โ— USB โ— GPIO โ— SPI โ— UART โ— PWM โ— I2C โ— SDIO
  • 50. 50
  • 51. 51
  • 52. 52 12.5. Greybus for IOT Alexandre Baillon Baylibre
  • 53. 53From Alexandre's ELCE 2016 slides
  • 54. 54 12.6. Can I haz an Android for real-world IOT ?