Skip to content

Commit 05b20c0

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "bootanimation: Don't open non-existing bootanimation.zip"
2 parents bcbb584 + c11f462 commit 05b20c0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

cmds/bootanimation/BootAnimation.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949

5050
#include "BootAnimation.h"
5151

52+
#define USER_BOOTANIMATION_FILE "/data/local/bootanimation.zip"
53+
#define SYSTEM_BOOTANIMATION_FILE "/system/media/bootanimation.zip"
54+
5255
namespace android {
5356

5457
// ---------------------------------------------------------------------------
@@ -244,12 +247,12 @@ status_t BootAnimation::readyToRun() {
244247
mFlingerSurfaceControl = control;
245248
mFlingerSurface = s;
246249

247-
mAndroidAnimation = false;
248-
status_t err = mZip.open("/data/local/bootanimation.zip");
249-
if (err != NO_ERROR) {
250-
err = mZip.open("/system/media/bootanimation.zip");
251-
if (err != NO_ERROR) {
252-
mAndroidAnimation = true;
250+
mAndroidAnimation = true;
251+
if ((access(USER_BOOTANIMATION_FILE, R_OK) == 0) ||
252+
(access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0)) {
253+
if ((mZip.open(USER_BOOTANIMATION_FILE) != NO_ERROR) ||
254+
(mZip.open(SYSTEM_BOOTANIMATION_FILE) != NO_ERROR)) {
255+
mAndroidAnimation = false;
253256
}
254257
}
255258

0 commit comments

Comments
 (0)