Android attribute build. Prop Generation Process Analysis

Source: Internet
Author: User

This article briefly analyzes how build. Prop is generated. Android build. the prop file is a variety of properties (LCD density/Language/Compilation Time, etc.) collected during Android compilation .), after compilation, the file is generated in the out/target/product/<board>/system/directory. During Android runtime, you can use property_get () [C/C ++ domain]/systemproperties_get * () [Java domain] to read these attribute values.

 

Build. PropThe build/CORE/MakefileComplete.

1)MakefileDefine various variables first, which will be used in the next step. For example:

 

View plain
    1. ...
    2. Product_default_language = "$ (calldefault-locale-language, $ (product_locales ))"\
    3. Product_default_region = "$ (calldefault-locale-region, $ (product_locales ))"\
    4. ...

2) Call build/tools/In makefile/Buildinfo. ShRun the script and output it to build. Prop.

Buildinfo. Sh is simple, just echo some attributes, such:

 

View plain
    1. ...
    2. Echo "Ro. Product. locale. Language = $ product_default_language"
    3. Echo "Ro. Product. locale. region = $ product_default_region"
    4. ...

Ro. Product. locale. Language/Ro. Product. locale. region are some attributes, and values are followed by equal signs.

3) In makefile, directly add $ (target_device_dir )/System. PropContent to build. Prop.

4) CollectionAdditional_build_propertiesAnd append it to build. Prop.

Additional_build_properties will be collected againProduct_property_overridesProperties defined in

 

View plain
    1. Additional_build_properties: = \
    2. $ (Additional_build_properties )\
    3. $ (Product_property_overrides)

 

Use build. the analysis of the prop generation process shows where to modify the original attributes or add custom attributes, that is, 2) buildinfo. SH; 3) system. prop; 4) additional_build_properties or product_property_overrides. However, it is recommended that you change it to system. Prop or product_property_overrides, which corresponds to the modification of a specific platform or product.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.