diff options
author | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-09-20 17:31:40 +0300 |
---|---|---|
committer | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-09-20 17:32:16 +0300 |
commit | 5ad384c0b59c0b425a47164f556cfa17f0ba930e (patch) | |
tree | b17cb50eea249b5af47d3e9c2543ce45a23915e5 /cmds/bootanimation | |
parent | d1274eb549a37fbf32a534e1b5bfc43267669383 (diff) | |
download | frameworks_base-5ad384c0b59c0b425a47164f556cfa17f0ba930e.zip frameworks_base-5ad384c0b59c0b425a47164f556cfa17f0ba930e.tar.gz frameworks_base-5ad384c0b59c0b425a47164f556cfa17f0ba930e.tar.bz2 |
bootanimation: Fix preload of shutdown & themed animations
* Use getAnimationFileName instead of using hardcoded paths
* Add check for theme animation
Change-Id: I28b8de9a720db268619a01c18d0fb22cd1c6e748
Diffstat (limited to 'cmds/bootanimation')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 1274b69..c4a73d1 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -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; |