SurfaceView only call forceDisconnect if isValid

am: 6ba466ff3e

Change-Id: I890142436b2442cced212550ac916bedf1306bc9
This commit is contained in:
John Reck
2016-09-30 23:15:04 +00:00
committed by android-build-merger

View File

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