Merge "don't kill surfaceflinger when system process dies"
This commit is contained in:
commit
7e918860f9
@ -103,6 +103,11 @@ void DisplayHardware::init(uint32_t dpy)
|
|||||||
{
|
{
|
||||||
mNativeWindow = new FramebufferNativeWindow();
|
mNativeWindow = new FramebufferNativeWindow();
|
||||||
framebuffer_device_t const * fbDev = mNativeWindow->getDevice();
|
framebuffer_device_t const * fbDev = mNativeWindow->getDevice();
|
||||||
|
if (!fbDev) {
|
||||||
|
LOGE("Display subsystem failed to initialize. check logs. exiting...");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
mDpiX = mNativeWindow->xdpi;
|
mDpiX = mNativeWindow->xdpi;
|
||||||
mDpiY = mNativeWindow->ydpi;
|
mDpiY = mNativeWindow->ydpi;
|
||||||
mRefreshRate = fbDev->fps;
|
mRefreshRate = fbDev->fps;
|
||||||
|
@ -163,9 +163,34 @@ void SurfaceFlinger::bootFinished()
|
|||||||
const nsecs_t duration = now - mBootTime;
|
const nsecs_t duration = now - mBootTime;
|
||||||
LOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) );
|
LOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) );
|
||||||
mBootFinished = true;
|
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");
|
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()
|
void SurfaceFlinger::onFirstRef()
|
||||||
{
|
{
|
||||||
run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY);
|
run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY);
|
||||||
|
@ -147,6 +147,7 @@ enum {
|
|||||||
class SurfaceFlinger :
|
class SurfaceFlinger :
|
||||||
public BinderService<SurfaceFlinger>,
|
public BinderService<SurfaceFlinger>,
|
||||||
public BnSurfaceComposer,
|
public BnSurfaceComposer,
|
||||||
|
public IBinder::DeathRecipient,
|
||||||
protected Thread
|
protected Thread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -192,6 +193,10 @@ public:
|
|||||||
|
|
||||||
sp<Layer> getLayer(const sp<ISurface>& sur) const;
|
sp<Layer> getLayer(const sp<ISurface>& sur) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// DeathRecipient interface
|
||||||
|
virtual void binderDied(const wp<IBinder>& who);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Client;
|
friend class Client;
|
||||||
friend class LayerBase;
|
friend class LayerBase;
|
||||||
|
Loading…
Reference in New Issue
Block a user