Add custom.xml file to AOSP etc folder

孤街醉人 提交于 2020-01-01 12:24:09

问题


I wanted to add a resource file/ xml file to etc folder in AOSP. I would like to have my resource file available just like platform.xml file.

So I basically added my xml file in AOSP/frameworks/base/data/etc folder and correspondingly added the following lines in the make file Android.mk



########################
include $(CLEAR_VARS)

LOCAL_MODULE := custom.xml

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE_CLASS := ETC

# This will install the file in /system/etc/permissions
#
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions

LOCAL_SRC_FILES := $(LOCAL_MODULE)

include $(BUILD_PREBUILT)

EDIT
With the above added I was not able to see my file in /system/etc/permissions folder. Am I missing something?


回答1:


It looks that your change is device specific and not framework related. In that case you probably want to include your file in aosp / device / ... / model /

You can check how is done looking in the device makefile from samsung tuna: https://android.googlesource.com/device/samsung/tuna/+/master/device.mk

The PRODUCT_COPY_FILES variable includes the "origin_file:destination_file"

PRODUCT_COPY_FILES += \
$(LOCAL_KERNEL):kernel \
device/samsung/tuna/init.tuna.rc:root/init.tuna.rc \
device/samsung/tuna/init.tuna.usb.rc:root/init.tuna.usb.rc \
device/samsung/tuna/fstab.tuna:root/fstab.tuna \
device/samsung/tuna/ueventd.tuna.rc:root/ueventd.tuna.rc \
device/samsung/tuna/media_profiles.xml:system/etc/media_profiles.xml \
device/samsung/tuna/media_codecs.xml:system/etc/media_codecs.xml \
device/samsung/tuna/gps.conf:system/etc/gps.conf


来源:https://stackoverflow.com/questions/23074411/add-custom-xml-file-to-aosp-etc-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!