diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2016-05-17 15:44:08 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-23 08:32:31 -0700 |
commit | 070cd3b58ab3244516da3ed68078e96d49a4f2e0 (patch) | |
tree | f3e4ebfa45f95cbcb9ec79160dec9418d52c68b3 /cmds/bootanimation | |
parent | 20e7bcc0e947c424cba0ac26eeab49c2c6b35168 (diff) | |
download | frameworks_base-070cd3b58ab3244516da3ed68078e96d49a4f2e0.zip frameworks_base-070cd3b58ab3244516da3ed68078e96d49a4f2e0.tar.gz frameworks_base-070cd3b58ab3244516da3ed68078e96d49a4f2e0.tar.bz2 |
bootanim: Cleanup
Group all file selection logic within getAnimationFileName(), including
for themes
Change-Id: Ibca93defd92230d22195753899eda673ba9fc59d
Diffstat (limited to 'cmds/bootanimation')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 15 | ||||
-rw-r--r-- | cmds/bootanimation/BootAnimation.h | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index da3026d..5afe1e8 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -73,6 +73,7 @@ #define OEM_SHUTDOWN_ANIMATION_FILE "/oem/media/shutdownanimation.zip" #define SYSTEM_SHUTDOWN_ANIMATION_FILE "/system/media/shutdownanimation.zip" #define SYSTEM_ENCRYPTED_SHUTDOWN_ANIMATION_FILE "/system/media/shutdownanimation-encrypted.zip" +#define THEME_SHUTDOWN_ANIMATION_FILE "/data/system/theme/shutdownanimation.zip" #define OEM_BOOT_MUSIC_FILE "/oem/media/boot.wav" #define SYSTEM_BOOT_MUSIC_FILE "/system/media/boot.wav" @@ -408,11 +409,9 @@ status_t BootAnimation::readyToRun() { (access(getAnimationFileName(IMG_ENC), R_OK) == 0) && ((zipFile = ZipFileRO::open(getAnimationFileName(IMG_ENC))) != NULL)) || - ((access(THEME_BOOTANIMATION_FILE, R_OK) == 0) && - ((zipFile = ZipFileRO::open(THEME_BOOTANIMATION_FILE)) != NULL)) || + ((access(getAnimationFileName(IMG_THM), R_OK) == 0) && + ((zipFile = ZipFileRO::open(getAnimationFileName(IMG_THM))) != NULL)) || - ((access(OEM_BOOTANIMATION_FILE, R_OK) == 0) && - ((zipFile = ZipFileRO::open(OEM_BOOTANIMATION_FILE)) != NULL)) || ((access(getAnimationFileName(IMG_DATA), R_OK) == 0) && ((zipFile = ZipFileRO::open(getAnimationFileName(IMG_DATA))) != NULL)) || @@ -885,12 +884,14 @@ bool BootAnimation::movie() const char *BootAnimation::getAnimationFileName(ImageID image) { - const char *fileName[2][3] = { { OEM_BOOTANIMATION_FILE, + const char *fileName[2][4] = { { OEM_BOOTANIMATION_FILE, SYSTEM_BOOTANIMATION_FILE, - SYSTEM_ENCRYPTED_BOOTANIMATION_FILE }, { + SYSTEM_ENCRYPTED_BOOTANIMATION_FILE, + THEME_BOOTANIMATION_FILE }, { OEM_SHUTDOWN_ANIMATION_FILE, SYSTEM_SHUTDOWN_ANIMATION_FILE, - SYSTEM_ENCRYPTED_SHUTDOWN_ANIMATION_FILE} }; + SYSTEM_ENCRYPTED_SHUTDOWN_ANIMATION_FILE, + THEME_SHUTDOWN_ANIMATION_FILE} }; int state; char sku[PROPERTY_VALUE_MAX]; char skusuffix[PATH_MAX]; diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h index 5bc1e8a..a0f84da 100644 --- a/cmds/bootanimation/BootAnimation.h +++ b/cmds/bootanimation/BootAnimation.h @@ -93,7 +93,7 @@ private: bool readFile(const char* name, String8& outString); bool movie(); - enum ImageID { IMG_DATA = 0, IMG_SYS = 1, IMG_ENC = 2 }; + enum ImageID { IMG_DATA = 0, IMG_SYS = 1, IMG_ENC = 2, IMG_THM = 3 }; const char *getAnimationFileName(ImageID image); const char *getBootRingtoneFileName(ImageID image); void playBackgroundMusic(); |