From dd3d44faf9d74a793458a515fddf153432601dd6 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Thu, 14 Apr 2016 00:00:53 -0700 Subject: [PATCH] Fix configuration calculation in multi-window Bug: 27975877 Change-Id: I97dcbe7570fe2fdb82dafef8a07fe7351d901704 --- .../core/java/com/android/server/am/TaskRecord.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index e69c6621c661f..08d23999471f7 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -1501,22 +1501,22 @@ final class TaskRecord { Math.min((int)(mTmpStableBounds.width() / density), serviceConfig.screenWidthDp); config.screenHeightDp = Math.min((int)(mTmpStableBounds.height() / density), serviceConfig.screenHeightDp); - config.smallestScreenWidthDp = Math.min(config.screenWidthDp, config.screenHeightDp); // TODO: Orientation? config.orientation = (config.screenWidthDp <= config.screenHeightDp) ? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE; - // For calculating screen layout, we need to use the non-decor inset screen area for the - // calculation for compatibility reasons, i.e. screen area without system bars that could - // never go away in Honeycomb. + // For calculating screen layout and smallest screen width, we need to use the non-decor + // inset screen area for the calculation for compatibility reasons, i.e. screen area without + // system bars that could never go away in Honeycomb. final int compatScreenWidthDp = (int)(mTmpNonDecorBounds.width() / density); final int compatScreenHeightDp = (int)(mTmpNonDecorBounds.height() / density); final int sl = Configuration.resetScreenLayout(serviceConfig.screenLayout); final int longSize = Math.max(compatScreenHeightDp, compatScreenWidthDp); - final int shortSize = Math.min(compatScreenHeightDp, compatScreenWidthDp); - config.screenLayout = Configuration.reduceScreenLayout(sl, longSize, shortSize); + config.smallestScreenWidthDp = Math.min(compatScreenHeightDp, compatScreenWidthDp); + config.screenLayout = Configuration.reduceScreenLayout(sl, longSize, + config.smallestScreenWidthDp); return config; }