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
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 30f4ad4..87f7224 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -357,6 +357,17 @@
         }
     }
 
+    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,