diff options
-rw-r--r-- | cmds/bootanimation/iot/iotbootanimation_main.cpp | 14 |
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); |