diff options
author | Jim Huang <jserv@0xlab.org> | 2010-08-10 03:12:15 +0800 |
---|---|---|
committer | Jim Huang <jserv@0xlab.org> | 2010-08-10 03:12:15 +0800 |
commit | c11f46259a1e8f4e7e58925aefd1ed9eaf57a7fc (patch) | |
tree | 54c99680c61b4e33b05d3278882f84bdf27da892 /cmds | |
parent | 0f0dd448ea54ddb760ed77e7d9167b7d7ad1b916 (diff) | |
download | frameworks_base-c11f46259a1e8f4e7e58925aefd1ed9eaf57a7fc.zip frameworks_base-c11f46259a1e8f4e7e58925aefd1ed9eaf57a7fc.tar.gz frameworks_base-c11f46259a1e8f4e7e58925aefd1ed9eaf57a7fc.tar.bz2 |
bootanimation: Don't open non-existing bootanimation.zip
While booting from AOSP image, logcat always complains as following:
W/zipro ( 1001): Unable to open zip '/data/local/bootanimation.zip':
No such file or directory
W/zipro ( 1001): Unable to open zip '/system/media/bootanimation.zip':
No such file or directory
This patch avoids opening non-existing files.
Change-Id: I54cc03f125a5e16dbc930515bd2e43c623b63f8f
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index ac2eb0d..f4b48b6 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -49,6 +49,9 @@ #include "BootAnimation.h" +#define USER_BOOTANIMATION_FILE "/data/local/bootanimation.zip" +#define SYSTEM_BOOTANIMATION_FILE "/system/media/bootanimation.zip" + namespace android { // --------------------------------------------------------------------------- @@ -244,12 +247,12 @@ status_t BootAnimation::readyToRun() { mFlingerSurfaceControl = control; mFlingerSurface = s; - mAndroidAnimation = false; - status_t err = mZip.open("/data/local/bootanimation.zip"); - if (err != NO_ERROR) { - err = mZip.open("/system/media/bootanimation.zip"); - if (err != NO_ERROR) { - mAndroidAnimation = true; + mAndroidAnimation = true; + if ((access(USER_BOOTANIMATION_FILE, R_OK) == 0) || + (access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0)) { + if ((mZip.open(USER_BOOTANIMATION_FILE) != NO_ERROR) || + (mZip.open(SYSTEM_BOOTANIMATION_FILE) != NO_ERROR)) { + mAndroidAnimation = false; } } |