Learning How Android Controls Hardware via GPIO
summary
Demonstrates controlling hardware GPIO on a TinkerBoard 2S from Android by toggling /sys/class/gpio (export → direction=out → value) to drive a watchdog timer-relay, verified with a voltmeter. Compares methods: invoking root shell commands from an app; building a privileged app via sharedUserId and platform signature; isolating GPIO access into a small privileged service app; and persisting permissions with unitrc plus SELinux domain changes, and recommends implementing a proper HAL/driver and framework service instead of letting apps write GPIO files directly.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:50GPIO background challenges
- 3:14Finding GPIO files commands
- 4:39GPIO control with root
- 5:42Minimizing permissions privileged apps
- 7:09Privileged app creation signing
- 9:57Principle of least privilege isolation
- 12:26Privileged app implementation testing
- 13:48Identifying test keys signing
- 17:23GPIO file permission issues fixes
- 18:49SELinux UnitRC permissions
- 19:52Android GPIO architecture
- 21:58Ideal GPIO control architecture
- 23:26Summary
related talks
44mAndroid Things
26mDeep Dive: Android Things Peripheral IO Manager
39mThese are a few of my favourite (Android) Things
41mEco-friendly hardware hacking with android
31mIntro to Android Things
25mProbably Not Scary: Android and Hardware
45m♫ These are a few of my favourite (Android) Things ♫
40mAndroid things in action
