Don't call surfaceCreated for just changed surfaces

Fixes: 29223302

If the surface only changed we want to just call onSurfaceChanged,
not onSurfaceCreated.

Change-Id: I65c8b210a7e34eaa2862020335ee7f6ef56eeac2
This commit is contained in:
John Reck
2016-06-09 16:26:21 -07:00
parent 9b5a780722
commit 208c47cfb0

View File

@@ -1938,7 +1938,7 @@ public final class ViewRootImpl implements ViewParent,
mSurfaceHolder.setSurfaceFrameSize(mWidth, mHeight);
mSurfaceHolder.mSurfaceLock.unlock();
if (mSurface.isValid()) {
if (!hadSurface || surfaceGenerationId != mSurface.getGenerationId()) {
if (!hadSurface) {
mSurfaceHolder.ungetCallbacks();
mIsCreating = true;
@@ -1951,7 +1951,7 @@ public final class ViewRootImpl implements ViewParent,
}
surfaceChanged = true;
}
if (surfaceChanged) {
if (surfaceChanged || surfaceGenerationId != mSurface.getGenerationId()) {
mSurfaceHolderCallback.surfaceChanged(mSurfaceHolder,
lp.format, mWidth, mHeight);
SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks();