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

Commit 30a5aa00 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove inSplitScreen function" into tm-dev am: 76ebae0c

parents 5cdd3ce8 76ebae0c
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.wm;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
import static android.view.RemoteAnimationTarget.MODE_OPENING;
import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
@@ -602,22 +601,12 @@ public class RecentsAnimationController implements DeathRecipient {
                || mDisplayContent.getAsyncRotationController() != null) {
            return;
        }
        boolean shouldTranslateNavBar = false;
        final boolean isDisplayLandscape =
                mDisplayContent.getConfiguration().orientation == ORIENTATION_LANDSCAPE;
        for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
            final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
            final Task task = adapter.mTask;
            final TaskFragment adjacentTask = task.getRootTask().getAdjacentTaskFragment();
            final boolean inSplitScreen = task.inSplitScreen();
            if (task.isActivityTypeHomeOrRecents()
                    // Skip if the task is in split screen and in landscape.
                    || (inSplitScreen && isDisplayLandscape)
                    // Skip if the task is the top task in split screen.
                    || (inSplitScreen && task.getBounds().top < adjacentTask.getBounds().top)) {
            if (task.isActivityTypeHomeOrRecents()) {
                continue;
            }
            shouldTranslateNavBar = inSplitScreen;
            mNavBarAttachedApp = task.getTopVisibleActivity();
            break;
        }
@@ -630,9 +619,7 @@ public class RecentsAnimationController implements DeathRecipient {
        navWindow.mToken.cancelAnimation();
        final SurfaceControl.Transaction t = navWindow.mToken.getPendingTransaction();
        final SurfaceControl navSurfaceControl = navWindow.mToken.getSurfaceControl();
        if (shouldTranslateNavBar) {
        navWindow.setSurfaceTranslationY(-mNavBarAttachedApp.getBounds().top);
        }
        t.reparent(navSurfaceControl, mNavBarAttachedApp.getSurfaceControl());
        t.show(navSurfaceControl);

+0 −8
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.app.WindowConfiguration.activityTypeToString;
@@ -1720,13 +1719,6 @@ class Task extends TaskFragment {
                && (topTask == null || topTask.supportsSplitScreenWindowingModeInner(tda));
    }

    /** Returns {@code true} if this task is currently in split-screen. */
    boolean inSplitScreen() {
        return getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW
                && getCreatedByOrganizerTask() != null
                && getCreatedByOrganizerTask().getAdjacentTaskFragment() != null;
    }

    private boolean supportsSplitScreenWindowingModeInner(@Nullable TaskDisplayArea tda) {
        return super.supportsSplitScreenWindowingMode()
                && mAtmService.mSupportsSplitScreenMultiWindow
+13 −12
Original line number Diff line number Diff line
@@ -1163,20 +1163,21 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
            }
        }

        // For a better split UX, If a task is launching from a created-by-organizer task, it should
        // be launched into the same created-by-organizer task as well. Unless, the candidate task
        // is already positioned in the split.
        Task preferredRootInSplit = sourceTask != null && sourceTask.inSplitScreen()
                ? sourceTask.getCreatedByOrganizerTask() : null;
        if (preferredRootInSplit != null) {
        // If a task is launching from a created-by-organizer task, it should be launched into the
        // same created-by-organizer task as well. Unless, the candidate task is already positioned
        // in the another adjacent task.
        if (sourceTask != null) {
            Task launchTarget = sourceTask.getCreatedByOrganizerTask();
            if (launchTarget != null && launchTarget.getAdjacentTaskFragment() != null) {
                if (candidateTask != null) {
                    final Task candidateRoot = candidateTask.getCreatedByOrganizerTask();
                if (candidateRoot != null && candidateRoot != preferredRootInSplit
                        && preferredRootInSplit == candidateRoot.getAdjacentTaskFragment()) {
                    preferredRootInSplit = candidateRoot;
                    if (candidateRoot != null && candidateRoot != launchTarget
                            && launchTarget == candidateRoot.getAdjacentTaskFragment()) {
                        launchTarget = candidateRoot;
                    }
                }
            return preferredRootInSplit;
                return launchTarget;
            }
        }

        return null;
+1 −3
Original line number Diff line number Diff line
@@ -3639,13 +3639,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final int requested = mLastRequestedExclusionHeight[side];
        final int granted = mLastGrantedExclusionHeight[side];

        final boolean inSplitScreen = getTask() != null && getTask().inSplitScreen();

        FrameworkStatsLog.write(FrameworkStatsLog.EXCLUSION_RECT_STATE_CHANGED,
                mAttrs.packageName, requested, requested - granted /* rejected */,
                side + 1 /* Sides are 1-indexed in atoms.proto */,
                (getConfiguration().orientation == ORIENTATION_LANDSCAPE),
                inSplitScreen, (int) duration);
                false /* (deprecated param) inSplitscreen */, (int) duration);
    }

    private void initExclusionRestrictions() {