Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e0b5484 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Delay bootanimation exit until told to shutdown."

parents 68c04c02 aa599b90
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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);