summaryrefslogtreecommitdiff
path: root/cmds/bootanimation
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-09-26 23:47:07 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-09-26 23:47:07 +0000
commit9e0b54848dda963f82a58554d1543477ae7359e4 (patch)
tree1c4f1dff8953e40ecfa3eb99ca58ca3b4b26e530 /cmds/bootanimation
parent68c04c024db0196d1116c35eef0f3b10125edd1f (diff)
parentaa599b90f79db61c843a6bb08a03a4e2a6fa1a20 (diff)
Merge "Delay bootanimation exit until told to shutdown."
Diffstat (limited to 'cmds/bootanimation')
-rw-r--r--cmds/bootanimation/iot/iotbootanimation_main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmds/bootanimation/iot/iotbootanimation_main.cpp b/cmds/bootanimation/iot/iotbootanimation_main.cpp
index 252748875289..441a140178d4 100644
--- a/cmds/bootanimation/iot/iotbootanimation_main.cpp
+++ b/cmds/bootanimation/iot/iotbootanimation_main.cpp
@@ -64,6 +64,20 @@ class BootActionAnimationCallbacks : public android::BootAnimation::Callbacks {p
void shutdown() override {
if (mBootAction != nullptr) {
+ // If we have a bootaction we want to wait until we are actually
+ // told to shut down. If the animation exits early keep the action
+ // running.
+ char value[PROPERTY_VALUE_MAX] = {0};
+ for (int exitRequested = 0; exitRequested == 0; ) {
+ property_get("service.bootanim.exit", value, "0");
+ exitRequested = atoi(value);
+
+ // Poll value at 10hz.
+ if (exitRequested == 0) {
+ usleep(100000);
+ }
+ }
+
mBootAction->shutdown();
// Give it two seconds to shut down.
sleep(2);