Add support for TARGET_SCREEN_DENSITY
This variable is used to populate the ro.sf.lcd_density property in /vendor/build.prop, as well as choosing the correct density bucket for assets in recovery. Bug: 118676832 Test: inspect taimen and crosshatch in recovery Test: adb shell getprop ro.sf.lcd_density Change-Id: I80cf4d28ecfbae17f1ee206a279e7d9144bd7c05
This commit is contained in:
@@ -504,6 +504,9 @@ $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(intermediate_sys
|
|||||||
$(hide) echo ro.product.board="$(TARGET_BOOTLOADER_BOARD_NAME)">>$@
|
$(hide) echo ro.product.board="$(TARGET_BOOTLOADER_BOARD_NAME)">>$@
|
||||||
$(hide) echo ro.board.platform="$(TARGET_BOARD_PLATFORM)">>$@
|
$(hide) echo ro.board.platform="$(TARGET_BOARD_PLATFORM)">>$@
|
||||||
$(hide) echo ro.hwui.use_vulkan="$(TARGET_USES_VULKAN)">>$@
|
$(hide) echo ro.hwui.use_vulkan="$(TARGET_USES_VULKAN)">>$@
|
||||||
|
ifdef TARGET_SCREEN_DENSITY
|
||||||
|
$(hide) echo ro.sf.lcd_density="$(TARGET_SCREEN_DENSITY)">>$@
|
||||||
|
endif
|
||||||
$(hide) $(call generate-common-build-props,vendor,$@)
|
$(hide) $(call generate-common-build-props,vendor,$@)
|
||||||
ifdef property_overrides_split_enabled
|
ifdef property_overrides_split_enabled
|
||||||
$(hide) echo "#" >> $@; \
|
$(hide) echo "#" >> $@; \
|
||||||
@@ -1532,15 +1535,13 @@ recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system
|
|||||||
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
|
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
|
||||||
recovery_resources_common := $(call include-path-for, recovery)/res
|
recovery_resources_common := $(call include-path-for, recovery)/res
|
||||||
|
|
||||||
# Set recovery_density to a density bucket based on PRODUCT_AAPT_PREF_CONFIG if set. Otherwise use
|
# Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG,
|
||||||
# the default medium density.
|
# or mdpi, in order of preference. We support both specific buckets (e.g. xdpi) and numbers,
|
||||||
ifneq (,$(PRODUCT_AAPT_PREF_CONFIG))
|
# which get remapped to a bucket.
|
||||||
# If PRODUCT_AAPT_PREF_CONFIG includes a non-numeric dpi bucket, always perfer that value.
|
recovery_density := $(or $(TARGET_SCREEN_DENSITY),$(PRODUCT_AAPT_PREF_CONFIG),mdpi)
|
||||||
recovery_density := $(filter %dpi,$(PRODUCT_AAPT_PREF_CONFIG))
|
|
||||||
ifeq (,$(filter xxxhdpi xxhdpi xhdpi hdpi mdpi,$(recovery_density)))
|
ifeq (,$(filter xxxhdpi xxhdpi xhdpi hdpi mdpi,$(recovery_density)))
|
||||||
recovery_density_value := $(patsubst %dpi,%,$(recovery_density))
|
recovery_density_value := $(patsubst %dpi,%,$(recovery_density))
|
||||||
# Map the numeric dpi value to a bucket. We roughly use the medium point between the primary
|
# We roughly use the medium point between the primary densities to split buckets.
|
||||||
# densities to split buckets.
|
|
||||||
# ------160------240------320----------480------------640------
|
# ------160------240------320----------480------------640------
|
||||||
# mdpi hdpi xhdpi xxhdpi xxxhdpi
|
# mdpi hdpi xhdpi xxhdpi xxxhdpi
|
||||||
recovery_density := $(strip \
|
recovery_density := $(strip \
|
||||||
@@ -1549,9 +1550,6 @@ recovery_density := $(strip \
|
|||||||
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\
|
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\
|
||||||
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi)))
|
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi)))
|
||||||
endif
|
endif
|
||||||
else # PRODUCT_AAPT_PREF_CONFIG is empty
|
|
||||||
recovery_density := mdpi
|
|
||||||
endif # PRODUCT_AAPT_PREF_CONFIG
|
|
||||||
|
|
||||||
ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density)))
|
ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density)))
|
||||||
recovery_resources_common := $(recovery_resources_common)-$(recovery_density)
|
recovery_resources_common := $(recovery_resources_common)-$(recovery_density)
|
||||||
|
Reference in New Issue
Block a user