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

Commit af558e14 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix issues with docked stack not un-minimizing

- Add minimize state to dump
- If the docked app goes through a configuration change while the
docked stack is minimizing, the window list becomes temporarily empty,
and thus Task.isVisibleForCurrentUserLocked == false. Since we already
check at the beginning of the animation, we need to finish the minimize
animation on the docked stack no matter what happens.
- Adjust the condition when to notify divider controller about app
visibility. It turns out that under some conditions an animation is set,
but the app is not an element of mClosingApps nor mOpeningApps, so we
missed the visibility change of the home task
- Use getTopAppToken instead of getTopVisibleAppToken. When the token is
about to hide, it's already hiddenRequested, so we skipped changing the
minimize adjustment.

Change-Id: Ib9e2e3f6a5da7b7854b49857299a236e47baa6fc
Fixes: 28184044
parent 1793d476
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ public class DockedStackDividerController implements DimLayerUser {

        // If the app that having visibility change is not the top visible one in the task,
        // it does not affect whether the docked stack is minimized, ignore it.
        if (task.getTopVisibleAppToken() == null || task.getTopVisibleAppToken() != wtoken) {
        if (task.getTopAppToken() == null || task.getTopAppToken() != wtoken) {
            return;
        }

@@ -598,7 +598,7 @@ public class DockedStackDividerController implements DimLayerUser {
    }

    private boolean animateForMinimizedDockedStack(long now) {
        final TaskStack stack = mDisplayContent.getDockedStackVisibleForUserLocked();
        final TaskStack stack = mService.mStackIdToStack.get(DOCKED_STACK_ID);
        if (!mAnimationStarted) {
            mAnimationStarted = true;
            mAnimationStartTime = now;
+4 −0
Original line number Diff line number Diff line
@@ -719,6 +719,10 @@ class Task implements DimLayer.DimLayerUser {
        return null;
    }

    AppWindowToken getTopAppToken() {
        return mAppTokens.size() > 0 ? mAppTokens.get(mAppTokens.size() - 1) : null;
    }

    @Override
    public boolean isFullscreen() {
        if (useCurrentBounds()) {
+8 −0
Original line number Diff line number Diff line
@@ -1098,6 +1098,14 @@ public class TaskStack implements DimLayer.DimLayerUser,
        pw.println(prefix + "mDeferDetach=" + mDeferDetach);
        pw.println(prefix + "mFullscreen=" + mFullscreen);
        pw.println(prefix + "mBounds=" + mBounds.toShortString());
        if (mMinimizeAmount != 0f) {
            pw.println(prefix + "mMinimizeAmout=" + mMinimizeAmount);
        }
        if (mAdjustedForIme) {
            pw.println(prefix + "mAdjustedForIme=true");
            pw.println(prefix + "mAdjustImeAmount=" + mAdjustImeAmount);
            pw.println(prefix + "mAdjustDividerAmount=" + mAdjustDividerAmount);
        }
        if (!mAdjustedBounds.isEmpty()) {
            pw.println(prefix + "mAdjustedBounds=" + mAdjustedBounds.toShortString());
        }
+10 −4
Original line number Diff line number Diff line
@@ -4333,16 +4333,22 @@ public class WindowManagerService extends IWindowManager.Stub
            }
        }

        if (visibilityChanged && !delayed) {
            if (visible) {
        if (visibilityChanged) {
            if (visible && !delayed) {
                // The token was made immediately visible, there will be no entrance animation.
                // We need to inform the client the enter animation was finished.
                wtoken.mEnteringAnimation = true;
                mActivityManagerAppTransitionNotifier.onAppTransitionFinishedLocked(wtoken.token);
            }

            if (!mClosingApps.contains(wtoken) && !mOpeningApps.contains(wtoken)) {
                // The token is not closing nor opening, so even if there is an animation set, that
                // doesn't mean that it goes through the normal app transition cycle so we have
                // to inform the docked controller about visibility change.
                getDefaultDisplayContentLocked().getDockedDividerController()
                        .notifyAppVisibilityChanged(wtoken, visible);
            }
        }

        return delayed;
    }