SurfaceView: Force surface disconnection before reuse.
Prior to N, if a client received the surfaceDestroyed callback from their SurfaceView they could trust that the surface would not be reused. Now that is not true in multiple scenarios. If a client fails to shut down its EGL context then, we could end up in a situation where, the client will never disconnect. Then when we reuse the same underlying IGraphicBufferProducer for surfaceCreated next the app will crash with a double connect error. There is no valid use of the surface inbetween surfaceDestroyed and surfaceCreated, so we just force the disconnection after surfaceDestroyed. Bug: 30236166 Change-Id: I2e3e4b3176492dc0c2d46a59e0b5a781bf9bc356
Loading
Please register or sign in to comment