summaryrefslogtreecommitdiffstats
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-23 15:44:05 -0700
committerMathias Agopian <mathias@google.com>2009-09-23 15:49:32 -0700
commitbc7261130a51dc9f3461d3970eee1b923bcbf193 (patch)
tree8f74c3943a2582418addd8c91e0c1307fe95f733 /cmds/bootanimation/BootAnimation.cpp
parentde0dfb7b65a02d4dd74c271b558adee0973fc267 (diff)
downloadframeworks_base-bc7261130a51dc9f3461d3970eee1b923bcbf193.zip
frameworks_base-bc7261130a51dc9f3461d3970eee1b923bcbf193.tar.gz
frameworks_base-bc7261130a51dc9f3461d3970eee1b923bcbf193.tar.bz2
fix [2132563] stuck in boot animation (framebuffer_device_open: Failed to create flip chain)
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r--cmds/bootanimation/BootAnimation.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 99e513c..80c8ee4 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "BootAnimation"
+
#include <stdint.h>
#include <sys/types.h>
#include <math.h>
@@ -58,13 +60,29 @@ BootAnimation::~BootAnimation() {
}
void BootAnimation::onFirstRef() {
- run("BootAnimation", PRIORITY_DISPLAY);
+ status_t err = mSession->linkToComposerDeath(this);
+ LOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
+ if (err != NO_ERROR) {
+ run("BootAnimation", PRIORITY_DISPLAY);
+ }
}
-const sp<SurfaceComposerClient>& BootAnimation::session() const {
+sp<SurfaceComposerClient> BootAnimation::session() const {
return mSession;
}
+
+void BootAnimation::binderDied(const wp<IBinder>& who)
+{
+ // woah, surfaceflinger died!
+ LOGD("SurfaceFlinger died, exiting...");
+
+ // calling requestExit() is not enough here because the Surface code
+ // might be blocked on a condition variable that will never be updated.
+ kill( getpid(), SIGKILL );
+ requestExit();
+}
+
status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets,
const char* name) {
Asset* asset = assets.open(name, Asset::ACCESS_BUFFER);