Understanding build layers

The AOSP build system includes the abstraction layers to build a device. After we understand the ideas behind these layers, it will help us to understand the relationship of the various Makefiles for a device. It is always good to refer to the original Google document at the following URL, when you start to create a new device. The information will usually be updated when a new Android release is available: http://source.android.com/source/add-device.html.

In this section, we will apply the information from the previous Google document to the specific Android emulator virtual hardware that we are going to work on. In this way, we can derive all device-specific Makefiles according to the general guidance from the previous Google document. Throughout the process from generic to specific, we can apply the inheritance of object-oriented concepts to the Makefile system.

There are three layers, Product, Board/Device, and Architecture, in the device build system. These layers can be considered as different dimensions to measure the characteristic of a product. Each layer relates to the one above it in a one-to-many relationship, which is similar to the inheritance or composition relationship in the object-oriented terms. For example, one kind of hardware architecture can have more than one board and each board can have more than one product. We will see how this method works when we create a new device in this chapter later.

The following table is a list of layers used in an AOSP build system. I created this table by modifying the one from the Google document and added my comments specific to the x86emu device, which we are going to work on in this chapter.

Layer

Description

Product

The Product layer defines the feature specifications of the shipping product such as the modules to build, locales supported, and the configuration for various locales. In other words, this is the name of the overall product. Product-specific variables are defined in product definition Makefiles. A product can inherit from other product definitions, which simplifies maintenance. A common method is to create a base product that contains features that apply for all products, then creating product variants based on that base product.

In this chapter, we inherit from a generic device for an Android emulator in AOSP to create our x86emu device. For the x86emu device, we can also create two products that differ only by their architecture variants (we can have different builds for x86 or x86_64).

Board/Device

The Board/Device layer represents the physical layer of plastic on the device (that is, the industrial design of the device). For example, North American devices probably include QWERTY keyboards, whereas devices sold in France probably include AZERTY keyboards.

This layer also represents the bare schematics of a product. These include the peripherals on the board and their configuration. In the x86emu device, we need to define the size of the filesystem, the graphics hardware and camera, and so on. In Chapter 7, Enabling Wi-Fi on the Android Emulator, we want to support Wi-Fi in the emulator. We need to specify it in the board configuration file.

Arch

The Architecture layer describes the processor configuration and Application Binary Interface (ABI) running on the board.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.149.180