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

Commit 32c566fe authored by Winson Chung's avatar Winson Chung
Browse files

Fixing missing movement bounds notification to SystemUI.

- When WM updates from a configuration change, ensure that we update the
  pinned stack controller even if there is currently no pinned stack.
- Also finish the menu activity once an activity is unpinned.

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I789945c1783693cf4b4e3d6663548c8669784001
parent 40a5f935
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public class PipManager implements BasePipManager {

            ComponentName topPipActivity = PipUtils.getTopPinnedActivity(mContext,
                    mActivityManager);
            mMenuController.hideMenu();
            mNotificationController.onActivityUnpinned(topPipActivity);

            SystemServicesProxy.getInstance(mContext).setPipVisibility(topPipActivity != null);
+7 −0
Original line number Diff line number Diff line
@@ -1420,6 +1420,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                changedStackList.add(stack.mStackId);
            }
        }

        // If there was no pinned stack, we still need to notify the controller of the display info
        // update as a result of the config change.  We do this here to consolidate the flow between
        // changes when there is and is not a stack.
        if (getStackById(PINNED_STACK_ID) == null) {
            mPinnedStackControllerLocked.onDisplayInfoChanged();
        }
    }

    @Override
+10 −1
Original line number Diff line number Diff line
@@ -147,7 +147,6 @@ class PinnedStackController {

    void onConfigurationChanged() {
        reloadResources();
        notifyMovementBoundsChanged(false /* fromImeAdjustment */);
    }

    /**
@@ -240,6 +239,16 @@ class PinnedStackController {
        return defaultBounds;
    }

    /**
     * In the case where the display rotation is changed but there is no stack, we can't depend on
     * onTaskStackBoundsChanged() to be called.  But we still should update our known display info
     * with the new state so that we can update SystemUI.
     */
    synchronized void onDisplayInfoChanged() {
        mDisplayInfo.copyFrom(mDisplayContent.getDisplayInfo());
        notifyMovementBoundsChanged(false /* fromImeAdjustment */);
    }

    /**
     * Updates the display info, calculating and returning the new stack and movement bounds in the
     * new orientation of the device if necessary.