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

Commit 349a3384 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Fixes incorrect task bounds while moving a split-screen task to desk" into main

parents a87c9b41 a2eb0a98
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -1238,7 +1238,7 @@ class Task extends TaskFragment {
        mRootWindowContainer.updateUIDsPresentOnDisplay();
    }

    private boolean isOverrideBoundsAllowed() {
    boolean isOverrideBoundsAllowed() {
        Task parentTask = getParent() != null ? getParent().asTask() : null;
        while (parentTask != null) {
            if (parentTask.mDisallowOverrideBoundsForChildren) {
@@ -2177,16 +2177,6 @@ class Task extends TaskFragment {
        }
    }

    @Override
    public void onRequestedOverrideConfigurationChanged(
            @NonNull Configuration overrideConfiguration) {
        if (!overrideConfiguration.windowConfiguration.getBounds().isEmpty()
                && !isOverrideBoundsAllowed()) {
            overrideConfiguration.windowConfiguration.setBounds(new Rect());
        }
        super.onRequestedOverrideConfigurationChanged(overrideConfiguration);
    }

    @Override
    public void onConfigurationChanged(Configuration newParentConfig) {
        if (mDisplayContent != null
+6 −1
Original line number Diff line number Diff line
@@ -2375,6 +2375,12 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        mTmpBounds.set(getResolvedOverrideConfiguration().windowConfiguration.getBounds());
        super.resolveOverrideConfiguration(newParentConfig);
        final Configuration resolvedConfig = getResolvedOverrideConfiguration();
        final Task thisTask = asTask();
        if (!resolvedConfig.windowConfiguration.getBounds().isEmpty() && thisTask != null
                && !thisTask.isOverrideBoundsAllowed()) {
            // clear the bounds if it is not allowed from its ancestors.
            resolvedConfig.windowConfiguration.setBounds(new Rect());
        }

        if (mRelativeEmbeddedBounds != null && !mRelativeEmbeddedBounds.isEmpty()) {
            // For embedded TaskFragment, make sure the bounds is set based on the relative bounds.
@@ -2402,7 +2408,6 @@ class TaskFragment extends WindowContainer<WindowContainer> {
            }
        }

        final Task thisTask = asTask();
        if (thisTask != null) {
            thisTask.resolveLeafTaskOnlyOverrideConfigs(newParentConfig,
                    mTmpBounds /* previousBounds */);