Merge "SurfaceView only call forceDisconnect if isValid" into nyc-mr1-dev

This commit is contained in:
TreeHugger Robot
2016-09-30 23:05:46 +00:00
committed by Android (Google) Code Review

View File

@@ -598,9 +598,11 @@ public class SurfaceView extends View {
// surfaceDestroyed and surfaceCreated, we force a disconnect, // surfaceDestroyed and surfaceCreated, we force a disconnect,
// so the next connect will always work if we end up reusing // so the next connect will always work if we end up reusing
// the surface. // the surface.
if (mSurface.isValid()) {
mSurface.forceScopedDisconnect(); mSurface.forceScopedDisconnect();
} }
} }
}
mSurface.transferFrom(mNewSurface); mSurface.transferFrom(mNewSurface);
if (visible && mSurface.isValid()) { if (visible && mSurface.isValid()) {