summaryrefslogtreecommitdiff
path: root/core/java/android/window/TaskOrganizer.java
diff options
context:
space:
mode:
authorVadim Caen <caen@google.com>2021-05-31 17:20:45 +0200
committerVadim Caen <caen@google.com>2021-06-15 15:39:09 +0200
commita46ff113be1c3f2105c4ebb7dbe2e1390ea6c70c (patch)
tree3ac79085e75f33e2b3a3aceae43d79413d999723 /core/java/android/window/TaskOrganizer.java
parent5829bd558ac39c73f2059b6e1ee542de6d6a115f (diff)
Release the SurfacePackageViewHost on splash screen removed
The SurfacePackageViewHost was never release, leading to a leak of its surfaces. This CL ensure it is released: - Directly in the shell if the SplashScreenView was not copied - From the client, through the window manger and then to the shell if the splash screen was copied in the client process Test: Manually tested with app setting by checking if the surfaces are actually removed (winscope + logs) in the following scenarios: - When the application registers an OnExitAnimationListener and calls remove(), - When the application registers an OnExitAnimationListener and dies without calling remove() - When the applicaiton does not register an OnExitAnimationListener and the shell removes the splash screen Bug: 189759180 Change-Id: Ib68bfffad6720911368739d7dd87d8a03034c589
Diffstat (limited to 'core/java/android/window/TaskOrganizer.java')
-rw-r--r--core/java/android/window/TaskOrganizer.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/window/TaskOrganizer.java b/core/java/android/window/TaskOrganizer.java
index 3340cf4fb707..73995491668a 100644
--- a/core/java/android/window/TaskOrganizer.java
+++ b/core/java/android/window/TaskOrganizer.java
@@ -117,6 +117,16 @@ public class TaskOrganizer extends WindowOrganizer {
public void copySplashScreenView(int taskId) {}
/**
+ * Notify the shell ({@link com.android.wm.shell.ShellTaskOrganizer} that the client has
+ * removed the splash screen view.
+ * @see com.android.wm.shell.ShellTaskOrganizer#onAppSplashScreenViewRemoved(int)
+ * @see SplashScreenView#remove()
+ */
+ @BinderThread
+ public void onAppSplashScreenViewRemoved(int taskId) {
+ }
+
+ /**
* Called when a task with the registered windowing mode can be controlled by this task
* organizer. For non-root tasks, the leash may initially be hidden so it is up to the organizer
* to show this task.
@@ -236,11 +246,16 @@ public class TaskOrganizer extends WindowOrganizer {
}
@Override
- public void copySplashScreenView(int taskId) {
+ public void copySplashScreenView(int taskId) {
mExecutor.execute(() -> TaskOrganizer.this.copySplashScreenView(taskId));
}
@Override
+ public void onAppSplashScreenViewRemoved(int taskId) {
+ mExecutor.execute(() -> TaskOrganizer.this.onAppSplashScreenViewRemoved(taskId));
+ }
+
+ @Override
public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
mExecutor.execute(() -> TaskOrganizer.this.onTaskAppeared(taskInfo, leash));
}