diff options
author | 2024-09-09 19:42:26 +0000 | |
---|---|---|
committer | 2024-09-16 18:47:37 +0000 | |
commit | bd89e9b10fc2be4069594352a43e0284a91771b3 (patch) | |
tree | f89fc9ec0edcfc8af77944aee5e075e404902b0c /cmds/bootanimation/BootAnimation.cpp | |
parent | 34c72428ae3092692a8c0ccd1f381e4af3d4e146 (diff) |
Bootanimation: Use custom Boot animation name sys prop
Add a new option to boot animation to be able to define a custom name for a boot animation zip file located inside product/media following the pattern used with the light and dark themed animations.
Bug: 343704035
Test: On device test
Change-Id: Iae2df3c272d5ca03b9029aeefe78afddb494c6ad
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index fdf9abc49604..c2f6e3072507 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -70,8 +70,9 @@ namespace android { using ui::DisplayMode; static const char OEM_BOOTANIMATION_FILE[] = "/oem/media/bootanimation.zip"; -static const char PRODUCT_BOOTANIMATION_DARK_FILE[] = "/product/media/bootanimation-dark.zip"; -static const char PRODUCT_BOOTANIMATION_FILE[] = "/product/media/bootanimation.zip"; +static const char PRODUCT_BOOTANIMATION_DIR[] = "/product/media/"; +static const char PRODUCT_BOOTANIMATION_DARK_FILE[] = "bootanimation-dark.zip"; +static const char PRODUCT_BOOTANIMATION_FILE[] = "bootanimation.zip"; static const char SYSTEM_BOOTANIMATION_FILE[] = "/system/media/bootanimation.zip"; static const char APEX_BOOTANIMATION_FILE[] = "/apex/com.android.bootanimation/etc/bootanimation.zip"; static const char OEM_SHUTDOWNANIMATION_FILE[] = "/oem/media/shutdownanimation.zip"; @@ -749,8 +750,11 @@ bool BootAnimation::findBootAnimationFileInternal(const std::vector<std::string> void BootAnimation::findBootAnimationFile() { ATRACE_CALL(); const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1; + const std::string productBootanimationFile = PRODUCT_BOOTANIMATION_DIR + + android::base::GetProperty("ro.product.bootanim.file", playDarkAnim ? + PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE); static const std::vector<std::string> bootFiles = { - APEX_BOOTANIMATION_FILE, playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE, + APEX_BOOTANIMATION_FILE, productBootanimationFile, OEM_BOOTANIMATION_FILE, SYSTEM_BOOTANIMATION_FILE }; static const std::vector<std::string> shutdownFiles = { |