One of the most common customization actions to perform in Android firmware is to establish the default applications and libraries that will be compiled and included in the final Android image. These items are defined in the PRODUCT_PACKAGES variable that is declared and extended in several Android makefiles in the sources. This is a brief list of makefiles containing the most important applications and libraries that will be included in the final Android firmware:

• device/digi/ccimx6sbc/ccimx6sbc.mk

• device/digi/imx6/imx6.mk

• build/target/product/generic.mk

• build/target/product/generic_no_telephony.mk

• build/target/product/telephony.mk

• build/target/product/core.mk

• build/target/product/core_base.mk

• build/target/product/core_minimal.mk

• build/target/product/base.mk

• build/target/product/embedded.mk

 The makefiles of the list are sorted by calling order, from product specific to Android core.

Each application or library is identified by its LOCAL_PACKAGE_NAME, which defined in the component makefile. This is an example of the Calculator application makefile:

Calculator application makefile
``````LOCAL_PATH := $(call my-dir) include$(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := libarity android-support-v4 guava
LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_SDK_VERSION := current LOCAL_PACKAGE_NAME := Calculator include$(BUILD_PACKAGE)
##################################################
include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libarity:arity-2.1.2.jar include$(BUILD_MULTI_PREBUILT)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))``````

Note that the LOCAL_PACKAGE_NAME of the Calculator application is Calculator. This will identify the component in all Android sources.

## Remove a default application or library

To remove a default application or library from your custom Android firmware, you must delete all the entries of that component from the PRODUCT_PACKAGES variable. To do so, look for the component identifier in the list of makefiles presented before and remove all the entries you find.

 The same application or library could be declared in more than one makefile. Digi recommends you check the list of makefiles listed before to ensure that the component is fully removed.

For example, to remove the Calculator application you need to remove the Calculator \ entry from the build/target/product/core.mk file. (It is not defined anywhere else.)

build/target/product/core.mk
``````[...]
PRODUCT_PACKAGES += \
BasicDreams \
Browser \
Calculator \
Calendar \
CalendarProvider \