summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hongwei Wang <hwwang@google.com> 2019-07-09 17:21:38 -0700
committer Hongwei Wang <hwwang@google.com> 2019-07-10 16:01:58 -0700
commit8c43bac8994e650ae9d0c68ea5667cf5e2f25efd (patch)
tree183feb9915faf6769eb8cf1b70e2f0caf2b2819b
parente4579b2a49705c2fbf9622740b2a8b4bc097cb2b (diff)
Excludes shelf height from movement bounds calculation
The shelf offset is taken care of in SysUI via PiPManager(IPinnedStackListener#onMovementBoundsChanged) Bug: 137034541 Test: Manually enter / exit PiP mode Change-Id: I70a56ac2fd9589d4515eaa05a398431e99d08927
-rw-r--r--services/core/java/com/android/server/wm/PinnedStackController.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/wm/PinnedStackController.java b/services/core/java/com/android/server/wm/PinnedStackController.java
index af729317392b..ef0049b068f4 100644
--- a/services/core/java/com/android/server/wm/PinnedStackController.java
+++ b/services/core/java/com/android/server/wm/PinnedStackController.java
@@ -350,7 +350,7 @@ class PinnedStackController {
// Calculate the stack bounds in the new orientation to the same same fraction along the
// rotated movement bounds.
final Rect postChangeMovementBounds = getMovementBounds(postChangeStackBounds,
- false /* adjustForIme */, false /* adjustForShelf */);
+ false /* adjustForIme */);
mSnapAlgorithm.applySnapFraction(postChangeStackBounds, postChangeMovementBounds,
snapFraction);
if (mIsMinimized) {
@@ -540,8 +540,7 @@ class PinnedStackController {
*/
private Rect getMovementBounds(Rect stackBounds) {
synchronized (mService.mGlobalLock) {
- return getMovementBounds(stackBounds, true /* adjustForIme */,
- true /* adjustForShelf */);
+ return getMovementBounds(stackBounds, true /* adjustForIme */);
}
}
@@ -549,15 +548,16 @@ class PinnedStackController {
* @return the movement bounds for the given {@param stackBounds} and the current state of the
* controller.
*/
- private Rect getMovementBounds(Rect stackBounds, boolean adjustForIme, boolean adjustForShelf) {
+ private Rect getMovementBounds(Rect stackBounds, boolean adjustForIme) {
synchronized (mService.mGlobalLock) {
final Rect movementBounds = new Rect();
getInsetBounds(movementBounds);
- // Apply the movement bounds adjustments based on the current state
+ // Apply the movement bounds adjustments based on the current state.
+ // Note that shelf offset does not affect the movement bounds here
+ // since it's been taken care of in system UI.
mSnapAlgorithm.getMovementBounds(stackBounds, movementBounds, movementBounds,
- Math.max((adjustForIme && mIsImeShowing) ? mImeHeight : 0,
- (adjustForShelf && mIsShelfShowing) ? mShelfHeight : 0));
+ (adjustForIme && mIsImeShowing) ? mImeHeight : 0);
return movementBounds;
}
}