Add task-id to the task-level surface
This can be used by alternate front-ends to associate
surfaces with tasks.
Bug: 122925737
Test: phone boots and surfaces still fling
Change-Id: Ic4cdd9742aa987c59f472b9db78b3c0eb6183e9a
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index a7dd55b..476bd6e 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -22,6 +22,7 @@
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
import static android.content.res.Configuration.EMPTY;
+import static android.view.SurfaceControl.METADATA_TASK_ID;
import static com.android.server.EventLogTags.WM_TASK_REMOVED;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER;
@@ -643,6 +644,11 @@
return getAppAnimationLayer(ANIMATION_LAYER_HOME);
}
+ @Override
+ SurfaceControl.Builder makeSurface() {
+ return super.makeSurface().setMetadata(METADATA_TASK_ID, mTaskId);
+ }
+
boolean isTaskAnimating() {
final RecentsAnimationController recentsAnim = mWmService.getRecentsAnimationController();
if (recentsAnim != null) {