Android

  • Android

    Android Build System OverView

    Status: Draft (as of May 18, 2006) Contents This article comes from the build/core/build-system.html file in the Android source code. Since I couldn’t find an online version of the build/core/build-system.html file, I’ve formatted it and put it here for your viewing. 1 Objective The primary goals of reworking the build system are (1) to make dependencies work more reliably, so that when files need to rebuilt, they are, and (2) to improve performance of the build system so that unnecessary modules are not rebuilt, and so doing a top-level build when little or nothing needs to be done for a build takes as little time as possible. 2 Principles and…

  • Setup Android 12 Build Environment
    Android,  未分类

    Setup Android 12 Build Environment

    This is the first article in the Android series, introducing the process of setting up and debugging the Android development environment. The following demonstrates the process of setting up the environment on Ubuntu 20.04. Installing Android 12 Environment Dependencies Reference documentation for environment dependencies: Setting Up the Build Environment sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig Downloading Android 12 Source Code Downloading the Repo Tool Downloading the Repo Tool AOSP code is managed via git, and multiple git repositories are managed using the repo tool. Before downloading the code, you need to download…

  • Adding a Custom System Service in Android
    Android

    Adding a Custom System Service in Android

    In the Android operating system, System Services are core components that provide system-level services such as power management, window management, package management, and more. Creating and registering a custom System Service can extend the functionality of Android and provide new system services to applications. This article will detail how to add a custom System Service in Android. Prerequisites Before starting, ensure you have the following: Basic knowledge of Android development. Familiarity with building and debugging Android source code. Access to modify the Android source code. Android System Service Architecture Before diving into the code, it’s important to understand the architecture of Android System Services. Android System Services use the Binder…

  • Android,  English,  Selinux

    Understand Android Vendor SELinux Policy Build

    Since the introduction of the Treble framework in Android 8, Android has divided the system into System and Vendor parts, allowing independent upgrades of system and vendor. Subsequently, Product, ODM, and other partitions were introduced. In this context, SELinux policies are also divided into several parts: platform (system), system_ext, product, vendor, and odm. This article uses the Vendor partition as an example to analyze in detail how to include sepolicy files in the Android build system, how Android.mk variables are passed to the Soong build system, and finally how they correspond to modules and variables in Android.bp. 1. Including SELinux Policy Files in Android Makefile First, the SELinux policy files…