Conditionally show bootanimation for quiescent boots

Allow bootanimation to play if the boot is quiescent and the system
property ro.bootanim.quiescent.enabled is set to true.
This allows the bootanimation to become visible if the display is
turned on during the bootanimation. If OEMs want this behavior and the
device implements suppression of video/audio during quiescent boot,
they can set the system property
ro.bootanim.quiescent.enabled.

Bug: 185118020
Test: PRODUCT_PRODUCT_PROPERTIES += ro.bootanim.quiescent.enabled=true
      adb reboot quiescent
      Spam `adb shell input keyevent POWER` during boot
Test: Repeat the above test with the property set to 0
Change-Id: I54a4ad552704106ca06c4992fed4a2d501aa3fa5
diff --git a/cmds/bootanimation/BootAnimationUtil.cpp b/cmds/bootanimation/BootAnimationUtil.cpp
index 1e417e9..4f56e5a 100644
--- a/cmds/bootanimation/BootAnimationUtil.cpp
+++ b/cmds/bootanimation/BootAnimationUtil.cpp
@@ -49,7 +49,14 @@
     }
 
     property_get("ro.boot.quiescent", value, "0");
-    return atoi(value) > 0;
+    if (atoi(value) > 0) {
+        // Only show the bootanimation for quiescent boots if this system property is set to enabled
+        if (!property_get_bool("ro.bootanim.quiescent.enabled", false)) {
+            return true;
+        }
+    }
+
+    return false;
 }
 
 void waitForSurfaceFlinger() {