diff options
author | Weijie Wang <weijiew@codeaurora.org> | 2020-02-03 17:02:23 +0800 |
---|---|---|
committer | Weijie Wang <weijiew@codeaurora.org> | 2020-02-12 09:40:29 +0800 |
commit | f0ee1b9e89c7ef40c79c3a1179638acd53e1cfd7 (patch) | |
tree | e608abe16bc1ceaa8d25f24b5f4acec439ea75f2 /cmds/bootanimation/BootAnimation.cpp | |
parent | 4652e8a10663adb280e41e059156a15c162f5ae5 (diff) |
BootAnimation: Add bootanimation configuration prop
Add bootanimation configuration.
If bootanimation configuration is set and the configuration
media file is not existed or unavailable, it will play
default bootanimation.
Change-Id: Ideff09fe77f291542df85f862aa80e2f4f01d0b7
CRs-Fixed: 2614277
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 30f4ad4c5c69..87f7224702e1 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -357,6 +357,17 @@ void BootAnimation::findBootAnimationFile() { } } + std::string custAnimProp = !mShuttingDown ? + android::base::GetProperty("persist.sys.customanim.boot", ""): + android::base::GetProperty("persist.sys.customanim.shutdown", ""); + const char *custAnim = custAnimProp.c_str(); + ALOGD("Animation customzation path: %s", custAnim); + if (access(custAnim, R_OK) == 0) { + mZipFileName = custAnim; + ALOGD("%sAnimation customzation path: %s", mShuttingDown ? "Shutdown" : "Boot", mZipFileName.c_str()); + return; + } + const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1; static const char* bootFiles[] = {APEX_BOOTANIMATION_FILE, playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE, |