diff options
| author | 2017-04-11 18:31:21 -0700 | |
|---|---|---|
| committer | 2017-04-13 19:27:31 -0700 | |
| commit | 32c566fe6e4fca9f41a027352f2ef431342ac3fc (patch) | |
| tree | 22051d093e3684b620650430a07f29d59378283e | |
| parent | 40a5f935acea488086ea1b6df7d5d09e74ea518f (diff) | |
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
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. */ |