diff options
author | Jorim Jaggi <jjaggi@google.com> | 2017-06-28 14:40:27 -0400 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-29 04:39:35 +0000 |
commit | 19c2fa499b5ef357a91cec81ae10371cb37a4f35 (patch) | |
tree | 0bec9144a422e08c46cd543877201ad4ae7ef774 | |
parent | 3f100d0173c439ab98ffb5825c709bbbc29eb100 (diff) | |
download | base-19c2fa499b5ef357a91cec81ae10371cb37a4f35.tar.gz |
Properly check for orientation mismatch
Previous check tested against the display, which is wrong. Now
we properly check against the configuration.
Test: go/wm-smoke
Test: Enter split screen, go home, launch app, go home, relaunch
app, ensure no splash screen shown
Test: Enter split screen with 2 apps, lock phone, unlock phone
Change-Id: I62d45b6d3e5aa91dcb5edffed4233a5fed7ac9aa
Fixes: 63075521
(cherry picked from commit 1dda7a62a20c247fe97f5791dc2a199a3723c3bd)
-rw-r--r-- | services/core/java/com/android/server/wm/AppWindowContainerController.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowContainerController.java b/services/core/java/com/android/server/wm/AppWindowContainerController.java index 5f34c6067997..4e4398ee9d91 100644 --- a/services/core/java/com/android/server/wm/AppWindowContainerController.java +++ b/services/core/java/com/android/server/wm/AppWindowContainerController.java @@ -614,7 +614,7 @@ public class AppWindowContainerController return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } else if (taskSwitch && allowTaskSnapshot) { return snapshot == null ? STARTING_WINDOW_TYPE_NONE - : snapshotOrientationSameAsDisplay(snapshot) || fromRecents + : snapshotOrientationSameAsTask(snapshot) || fromRecents ? STARTING_WINDOW_TYPE_SNAPSHOT : STARTING_WINDOW_TYPE_SPLASH_SCREEN; } else { return STARTING_WINDOW_TYPE_NONE; @@ -640,24 +640,11 @@ public class AppWindowContainerController return true; } - private boolean snapshotOrientationSameAsDisplay(TaskSnapshot snapshot) { + private boolean snapshotOrientationSameAsTask(TaskSnapshot snapshot) { if (snapshot == null) { return false; } - final Rect rect = new Rect(0, 0, snapshot.getSnapshot().getWidth(), - snapshot.getSnapshot().getHeight()); - rect.inset(snapshot.getContentInsets()); - final Rect taskBoundsWithoutInsets = new Rect(); - mContainer.getTask().getBounds(taskBoundsWithoutInsets); - final DisplayInfo di = mContainer.getDisplayContent().getDisplayInfo(); - final Rect displayBounds = new Rect(0, 0, di.logicalWidth, di.logicalHeight); - final Rect stableInsets = new Rect(); - mService.mPolicy.getStableInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight, - stableInsets); - displayBounds.inset(stableInsets); - final boolean snapshotInLandscape = rect.width() >= rect.height(); - final boolean displayInLandscape = displayBounds.width() >= displayBounds.height(); - return snapshotInLandscape == displayInLandscape; + return mContainer.getTask().getConfiguration().orientation == snapshot.getOrientation(); } public void removeStartingWindow() { |