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

Commit 4ed38014 authored by Andrii Kulian's avatar Andrii Kulian Committed by Automerger Merge Worker
Browse files

Merge "3/n Refactor TaskContainers to TaskDisplayArea" into rvc-dev am: 886d2cf0 am: 86447d46

Change-Id: Ic1e8cfbd87784eeb07376cf8fab8c0bc43680e75
parents c9066858 86447d46
Loading
Loading
Loading
Loading
+18 −30
Original line number Original line Diff line number Diff line
@@ -301,12 +301,6 @@
      "group": "WM_DEBUG_ADD_REMOVE",
      "group": "WM_DEBUG_ADD_REMOVE",
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
    },
    },
    "-1455600136": {
      "message": "Attempted to add Dream window with unknown token %s.  Aborting.",
      "level": "WARN",
      "group": "WM_ERROR",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "-1443029505": {
    "-1443029505": {
      "message": "SAFE MODE ENABLED (menu=%d s=%d dpad=%d trackball=%d)",
      "message": "SAFE MODE ENABLED (menu=%d s=%d dpad=%d trackball=%d)",
      "level": "INFO",
      "level": "INFO",
@@ -385,12 +379,6 @@
      "group": "WM_DEBUG_RESIZE",
      "group": "WM_DEBUG_RESIZE",
      "at": "com\/android\/server\/wm\/WindowState.java"
      "at": "com\/android\/server\/wm\/WindowState.java"
    },
    },
    "-1263554915": {
      "message": "Attempted to add Dream window with bad token %s.  Aborting.",
      "level": "WARN",
      "group": "WM_ERROR",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "-1263316010": {
    "-1263316010": {
      "message": "Computed rotation=%s (%d) for display id=%d based on lastOrientation=%s (%d) and oldRotation=%s (%d)",
      "message": "Computed rotation=%s (%d) for display id=%d based on lastOrientation=%s (%d) and oldRotation=%s (%d)",
      "level": "VERBOSE",
      "level": "VERBOSE",
@@ -541,12 +529,6 @@
      "group": "WM_DEBUG_APP_TRANSITIONS",
      "group": "WM_DEBUG_APP_TRANSITIONS",
      "at": "com\/android\/server\/wm\/AppTransitionController.java"
      "at": "com\/android\/server\/wm\/AppTransitionController.java"
    },
    },
    "-993446393": {
      "message": "App is requesting an orientation, return %d for display id=%d",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/TaskContainers.java"
    },
    "-993378225": {
    "-993378225": {
      "message": "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING %s in %s",
      "message": "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING %s in %s",
      "level": "VERBOSE",
      "level": "VERBOSE",
@@ -967,6 +949,12 @@
      "group": "WM_SHOW_TRANSACTIONS",
      "group": "WM_SHOW_TRANSACTIONS",
      "at": "com\/android\/server\/wm\/Session.java"
      "at": "com\/android\/server\/wm\/Session.java"
    },
    },
    "-49129622": {
      "message": "performLayout: Activity exiting now removed %s",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ADD_REMOVE",
      "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
    },
    "-33096143": {
    "-33096143": {
      "message": "applyAnimation: transition animation is disabled or skipped. container=%s",
      "message": "applyAnimation: transition animation is disabled or skipped. container=%s",
      "level": "VERBOSE",
      "level": "VERBOSE",
@@ -1075,12 +1063,6 @@
      "group": "WM_SHOW_TRANSACTIONS",
      "group": "WM_SHOW_TRANSACTIONS",
      "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
      "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
    },
    },
    "137835146": {
      "message": "No app is requesting an orientation, return %d for display id=%d",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/TaskContainers.java"
    },
    "140319294": {
    "140319294": {
      "message": "IME target changed within ActivityRecord",
      "message": "IME target changed within ActivityRecord",
      "level": "DEBUG",
      "level": "DEBUG",
@@ -1723,6 +1705,12 @@
      "group": "WM_DEBUG_IME",
      "group": "WM_DEBUG_IME",
      "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
      "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
    },
    },
    "1381227466": {
      "message": "App is requesting an orientation, return %d for display id=%d",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
    },
    "1389009035": {
    "1389009035": {
      "message": "NonAppWindowContainer cannot set orientation: %s",
      "message": "NonAppWindowContainer cannot set orientation: %s",
      "level": "WARN",
      "level": "WARN",
@@ -1891,6 +1879,12 @@
      "group": "WM_DEBUG_RESIZE",
      "group": "WM_DEBUG_RESIZE",
      "at": "com\/android\/server\/wm\/WindowState.java"
      "at": "com\/android\/server\/wm\/WindowState.java"
    },
    },
    "1640436199": {
      "message": "No app is requesting an orientation, return %d for display id=%d",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
    },
    "1653210583": {
    "1653210583": {
      "message": "Removing app %s delayed=%b animation=%s animating=%b",
      "message": "Removing app %s delayed=%b animation=%s animating=%b",
      "level": "VERBOSE",
      "level": "VERBOSE",
@@ -1915,12 +1909,6 @@
      "group": "WM_DEBUG_STARTING_WINDOW",
      "group": "WM_DEBUG_STARTING_WINDOW",
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
    },
    },
    "1685441447": {
      "message": "performLayout: Activity exiting now removed %s",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ADD_REMOVE",
      "at": "com\/android\/server\/wm\/TaskContainers.java"
    },
    "1720229827": {
    "1720229827": {
      "message": "Creating animation bounds layer",
      "message": "Creating animation bounds layer",
      "level": "INFO",
      "level": "INFO",
+18 −12
Original line number Original line Diff line number Diff line
@@ -2078,6 +2078,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return stack != null ? stack.getDisplay() : null;
        return stack != null ? stack.getDisplay() : null;
    }
    }


    @Override
    @Nullable
    TaskDisplayArea getDisplayArea() {
        return (TaskDisplayArea) super.getDisplayArea();
    }

    @Override
    @Override
    boolean fillsParent() {
    boolean fillsParent() {
        return occludesParent();
        return occludesParent();
@@ -2232,8 +2238,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        boolean isKeyguardLocked = mAtmService.isKeyguardLocked();
        boolean isKeyguardLocked = mAtmService.isKeyguardLocked();
        boolean isCurrentAppLocked =
        boolean isCurrentAppLocked =
                mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE;
                mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE;
        final DisplayContent display = getDisplay();
        final TaskDisplayArea taskDisplayArea = getDisplayArea();
        boolean hasPinnedStack = display != null && display.hasPinnedTask();
        boolean hasPinnedStack = taskDisplayArea != null && taskDisplayArea.hasPinnedTask();
        // Don't return early if !isNotLocked, since we want to throw an exception if the activity
        // Don't return early if !isNotLocked, since we want to throw an exception if the activity
        // is in an incorrect state
        // is in an incorrect state
        boolean isNotLockedOrOnKeyguard = !isKeyguardLocked && !isCurrentAppLocked;
        boolean isNotLockedOrOnKeyguard = !isKeyguardLocked && !isCurrentAppLocked;
@@ -2500,11 +2506,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    // and focused application if needed.
                    // and focused application if needed.
                    stack.adjustFocusToNextFocusableStack("finish-top");
                    stack.adjustFocusToNextFocusableStack("finish-top");
                } else {
                } else {
                    // Only move the next stack to top in its display.
                    // Only move the next stack to top in its task container.
                    final DisplayContent display = stack.getDisplay();
                    final TaskDisplayArea taskDisplayArea = stack.getDisplayArea();
                    next = display.topRunningActivity();
                    next = taskDisplayArea.topRunningActivity();
                    if (next != null) {
                    if (next != null) {
                        display.mTaskContainers.positionStackAtTop(next.getRootTask(),
                        taskDisplayArea.positionStackAtTop(next.getRootTask(),
                                false /* includingParents */, "finish-display-top");
                                false /* includingParents */, "finish-display-top");
                    }
                    }
                }
                }
@@ -2634,7 +2640,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Note that if this finishing activity is floating task, we don't need to wait the
        // Note that if this finishing activity is floating task, we don't need to wait the
        // next activity resume and can destroy it directly.
        // next activity resume and can destroy it directly.
        // TODO(b/137329632): find the next activity directly underneath this one, not just anywhere
        // TODO(b/137329632): find the next activity directly underneath this one, not just anywhere
        final ActivityRecord next = getDisplay().topRunningActivity(
        final ActivityRecord next = getDisplayArea().topRunningActivity(
                true /* considerKeyguardState */);
                true /* considerKeyguardState */);
        // isNextNotYetVisible is to check if the next activity is invisible, or it has been
        // isNextNotYetVisible is to check if the next activity is invisible, or it has been
        // requested to be invisible but its windows haven't reported as invisible.  If so, it
        // requested to be invisible but its windows haven't reported as invisible.  If so, it
@@ -2673,13 +2679,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        mStackSupervisor.mStoppingActivities.remove(this);
        mStackSupervisor.mStoppingActivities.remove(this);


        final ActivityStack stack = getRootTask();
        final ActivityStack stack = getRootTask();
        final DisplayContent display = getDisplay();
        final TaskDisplayArea taskDisplayArea = getDisplayArea();
        // TODO(b/137329632): Exclude current activity when looking for the next one with
        // TODO(b/137329632): Exclude current activity when looking for the next one with
        // DisplayContent#topRunningActivity().
        // DisplayContent#topRunningActivity().
        final ActivityRecord next = display.topRunningActivity();
        final ActivityRecord next = taskDisplayArea.topRunningActivity();
        final boolean isLastStackOverEmptyHome =
        final boolean isLastStackOverEmptyHome =
                next == null && stack.isFocusedStackOnDisplay()
                next == null && stack.isFocusedStackOnDisplay()
                        && display.mTaskContainers.getOrCreateRootHomeTask() != null;
                        && taskDisplayArea.getOrCreateRootHomeTask() != null;
        if (isLastStackOverEmptyHome) {
        if (isLastStackOverEmptyHome) {
            // Don't destroy activity immediately if this is the last activity on the display and
            // Don't destroy activity immediately if this is the last activity on the display and
            // the display contains home stack. Although there is no next activity at the moment,
            // the display contains home stack. Although there is no next activity at the moment,
@@ -4477,7 +4483,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // case where this is the top activity in a pinned stack.
        // case where this is the top activity in a pinned stack.
        final boolean isTop = this == stack.getTopNonFinishingActivity();
        final boolean isTop = this == stack.getTopNonFinishingActivity();
        final boolean isTopNotPinnedStack = stack.isAttached()
        final boolean isTopNotPinnedStack = stack.isAttached()
                && stack.getDisplay().mTaskContainers.isTopNotPinnedStack(stack);
                && stack.getDisplayArea().isTopNotPinnedStack(stack);
        final boolean visibleIgnoringDisplayStatus = stack.checkKeyguardVisibility(this,
        final boolean visibleIgnoringDisplayStatus = stack.checkKeyguardVisibility(this,
                visibleIgnoringKeyguard, isTop && isTopNotPinnedStack);
                visibleIgnoringKeyguard, isTop && isTopNotPinnedStack);


@@ -5194,7 +5200,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // The activity may have been requested to be invisible (another activity has been launched)
        // The activity may have been requested to be invisible (another activity has been launched)
        // so there is no valid info. But if it is the current top activity (e.g. sleeping), the
        // so there is no valid info. But if it is the current top activity (e.g. sleeping), the
        // invalid state is still reported to make sure the waiting result is notified.
        // invalid state is still reported to make sure the waiting result is notified.
        if (validInfo || this == mDisplayContent.topRunningActivity()) {
        if (validInfo || this == getDisplayArea().topRunningActivity()) {
            mStackSupervisor.reportActivityLaunchedLocked(false /* timeout */, this,
            mStackSupervisor.reportActivityLaunchedLocked(false /* timeout */, this,
                    windowsDrawnDelayMs, launchState);
                    windowsDrawnDelayMs, launchState);
            mStackSupervisor.stopWaitingForActivityVisible(this, windowsDrawnDelayMs);
            mStackSupervisor.stopWaitingForActivityVisible(this, windowsDrawnDelayMs);
+50 −67

File changed.

Preview size limit exceeded, changes collapsed.

+7 −7
Original line number Original line Diff line number Diff line
@@ -1788,7 +1788,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
            if (prevStack != null) {
            if (prevStack != null) {
                return prevStack;
                return prevStack;
            }
            }
            stack = stack.getDisplay().createStack(
            stack = stack.getDisplayArea().createStack(
                    WINDOWING_MODE_FULLSCREEN, stack.getActivityType(), toTop);
                    WINDOWING_MODE_FULLSCREEN, stack.getActivityType(), toTop);
        }
        }
        return stack;
        return stack;
@@ -1878,7 +1878,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        mStoppingActivities.remove(r);
        mStoppingActivities.remove(r);


        final ActivityStack stack = r.getRootTask();
        final ActivityStack stack = r.getRootTask();
        if (stack.getDisplay().mTaskContainers.allResumedActivitiesComplete()) {
        if (stack.getDisplayArea().allResumedActivitiesComplete()) {
            mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
            mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
            // Make sure activity & window visibility should be identical
            // Make sure activity & window visibility should be identical
            // for all displays in this stage.
            // for all displays in this stage.
@@ -2242,7 +2242,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        final boolean isSecondaryDisplayPreferred =
        final boolean isSecondaryDisplayPreferred =
                (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY);
                (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY);
        final boolean inSplitScreenMode = actualStack != null
        final boolean inSplitScreenMode = actualStack != null
                && actualStack.getDisplay().mTaskContainers.isSplitScreenModeActivated();
                && actualStack.getDisplayArea().isSplitScreenModeActivated();
        if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)
        if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)
                && !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) {
                && !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) {
            return;
            return;
@@ -2289,14 +2289,14 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        if (!task.supportsSplitScreenWindowingMode() || forceNonResizable) {
        if (!task.supportsSplitScreenWindowingMode() || forceNonResizable) {
            // Dismiss docked stack. If task appeared to be in docked stack but is not resizable -
            // Dismiss docked stack. If task appeared to be in docked stack but is not resizable -
            // we need to move it to top of fullscreen stack, otherwise it will be covered.
            // we need to move it to top of fullscreen stack, otherwise it will be covered.
            final DisplayContent display = task.getStack().getDisplay();
            final TaskDisplayArea taskDisplayArea = task.getDisplayArea();
            if (display.mTaskContainers.isSplitScreenModeActivated()) {
            if (taskDisplayArea.isSplitScreenModeActivated()) {
                // Display a warning toast that we tried to put an app that doesn't support
                // Display a warning toast that we tried to put an app that doesn't support
                // split-screen in split-screen.
                // split-screen in split-screen.
                mService.getTaskChangeNotificationController()
                mService.getTaskChangeNotificationController()
                        .notifyActivityDismissingDockedStack();
                        .notifyActivityDismissingDockedStack();
                display.mTaskContainers.onSplitScreenModeDismissed();
                taskDisplayArea.onSplitScreenModeDismissed();
                display.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS,
                taskDisplayArea.mDisplayContent.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS,
                        true /* notifyClients */);
                        true /* notifyClients */);
            }
            }
            return;
            return;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1390,7 +1390,7 @@ class ActivityStarter {
            // The activity was already running so it wasn't started, but either brought to the
            // The activity was already running so it wasn't started, but either brought to the
            // front or the new intent was delivered to it since it was already in front. Notify
            // front or the new intent was delivered to it since it was already in front. Notify
            // anyone interested in this piece of information.
            // anyone interested in this piece of information.
            final ActivityStack homeStack = targetTask.getDisplayContent().getRootHomeTask();
            final ActivityStack homeStack = targetTask.getDisplayArea().getRootHomeTask();
            final boolean homeTaskVisible = homeStack != null && homeStack.shouldBeVisible(null);
            final boolean homeTaskVisible = homeStack != null && homeStack.shouldBeVisible(null);
            mService.getTaskChangeNotificationController().notifyActivityRestartAttempt(
            mService.getTaskChangeNotificationController().notifyActivityRestartAttempt(
                    targetTask.getTaskInfo(), homeTaskVisible, clearedTask);
                    targetTask.getTaskInfo(), homeTaskVisible, clearedTask);
Loading