Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 5ad384c0 authored by Michael Bestas's avatar Michael Bestas
Browse files

bootanimation: Fix preload of shutdown & themed animations

* Use getAnimationFileName instead of using hardcoded paths
* Add check for theme animation

Change-Id: I28b8de9a720db268619a01c18d0fb22cd1c6e748
parent d1274eb5
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -429,7 +429,6 @@ status_t BootAnimation::readyToRun() {
            ((access(getAnimationFileName(IMG_THM), R_OK) == 0) &&
            ((zipFile = ZipFileRO::open(getAnimationFileName(IMG_THM))) != NULL)) ||


            ((access(getAnimationFileName(IMG_DATA), R_OK) == 0) &&
            ((zipFile = ZipFileRO::open(getAnimationFileName(IMG_DATA))) != NULL)) ||

@@ -442,12 +441,14 @@ status_t BootAnimation::readyToRun() {
    // Preload the bootanimation zip on memory, so we don't stutter
    // when showing the animation
    FILE* fd;
    if (encryptedAnimation && access(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE, R_OK) == 0)
        fd = fopen(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE, "r");
    else if (access(OEM_BOOTANIMATION_FILE, R_OK) == 0)
        fd = fopen(OEM_BOOTANIMATION_FILE, "r");
    else if (access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0)
        fd = fopen(SYSTEM_BOOTANIMATION_FILE, "r");
    if (encryptedAnimation && access(getAnimationFileName(IMG_ENC), R_OK) == 0)
        fd = fopen(getAnimationFileName(IMG_ENC), "r");
    else if (access(getAnimationFileName(IMG_THM), R_OK) == 0)
        fd = fopen(getAnimationFileName(IMG_THM), "r");
    else if (access(getAnimationFileName(IMG_DATA), R_OK) == 0)
        fd = fopen(getAnimationFileName(IMG_DATA), "r");
    else if (access(getAnimationFileName(IMG_SYS), R_OK) == 0)
        fd = fopen(getAnimationFileName(IMG_SYS), "r");
    else
        return NO_ERROR;