Android PRODUCT_COPY_FILES 自動拷貝文件

/**********************************************************************
 *           Android PRODUCT_COPY_FILES 自動拷貝文件
 * 說明:
 *     本文主要記錄如何向Android系統中自動添加本身的文件,主要是考慮到
 * 後續須要添加一些自動化腳本,不可能每次都本身手動去添加。
 *
 *                                    2016-4-13 深圳 南山平山村 曾劍鋒
 *********************************************************************/

1、參考文檔:
    1. Android——編譯體系中的【PRODUCT_COPY_FILES】【ALL_PREBUILT】【BUILD_PREBUILT】
        http://blog.csdn.net/jscese/article/details/40615801
    2. android源碼編譯,怎樣用PRODUCT_COPY_FILES 複製一個 文件夾 (注意,是文件夾)到指定目錄?
        http://zhidao.baidu.com/link?url=TtHwgcBqnN00zZEn6NQqKDFYqzY2N3m_e57LxAS3jGwFVj1rEwNUbHaE0wWJc87sniqzwxe_NU8nK8QiJw_QrK 

2、板級拷貝:
    1. 查看文件:
        myzr@myzr:~/myandroid/device/fsl/imx6$ ls sabresd_6dq.mk -al
        -rw-rw-r-- 1 myzr myzr 2494 Apr 21 17:31 sabresd_6dq.mk
    2. cat device/fsl/imx6/sabresd_6dq.mk
        # This is a FSL Android Reference Design platform based on i.MX6Q ARD board
        # It will inherit from FSL core product which in turn inherit from Google generic

        $(call inherit-product, device/fsl/imx6/imx6.mk)
        $(call inherit-product-if-exists,vendor/google/products/gms.mk)

        # Overrides
        PRODUCT_NAME := sabresd_6dq
        PRODUCT_DEVICE := sabresd_6dq

        PRODUCT_COPY_FILES += \
            device/fsl/sabresd_6dq/required_hardware.xml:system/etc/permissions/required_hardware.xml \
            device/fsl/sabresd_6dq/init.rc:root/init.freescale.rc \
            device/fsl/sabresd_6dq/vold.fstab:system/etc/vold.fstab \
            device/fsl/sabresd_6dq/gpsreset.sh:system/etc/gpsreset.sh \
            device/fsl/sabresd_6dq/audio_policy.conf:system/etc/audio_policy.conf \
            device/fsl/sabresd_6dq/audio_effects.conf:system/vendor/etc/audio_effects.conf

        # GPU files

        DEVICE_PACKAGE_OVERLAYS := device/fsl/sabresd_6dq/overlay

        PRODUCT_CHARACTERISTICS := tablet

        PRODUCT_AAPT_CONFIG += xlarge large tvdpi hdpi

        PRODUCT_COPY_FILES += \
            frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
            frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
            frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \
            frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
            frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
            frameworks/native/data/etc/android.hardware.faketouch.xml:system/etc/permissions/android.hardware.faketouch.xml \
            frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
            frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
            frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
            frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml

        # for PDK build, include only when the dir exists
        # too early to use $(TARGET_BUILD_PDK)
        ifneq ($(wildcard packages/wallpapers/LivePicker),)
        PRODUCT_COPY_FILES += \
            packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml
        endif
相關文章
相關標籤/搜索