Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9020c073 authored by Evan Rosky's avatar Evan Rosky
Browse files

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
parent 485df208
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -425,6 +425,12 @@ public final class SurfaceControl implements Parcelable {
     */
    public static final int METADATA_WINDOW_TYPE = 2;

    /**
     * Task id to allow association between surfaces and task.
     * @hide
     */
    public static final int METADATA_TASK_ID = 3;

    /**
     * Builder class for {@link SurfaceControl} objects.
     */
+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_PORTRA
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 @@ class Task extends WindowContainer<AppWindowToken> implements ConfigurationConta
        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) {