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

Commit 0bad6c52 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add supplemental split protologs" into main

parents 51dccf92 77bc00c3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
    private SurfaceControlViewHost mViewHost;
    private DividerHandleView mHandle;
    private DividerRoundedCorner mCorners;
    private View mBackground;
    private int mTouchElevation;

    private VelocityTracker mVelocityTracker;
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ public class SplitDecorManager extends WindowlessWindowManager {
                }

                @Override
                public void onAnimationEnd(@androidx.annotation.NonNull Animator animation) {
                public void onAnimationEnd(@NonNull Animator animation) {
                    mRunningAnimationCount--;
                    animT.remove(mScreenshot);
                    animT.apply();
+4 −3
Original line number Diff line number Diff line
@@ -163,14 +163,14 @@ public class RecentTasksController implements TaskStackListenerCallback,
    /**
     * Adds a split pair. This call does not validate the taskIds, only that they are not the same.
     */
    public void addSplitPair(int taskId1, int taskId2, SplitBounds splitBounds) {
    public boolean addSplitPair(int taskId1, int taskId2, SplitBounds splitBounds) {
        if (taskId1 == taskId2) {
            return;
            return false;
        }
        if (mSplitTasks.get(taskId1, INVALID_TASK_ID) == taskId2
                && mTaskSplitBoundsMap.get(taskId1).equals(splitBounds)) {
            // If the two tasks are already paired and the bounds are the same, then skip updating
            return;
            return false;
        }
        // Remove any previous pairs
        removeSplitPair(taskId1);
@@ -185,6 +185,7 @@ public class RecentTasksController implements TaskStackListenerCallback,
        notifyRecentTasksChanged();
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENT_TASKS, "Add split pair: %d, %d, %s",
                taskId1, taskId2, splitBounds);
        return true;
    }

    /**
+7 −0
Original line number Diff line number Diff line
@@ -16,11 +16,14 @@

package com.android.wm.shell.splitscreen;

import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN;

import android.content.Context;
import android.view.SurfaceSession;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;

import com.android.internal.protolog.common.ProtoLog;
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.SyncTransactionQueue;
@@ -50,6 +53,8 @@ class MainStage extends StageTaskListener {

    void activate(WindowContainerTransaction wct, boolean includingTopTask) {
        if (mIsActive) return;
        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "activate: main stage includingTopTask=%b",
                includingTopTask);

        if (includingTopTask) {
            reparentTopTask(wct);
@@ -64,6 +69,8 @@ class MainStage extends StageTaskListener {

    void deactivate(WindowContainerTransaction wct, boolean toTop) {
        if (!mIsActive) return;
        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "deactivate: main stage toTop=%b rootTaskInfo=%s",
                toTop, mRootTaskInfo);
        mIsActive = false;

        if (mRootTaskInfo == null) return;
+7 −0
Original line number Diff line number Diff line
@@ -16,12 +16,15 @@

package com.android.wm.shell.splitscreen;

import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN;

import android.app.ActivityManager;
import android.content.Context;
import android.view.SurfaceSession;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;

import com.android.internal.protolog.common.ProtoLog;
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.SyncTransactionQueue;
@@ -47,6 +50,8 @@ class SideStage extends StageTaskListener {
    }

    boolean removeAllTasks(WindowContainerTransaction wct, boolean toTop) {
        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "remove all side stage tasks: childCount=%d toTop=%b",
                mChildrenTaskInfo.size(), toTop);
        if (mChildrenTaskInfo.size() == 0) return false;
        wct.reparentTasks(
                mRootTaskInfo.token,
@@ -59,6 +64,8 @@ class SideStage extends StageTaskListener {

    boolean removeTask(int taskId, WindowContainerToken newParent, WindowContainerTransaction wct) {
        final ActivityManager.RunningTaskInfo task = mChildrenTaskInfo.get(taskId);
        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "remove side stage task: task=%d exists=%b", taskId,
                task != null);
        if (task == null) return false;
        wct.reparent(task.token, newParent, false /* onTop */);
        return true;
Loading