From fead57e4deb284c5601760bbc98bda30d68182ba Mon Sep 17 00:00:00 2001 From: tomnatan Date: Wed, 2 Feb 2022 11:22:16 +0000 Subject: [PATCH] [3/n] Letterbox Education: Add portrait-only condition to letterbox education eligibility Test: N/A Bug: 207010227 Change-Id: I4219faaca37d161211b82c4fbf1ae81fa85581bd --- services/core/java/com/android/server/wm/ActivityRecord.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 1e356dc9f1bb1..dea00448fa204 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -7630,13 +7630,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A *
  • {@link LetterboxConfiguration#getIsEducationEnabled} is true. *
  • The activity is eligible for fixed orientation letterbox. *
  • The activity is in fullscreen. + *
  • The activity is portrait-only. * */ // TODO(b/215316431): Add tests boolean isEligibleForLetterboxEducation() { return mWmService.mLetterboxConfiguration.getIsEducationEnabled() && mIsEligibleForFixedOrientationLetterbox - && getWindowingMode() == WINDOWING_MODE_FULLSCREEN; + && getWindowingMode() == WINDOWING_MODE_FULLSCREEN + && getRequestedConfigurationOrientation() == ORIENTATION_PORTRAIT; } /**