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

Commit a36bcd53 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

attempt to fix bug 5313580

the working theory here is that a Surface object has become non-promotable
because it lost its last reference; later Surface::readFromParcel is called
the previous surface is found in the cache, but can't be promoted. this causes
a new Surface object to be created which will promptly try to connect to the
CPU_API -- this in turn will fail because the previous (now dead) surface is
still connected.

To fix this, we make sure to disconnect from the SurfaceTexture when
Surface[TextureClient] is destroyed.

Change-Id: I422234868a05d7b7d283e9d5a85f7ab79e65d8a9
parent d858f059
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ public:


protected:
protected:
    SurfaceTextureClient();
    SurfaceTextureClient();
    virtual ~SurfaceTextureClient();
    void setISurfaceTexture(const sp<ISurfaceTexture>& surfaceTexture);
    void setISurfaceTexture(const sp<ISurfaceTexture>& surfaceTexture);


private:
private:
+6 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,12 @@ SurfaceTextureClient::SurfaceTextureClient() {
    SurfaceTextureClient::init();
    SurfaceTextureClient::init();
}
}


SurfaceTextureClient::~SurfaceTextureClient() {
    if (mConnectedToCpu) {
        SurfaceTextureClient::disconnect(NATIVE_WINDOW_API_CPU);
    }
}

void SurfaceTextureClient::init() {
void SurfaceTextureClient::init() {
    // Initialize the ANativeWindow function pointers.
    // Initialize the ANativeWindow function pointers.
    ANativeWindow::setSwapInterval  = hook_setSwapInterval;
    ANativeWindow::setSwapInterval  = hook_setSwapInterval;