Progress Β· 0/7 phases
π π Phase 6 β Customization, OTA & Contributing
5 min read Β· Notion
Phase 6 β Customization, OTA & Contributing
Duration: 3β4 weeks | Level: Expert
Build a custom ROM. Understand OTA updates. Contribute back to AOSP.
π± Building a Custom ROM
What is a custom ROM?
A custom ROM = a full Android OS build (system.img, vendor.img, boot.img) customized beyond stock AOSP.
Popular custom ROMs: LineageOS, GrapheneOS, CalyxOS β all based on AOSP.
ROM customization areas
| Area | What you can change |
|---|---|
| SystemUI | Status bar, notification shade, quick settings |
| Settings | Add custom settings panels |
| Launcher | Replace the home screen |
| Build flags | Feature flags, debug options |
| Init.rc | Service startup behavior |
| Kernel | CPU governor, I/O scheduler |
| HAL | Custom camera/audio processing |
ποΈ SystemUI Customization
SystemUI is the process that renders the status bar, notification shade, lock screen, and navigation bar.
Source: frameworks/base/packages/SystemUI/
packages/SystemUI/src/com/android/systemui/
βββ statusbar/ # Status bar + notification shade
βββ qs/ # Quick Settings tiles
βββ navigationbar/ # Navigation bar
βββ lockscreen/ # Lock screen
βββ keyguard/ # Keyguard (PIN/pattern/biometric)Add a custom Quick Settings tile
// 1. Create class extending TileService
public class MyCustomTile extends TileService {
@Override
public void onTileAdded() { }
@Override
public void onClick() {
// toggle something
getQsTile().setState(Tile.STATE_ACTIVE);
getQsTile().updateTile();
}
}
// 2. Register in SystemUI manifest
// 3. Add to default tile list in configπ¦ OTA (Over-The-Air) Updates
Android OTA architecture
Server generates OTA package (.zip)
β
Device downloads to /data/ota_package/
β
Update Engine (update_engine daemon)
β
A/B partition switch OR Recovery mode flash
β
Device reboots into new systemA/B (Seamless) Updates (Android 7.0+)
- Device has two sets of system partitions (slot A and slot B)
- New system written to inactive slot while device is running
- On next boot, device switches to updated slot
- If boot fails, rolls back to previous slot automatically
- No downtime for user during update
Generating an OTA package
# Full OTA
m otapackage
# Output: out/target/product/<device>/βdeviceβ-ota-*.zip
# Incremental OTA (delta between two builds)
android/tools/releasetools/ota_from_target_files.py \
-i old_build.zip new_build.zip incremental_ota.zipRecovery mode
- Minimal Linux environment separate from main Android
- Can flash system partition from OTA zip
- Source:
bootable/recovery/
π Android Verified Boot (AVB)
AVB ensures the device only boots signed, unmodified system images:
Bootloader verifies kernel signature
β
Kernel verifies dm-verity hash tree of /system partition
β
Any modification to /system β boot fails- Prevents persistent rootkits
- OEM key stored in bootloader (efuse)
- Unlocking bootloader disables AVB and wipes device
π€ Contributing to AOSP
Gerrit β Android's code review system
AOSP uses Gerrit (at android-review.googlesource.com) for all code reviews.
Submit a patch step-by-step
# Step 1: Create a branch
cd frameworks/base
git checkout -b my-fix
# Step 2: Make your change
# edit files...
# Step 3: Commit with proper message
git add -A
git commit -m "Fix: correct NPE in ActivityManagerService
This commit fixes a NullPointerException that occurs when...
Bug: 12345678
Test: atest ActivityManagerServiceTest"
# Step 4: Upload to Gerrit
git push origin HEAD:refs/for/mainAOSP commit message format
<component>: <short description>
<detailed explanation of why the change is needed>
Bug: <bug number or 'None'>
Test: <how to verify the fix>Good first contributions
- Fix typos in comments/documentation
- Fix lint warnings
- Improve error messages
- Fix small bugs in non-critical paths
- Add test coverage
- Browse:
https://issuetracker.google.com/issues?q=status:open%20component:192705
π Key AOSP Resources
| Resource | URL |
|---|---|
| AOSP Source Browser | https://cs.android.com |
| AOSP Documentation | https://source.android.com |
| Gerrit Code Review | https://android-review.googlesource.com |
| Issue Tracker | https://issuetracker.google.com |
| Android Developers Blog | https://android-developers.googleblog.com |
| AOSP on GitHub (mirror) | https://github.com/aosp-mirror |
π οΈ Hands-On Tasks
- Modify
SystemUIstatus bar to show a custom icon permanently. - Customize the Settings app β add a new preference screen.
- Build an OTA package with
m otapackageand flash it on the emulator. - Study LineageOS source β pick one of their custom features and understand how it works.
- Find a real AOSP bug on the issue tracker and study the patch that fixed it on Gerrit.
- Submit your first AOSP change (even a docs typo fix counts!).
β Phase 6 Checklist
- Understand SystemUI process structure
- Modified status bar or added a QS tile
- Understand A/B partition update model
- Know how OTA packages are generated
- Understand Android Verified Boot (AVB)
- Can generate an OTA package with
m otapackage - Set up Gerrit account (
android-review.googlesource.com) - Know AOSP commit message format
- Studied at least one LineageOS custom feature patch
- Submitted or reviewed a change on Gerrit