summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchuanghua.zhao <chuanghua.zhao@mediatek.com>2023-12-22 13:04:41 +0800
committerchuanghua.zhao <chuanghua.zhao@mediatek.com>2023-12-22 13:04:41 +0800
commit5a6161d928dd26307e1797db4959b446c166d935 (patch)
tree1566627d585ab404636358a38fe27e567709aabf
parentaa5a0600932bda6f0f3a9f7c3483705e3abd0244 (diff)
downloadLauncher3-5a6161d928dd26307e1797db4959b446c166d935.tar.gz
Fix launcher holds a surfaceController
When the dark night mode switch is triggered,systemui calls binder to the onNavigationBarSurface method in the launcher and applies the surfaceController. Keep switching,you will keep applying,resulting in more surface objects. The behaviour would cause that SurfaceFlinger couldn't remove the unnecessary navigationbar layers timely and the navigationbar layer would leak in SF. Actively release the SC after using the SC in the launcher. Bug: 317336417 Test: 1.Launch the settings app 2.Click Display menu 3.click the dark theme menu multiple times 4.Check whether the surfaceController is released adb shell "ls -l/proc/904/fd|wc -l" Change-Id: Ic449de9dbe0c52e0053be91e67ee9081a574581b
-rw-r--r--quickstep/src/com/android/quickstep/TouchInteractionService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 5baf6d43bd..80682949cf 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -301,6 +301,10 @@ public class TouchInteractionService extends Service {
@Override
public void onNavigationBarSurface(SurfaceControl surface) {
// TODO: implement
+ if (surface != null) {
+ surface.release();
+ surface = null;
+ }
}
@BinderThread