simplify (and fix) boot animation selection

Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
This commit is contained in:
Wolfgang Wiedmeyer 2017-06-23 13:04:25 +02:00
parent fbea83bdb5
commit da76a3e288
No known key found for this signature in database
GPG Key ID: 5816A24C10757FC4
5 changed files with 7 additions and 35 deletions

View File

@ -1,36 +1,8 @@
PRODUCT_BRAND ?= replicant
ifneq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
# determine the smaller dimension
TARGET_BOOTANIMATION_SIZE := $(shell \
if [ $(TARGET_SCREEN_WIDTH) -lt $(TARGET_SCREEN_HEIGHT) ]; then \
echo $(TARGET_SCREEN_WIDTH); \
else \
echo $(TARGET_SCREEN_HEIGHT); \
fi )
# get a sorted list of the sizes
bootanimation_sizes := $(subst .zip,, $(shell ls vendor/replicant/prebuilt/common/bootanimation))
bootanimation_sizes := $(shell echo -e $(subst $(space),'\n',$(bootanimation_sizes)) | sort -rn)
# find the appropriate size and set
define check_and_set_bootanimation
$(eval TARGET_BOOTANIMATION_NAME := $(shell \
if [ -z "$(TARGET_BOOTANIMATION_NAME)" ]; then
if [ $(1) -le $(TARGET_BOOTANIMATION_SIZE) ]; then \
echo $(1); \
exit 0; \
fi;
fi;
echo $(TARGET_BOOTANIMATION_NAME); ))
endef
$(foreach size,$(bootanimation_sizes), $(call check_and_set_bootanimation,$(size)))
ifeq ($(TARGET_BOOTANIMATION_HALF_RES),true)
PRODUCT_BOOTANIMATION := vendor/replicant/prebuilt/common/bootanimation/halfres/$(TARGET_BOOTANIMATION_NAME).zip
else
PRODUCT_BOOTANIMATION := vendor/replicant/prebuilt/common/bootanimation/$(TARGET_BOOTANIMATION_NAME).zip
endif
ifneq ($(TARGET_BOOTANIMATION_NAME),)
PRODUCT_COPY_FILES += \
vendor/replicant/prebuilt/common/bootanimation/$(TARGET_BOOTANIMATION_NAME).zip:system/media/bootanimation.zip
endif
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0

View File

@ -8,7 +8,7 @@ PRODUCT_PACKAGES += \
# Include CM LatinIME dictionaries
PRODUCT_PACKAGE_OVERLAYS += vendor/replicant/overlay/dictionaries
ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
ifeq ($(TARGET_BOOTANIMATION_NAME),)
PRODUCT_COPY_FILES += \
vendor/replicant/prebuilt/common/bootanimation/vertical-480x800.zip:system/media/bootanimation.zip
endif

View File

@ -8,7 +8,7 @@ PRODUCT_PACKAGES += \
# Include CM LatinIME dictionaries
PRODUCT_PACKAGE_OVERLAYS += vendor/replicant/overlay/dictionaries
ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
ifeq ($(TARGET_BOOTANIMATION_NAME),)
PRODUCT_COPY_FILES += \
vendor/replicant/prebuilt/common/bootanimation/horizontal-1280x800.zip:system/media/bootanimation.zip
endif

View File

@ -4,7 +4,7 @@ $(call inherit-product, vendor/replicant/config/common_mini.mk)
PRODUCT_PACKAGES += \
LatinIME
ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
ifeq ($(TARGET_BOOTANIMATION_NAME),)
PRODUCT_COPY_FILES += \
vendor/replicant/prebuilt/common/bootanimation/vertical-320x480.zip:system/media/bootanimation.zip
endif

View File

@ -5,7 +5,7 @@ $(call inherit-product, vendor/replicant/config/common_mini.mk)
PRODUCT_PACKAGES += \
LatinIME
ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
ifeq ($(TARGET_BOOTANIMATION_NAME),)
PRODUCT_COPY_FILES += \
vendor/replicant/prebuilt/common/bootanimation/horizontal-1024x600.zip:system/media/bootanimation.zip
endif