fix [1981759] -no-boot-anim has no effect
diff --git a/cmds/bootanimation/bootanimation_main.cpp b/cmds/bootanimation/bootanimation_main.cpp
index 675ea81..a8359c4 100644
--- a/cmds/bootanimation/bootanimation_main.cpp
+++ b/cmds/bootanimation/bootanimation_main.cpp
@@ -16,6 +16,8 @@
#define LOG_TAG "BootAnimation"
+#include <cutils/properties.h>
+
#include <utils/IPCThreadState.h>
#include <utils/ProcessState.h>
#include <utils/IServiceManager.h>
@@ -41,12 +43,20 @@
setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY);
#endif
- sp<ProcessState> proc(ProcessState::self());
- ProcessState::self()->startThreadPool();
+ char value[PROPERTY_VALUE_MAX];
+ property_get("debug.sf.nobootanimation", value, "0");
+ int noBootAnimation = atoi(value);
+ LOGI_IF(noBootAnimation, "boot animation disabled");
+ if (!noBootAnimation) {
- // create the boot animation object
- sp<BootAnimation> boot = new BootAnimation();
+ sp<ProcessState> proc(ProcessState::self());
+ ProcessState::self()->startThreadPool();
- IPCThreadState::self()->joinThreadPool();
+ // create the boot animation object
+ sp<BootAnimation> boot = new BootAnimation();
+
+ IPCThreadState::self()->joinThreadPool();
+
+ }
return 0;
}