diff options
author | Mathias Agopian <mathias@google.com> | 2011-07-01 17:08:43 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-07-01 17:09:24 -0700 |
commit | 0c63ef5091def41e91a2202560c57b2f6caabfbe (patch) | |
tree | afd2477bdbd864d00fe5d7c9d8068686b6f11c61 /services/surfaceflinger/SurfaceFlinger.cpp | |
parent | 23b444a2e4e808262c22fa5254db9861eb961879 (diff) | |
download | frameworks_base-0c63ef5091def41e91a2202560c57b2f6caabfbe.zip frameworks_base-0c63ef5091def41e91a2202560c57b2f6caabfbe.tar.gz frameworks_base-0c63ef5091def41e91a2202560c57b2f6caabfbe.tar.bz2 |
don't kill surfaceflinger when system process dies
Change-Id: I2d3ed87b590f9ccea3fa4af41d92911de070b315
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 685613e..d69bff2 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -163,9 +163,34 @@ void SurfaceFlinger::bootFinished() const nsecs_t duration = now - mBootTime; LOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) ); mBootFinished = true; + + // wait patiently for the window manager death + const String16 name("window"); + sp<IBinder> window(defaultServiceManager()->getService(name)); + if (window != 0) { + window->linkToDeath(this); + } + + // stop boot animation property_set("ctl.stop", "bootanim"); } +void SurfaceFlinger::binderDied(const wp<IBinder>& who) +{ + // the window manager died on us. prepare its eulogy. + + // unfreeze the screen in case it was... frozen + mFreezeDisplayTime = 0; + mFreezeCount = 0; + mFreezeDisplay = false; + + // reset screen orientation + setOrientation(0, eOrientationDefault, 0); + + // restart the boot-animation + property_set("ctl.start", "bootanim"); +} + void SurfaceFlinger::onFirstRef() { run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY); |