Remove Webview Overlays on destroy
When WebViewFunctor is destroyed, overlays needs to be removed.
Bug: 194393522
Test: toggle fullscreen during video playing, and run "adb shell dumpsys
SurfaceFlinger | grep Webview", it should only show onlyi one surface
control
Change-Id: I40d0e503c4f5b25c59886820485e7734716ac859
diff --git a/libs/hwui/WebViewFunctorManager.cpp b/libs/hwui/WebViewFunctorManager.cpp
index df41011..5aad821 100644
--- a/libs/hwui/WebViewFunctorManager.cpp
+++ b/libs/hwui/WebViewFunctorManager.cpp
@@ -100,6 +100,9 @@
destroyContext();
ATRACE_NAME("WebViewFunctor::onDestroy");
+ if (mSurfaceControl) {
+ removeOverlays();
+ }
mCallbacks.onDestroyed(mFunctor, mData);
}