What is the difference between Android Open Source Project and Linux based systems?
1. Linux and AOSP Architecture
If you look at the architecture of any embedded Linux system, you will always find the same main components:
Now, if you look at the same diagram for an Android-based system, what would be the differences ?
As we can see from the image above, Android userspace components are clearly divided in 3 main layers:
Before studying Android userspace components in details, let’s talk a little bit about the kernel.
Linux kernel
To run an Android-based system, we need a few extra “features” enabled in the Linux kernel. This is some features :
Despite these and a few other main changes in the Linux kernel, Android really differs from an GNU/Linux system in the userspace components and their architecture (the so-called Android platform), and the source-code for the Android platform is provided in a project called AOSP (Android Open Source Project).
AOSP
The AOSP is made of hundreds of repositories (specifically 780 in Android 11), and you can see all of them in https://android.googlesource.com/.
The source code is managed with known tools like repo and git, and it is huge! Android 11 is 100GB of source code plus 115GB after one build. So you really need a lot of disk space to work with the Android source code.
The vast majority of software components are under the permissive Apache and BSD licenses, some software components are under GPL/LGPL licenses, and some Google applications are closed source (e.g. Google Play, Gmail, Google Maps, YouTube, etc). Those applications are available in a package called Google Mobile Services (GMS), and to obtain them, you need to certify the device via Android Compatibility Program (ACP).
When we download AOSP source code, we can see some differences when compared to other approaches for embedded Linux development.
Unlike ready-to-be-used distros (e.g. Debian), you can easily download the full source code and build the distro from scratch (if you want to create a custom Debian system for example, you usually do it from pre-compiled packages).
Comparing to build system approaches (e.g. Buildroot, OpenEmbedded), in Android it seems we have a “big application” downloaded with the repo sync command. Of course this is not true. We have thousands of projects and repositories there, that will compose in the end the operating system images. And the responsibility to put everything together rests with the Android build system…