diff options
3 files changed, 18 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java index 114a59407487..c5653733bac7 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java @@ -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); diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 2f64cd42e668..058fdae17f9f 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -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 diff --git a/services/core/java/com/android/server/wm/PinnedStackController.java b/services/core/java/com/android/server/wm/PinnedStackController.java index fb660e7f33bf..16848780fe47 100644 --- a/services/core/java/com/android/server/wm/PinnedStackController.java +++ b/services/core/java/com/android/server/wm/PinnedStackController.java @@ -147,7 +147,6 @@ class PinnedStackController { void onConfigurationChanged() { reloadResources(); - notifyMovementBoundsChanged(false /* fromImeAdjustment */); } /** @@ -241,6 +240,16 @@ class PinnedStackController { } /** + * 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. */ |