diff options
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index a8b6c0b70804..2858e3d15e38 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -271,7 +271,9 @@ static void* decodeImage(const void* encodedData, size_t dataLength, AndroidBitm const size_t size = outInfo->stride * outInfo->height; void* pixels = malloc(size); int result = AImageDecoder_decodeImage(decoder, pixels, outInfo->stride, size); - AImageDecoder_delete(decoder); + // TODO(b/180130969) Fix ~ImageDecoder() so that AImageDecoder_delete stops + // causing a segfault, then add back this call to AImageDecoder_delete(). + //AImageDecoder_delete(decoder); if (result != ANDROID_IMAGE_DECODER_SUCCESS) { free(pixels); @@ -724,6 +726,18 @@ bool BootAnimation::findBootAnimationFileInternal(const std::vector<std::string> } void BootAnimation::findBootAnimationFile() { + + std::string custAnimProp = !mShuttingDown ? + android::base::GetProperty("persist.sys.customanim.boot", ""): + android::base::GetProperty("persist.sys.customanim.shutdown", ""); + const char *custAnim = custAnimProp.c_str(); + ALOGD("Animation customzation path: %s", custAnim); + if (access(custAnim, R_OK) == 0) { + mZipFileName = custAnim; + ALOGD("%sAnimation customzation path: %s", mShuttingDown ? "Shutdown" : "Boot", mZipFileName.c_str()); + return; + } + const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1; static const std::vector<std::string> bootFiles = { APEX_BOOTANIMATION_FILE, playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE, |