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

Commit 9a535ee8 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Fix ActivityOption#setTaskOverlay can be covered by other activity." into sc-dev

parents fb127be7 dec66365
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -8243,6 +8243,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return mTaskOverlay;
    }

    @Override
    public boolean isAlwaysOnTop() {
        return mTaskOverlay || super.isAlwaysOnTop();
    }

    @Override
    boolean showToCurrentUser() {
        return mShowForAllUsers || mWmService.isCurrentProfile(mUserId);
+5 −2
Original line number Diff line number Diff line
@@ -3152,11 +3152,14 @@ class Task extends WindowContainer<WindowContainer> {

        // Figure-out min/max possible position depending on if child can show for current user.
        int minPosition = (canShowChild) ? computeMinUserPosition(0, size) : 0;
        int maxPosition = (canShowChild) ? size : computeMaxUserPosition(size - 1);
        int maxPosition = (canShowChild) ? size - 1 : computeMaxUserPosition(size - 1);
        if (!hasChild(wc)) {
            // Increase the maxPosition because children size will grow once wc is added.
            ++maxPosition;
        }

        // Factor in always-on-top children in max possible position.
        if (!wc.isAlwaysOnTop()) {

            // We want to place all non-always-on-top containers below always-on-top ones.
            while (maxPosition > minPosition) {
                if (!mChildren.get(maxPosition - 1).isAlwaysOnTop()) break;