From e5ab450cca8164563684b84d55b8e32784ac8dab Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 11 Jul 2017 08:58:05 -0700 Subject: [PATCH] Do not apply maxAspectRatio to bounds when in VR mode. VR applications use fullscreen always and should not have any aspect ratio limitations applied. This CL addresses the issue by checking the current mode before applying appBounds. Change-Id: If8118833315af22917e5731cbc13bacb58a71a44 Fixes: 63024874 Test: launch VR activity, observe activity layout and nav bar placement Test: go/wm-smoke --- .../core/java/com/android/server/am/ActivityRecord.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java index 6a8f6d35c7c03..e668c1f4ec4c8 100644 --- a/services/core/java/com/android/server/am/ActivityRecord.java +++ b/services/core/java/com/android/server/am/ActivityRecord.java @@ -2319,10 +2319,12 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo outBounds.setEmpty(); final float maxAspectRatio = info.maxAspectRatio; final ActivityStack stack = getStack(); - if (task == null || stack == null || !task.mFullscreen || maxAspectRatio == 0) { + if (task == null || stack == null || !task.mFullscreen || maxAspectRatio == 0 + || isInVrUiMode(getConfiguration())) { // We don't set override configuration if that activity task isn't fullscreen. I.e. the // activity is in multi-window mode. Or, there isn't a max aspect ratio specified for - // the activity. This is indicated by an empty {@link outBounds}. + // the activity. This is indicated by an empty {@link outBounds}. We also don't set it + // if we are in VR mode. return; }