Merge "Add half-resolution boot animations for low-end devices" into cm-11.0
diff --git a/config/common.mk b/config/common.mk
index e9c91fe..6c5764e 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -29,8 +29,12 @@
endef
$(foreach size,$(bootanimation_sizes), $(call check_and_set_bootanimation,$(size)))
+ifeq ($(TARGET_BOOTANIMATION_HALF_RES),true)
+PRODUCT_BOOTANIMATION := vendor/cm/prebuilt/common/bootanimation/halfres/$(TARGET_BOOTANIMATION_NAME).zip
+else
PRODUCT_BOOTANIMATION := vendor/cm/prebuilt/common/bootanimation/$(TARGET_BOOTANIMATION_NAME).zip
endif
+endif
ifdef CM_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
diff --git a/prebuilt/common/bootanimation/halfres/240.zip b/prebuilt/common/bootanimation/halfres/240.zip
new file mode 100644
index 0000000..a413bdc
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/240.zip
Binary files differ
diff --git a/prebuilt/common/bootanimation/halfres/320.zip b/prebuilt/common/bootanimation/halfres/320.zip
new file mode 100644
index 0000000..3e6ab2c
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/320.zip
Binary files differ
diff --git a/prebuilt/common/bootanimation/halfres/360.zip b/prebuilt/common/bootanimation/halfres/360.zip
new file mode 100644
index 0000000..aeea7e0
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/360.zip
Binary files differ
diff --git a/prebuilt/common/bootanimation/halfres/480.zip b/prebuilt/common/bootanimation/halfres/480.zip
new file mode 100644
index 0000000..ae6187c
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/480.zip
Binary files differ
diff --git a/prebuilt/common/bootanimation/halfres/540.zip b/prebuilt/common/bootanimation/halfres/540.zip
new file mode 100644
index 0000000..7a30066
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/540.zip
Binary files differ
diff --git a/prebuilt/common/bootanimation/halfres/600.zip b/prebuilt/common/bootanimation/halfres/600.zip
new file mode 100644
index 0000000..cc40702
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/600.zip
Binary files differ
diff --git a/prebuilt/common/bootanimation/halfres/generate-half-res-anims.sh b/prebuilt/common/bootanimation/halfres/generate-half-res-anims.sh
new file mode 100755
index 0000000..ffe91ec
--- /dev/null
+++ b/prebuilt/common/bootanimation/halfres/generate-half-res-anims.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+HALF_RES_RESOLUTIONS="240 320 360 480 540 600"
+
+for i in $HALF_RES_RESOLUTIONS; do
+ mkdir $i
+ cd $i
+ if [ -f ../../$(($i/2)).zip ]; then
+ # use the existing scaled images
+ echo "Using existing half-scale images instead of scaling from $i px"
+ unzip ../../$(($i/2)).zip
+ rm -f desc.txt
+ unzip ../../$i.zip desc.txt
+ else
+ unzip ../../$i.zip
+ for j in */*.jpg; do
+ convert $j -resize 50% tmp.jpg
+ mv tmp.jpg $j
+ done
+ fi
+ zip -r0 ../$i.zip .
+ cd ..
+ rm -rf $i
+done