diff options
| author | 2017-06-29 02:12:02 +0000 | |
|---|---|---|
| committer | 2017-06-29 02:12:02 +0000 | |
| commit | 9d41ce8c4f53b083d62e1a3abdb1d12f6a9a5458 (patch) | |
| tree | 61acc225c4b66643d6d16b5ec719832c33478a10 | |
| parent | 423022e8abe2af0374445ca8e2882f62a990b1b4 (diff) | |
| parent | a96d749140c648723aced0c29d8b7c3a02509566 (diff) | |
Merge "Properly check for orientation mismatch" into oc-dev
am: a96d749140
Change-Id: I5f11ef2c520e418242b44db32d087656c4eb3984
| -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() { |