From 9107a62bb42d25994cda871d3206969805a32a25 Mon Sep 17 00:00:00 2001 From: Huihong Luo Date: Fri, 23 Jul 2021 12:35:59 -0700 Subject: [PATCH] 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 9c5158f7a2f3bff0ccfc8e071143aac7b5c95049) --- libs/hwui/WebViewFunctorManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/hwui/WebViewFunctorManager.cpp b/libs/hwui/WebViewFunctorManager.cpp index df4101109a18d..5aad821ad59ff 100644 --- a/libs/hwui/WebViewFunctorManager.cpp +++ b/libs/hwui/WebViewFunctorManager.cpp @@ -100,6 +100,9 @@ WebViewFunctor::~WebViewFunctor() { destroyContext(); ATRACE_NAME("WebViewFunctor::onDestroy"); + if (mSurfaceControl) { + removeOverlays(); + } mCallbacks.onDestroyed(mFunctor, mData); }