# ----------------------------------------------------------------- # default.prop INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET) ADDITIONAL_DEFAULT_PROPERTIES := \ $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) ADDITIONAL_DEFAULT_PROPERTIES += \ $(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) ADDITIONAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ $(ADDITIONAL_DEFAULT_PROPERTIES),=) $(INSTALLED_DEFAULT_PROP_TARGET): @echo Target buildinfo: $@ @mkdir -p $(dir $@) $(hide) echo "#" > $@; \ echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \ echo "#" >> $@; $(hide) $(foreach line,$(ADDITIONAL_DEFAULT_PROPERTIES), \ echo "$(line)" >> $@;) build/tools/post_process_props.py $@
所以在所有 *.mk 中,有宣告 ADDITIONAL_DEFAULT_PROPERTY_OVERRIDES 的,都會被加入 default.prop 中。
例如:
android/devices/common/common.mk: # Set default USB interface PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ persist.sys.usb.config=mass_storage \ persist.sys.strictmode.disable=1
另外,script 又多加處理某些部份,寫在 build/tools/post_process_props.py:
# Put the modifications that you need to make into the /system/build.prop into this # function. The prop object has get(name) and put(name,value) methods. def mangle_default_prop(prop): # If ro.debuggable is 1, then enable adb on USB by default # (this is for userdebug builds) if prop.get("ro.debuggable") == "1": val = prop.get("persist.sys.usb.config") if val == "": val = "adb" else: val = val + ",adb" prop.put("persist.sys.usb.config", val) # UsbDeviceManager expects a value here. If it doesn't get it, it will # default to "adb". That might not the right policy there, but it's better # to be explicit. if not prop.get("persist.sys.usb.config"): prop.put("persist.sys.usb.config", "none");他加上 persist.sys.usb.config adb
所以最後 rootfs/default.prop 就有:
persist.sys.usb.config=mass_storage,adb
沒有留言:
張貼留言