diff options
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 3109c5c1e075..25a8e482fd00 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -180,7 +180,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); @@ -578,6 +580,17 @@ 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, |