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
(cherry picked from commit 9c5158f7a2)
This commit is contained in:
Huihong Luo
2021-07-23 12:35:59 -07:00
parent 66d5c60581
commit 9107a62bb4

View File

@@ -100,6 +100,9 @@ WebViewFunctor::~WebViewFunctor() {
destroyContext();
ATRACE_NAME("WebViewFunctor::onDestroy");
if (mSurfaceControl) {
removeOverlays();
}
mCallbacks.onDestroyed(mFunctor, mData);
}