The original balalals. Cn/archives/ao…

Aosp project itself comes with a lot of external modules, the so-called external modules are some commands or libraries, generally placed in the external directory, some modules will be compiled with some default do not bring, do not bring can also be successfully compiled by MM and adb push into, but this will be very troublesome. To eliminate this unnecessary inconvenience, it is best to add it during the overall compilation. In the aosp want to compile, modify some of the properties more than actually modify can achieve a goal, what I say may also be one of them, because of the aosp compilation system is too big, he will be extracted from different folders compilation shows the final synthesis compile, modify where the need to consider, more out of observing the practice to understand meaning. Mk is an Android build description file similar to the cmakelist.txt file for the compiler, and some modules don’t have this file but have an Android.bp file. This file is actually an update of Android.mk, which can do the same thing but is much more readable, which is the official preferred approach. Anyway, about the compilation are generally in the build directory, yes indeed found in the below build/target/product/core_minimal mk PRODUCT_PACKAGES files found

PRODUCT_PACKAGES += \ BackupRestoreConfirmation \ CompanionDeviceManager \ CtsShimPrebuilt \ CtsShimPrivPrebuilt \ DownloadProvider \ ExtShared \ ExtServices \ HTMLViewer \ MediaProvider \ PackageInstaller \ SettingsProvider \ Shell \ StatementService \ WallpaperBackup \ Android.hidl. Base -V1.0- Java \ Android.hidl. Manager -V1.0- Java \Copy the code

Add the name of the module you want to add at the end. For example, I want tinyalsa to be added

    sensorservice \
    telephony-common \
    uiautomator \
    uncrypt \
    voip-common \
    webview \
    webview_zygote \
    tinyalsa \

Copy the code

I’m done adding, I’m done compiling, I’m done brushing, I’m done tinymix, tinyplay, tinyCap, and so on. Look carefully at this file, at the end of the file

$(call inherit-product, $(SRC_TARGET_DIR)/product/runtime_libart.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/base.mk)

Copy the code

The PRODUCT_PACKAGES statement can be used anywhere as long as the PRODUCT_PACKAGES statement can be used anywhere as long as the PRODUCT_PACKAGES statement can be used anywhere.