Re-allow suppressing onDetachedFromWindow

Bug: 17578553

Games seem to be doing this to prevent destruction of their
GL contexts, and they assume it works even if it doesn't. However,
GLSurfaceView is clunky here, so while the app is doing something
questionable we don't really offer a better way. For now revert
back to kitkat behavior.

Change-Id: Icfa9e496279b9cfa47f9bc7f6848d9313caed0d5
This commit is contained in:
John Reck
2014-10-01 10:38:07 -07:00
parent c909e1b2df
commit 77e4a5250f
2 changed files with 4 additions and 6 deletions

View File

@@ -256,9 +256,8 @@ public class SurfaceView extends View {
updateWindow(false, false);
}
/** @hide */
@Override
protected void onDetachedFromWindowInternal() {
protected void onDetachedFromWindow() {
if (mGlobalListenersAdded) {
ViewTreeObserver observer = getViewTreeObserver();
observer.removeOnScrollChangedListener(mScrollChangedListener);
@@ -280,7 +279,7 @@ public class SurfaceView extends View {
mSession = null;
mLayout.token = null;
super.onDetachedFromWindowInternal();
super.onDetachedFromWindow();
}
@Override

View File

@@ -595,9 +595,8 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
mDetached = false;
}
/** @hide */
@Override
protected void onDetachedFromWindowInternal() {
protected void onDetachedFromWindow() {
if (LOG_ATTACH_DETACH) {
Log.d(TAG, "onDetachedFromWindow");
}
@@ -605,7 +604,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
mGLThread.requestExitAndWait();
}
mDetached = true;
super.onDetachedFromWindowInternal();
super.onDetachedFromWindow();
}
// ----------------------------------------------------------------------