diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index bb33e6ff71111..fd5893623021c 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -2504,10 +2504,20 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } void removeStartingWindow() { + boolean prevEligibleForLetterboxEducation = isEligibleForLetterboxEducation(); + if (transferSplashScreenIfNeeded()) { return; } removeStartingWindowAnimation(true /* prepareAnimation */); + + // TODO(b/215316431): Add tests + final Task task = getTask(); + if (prevEligibleForLetterboxEducation != isEligibleForLetterboxEducation() + && task != null) { + // Trigger TaskInfoChanged to update the letterbox education. + task.dispatchTaskInfoChangedIfNeeded(true /* force */); + } } void removeStartingWindowAnimation(boolean prepareAnimation) { @@ -7701,6 +7711,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A *
  • The activity is eligible for fixed orientation letterbox. *
  • The activity is in fullscreen. *
  • The activity is portrait-only. + *
  • The activity doesn't have a starting window (education should only be displayed + * once the starting window is removed in {@link #removeStartingWindow}). * */ // TODO(b/215316431): Add tests @@ -7708,7 +7720,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return mWmService.mLetterboxConfiguration.getIsEducationEnabled() && mIsEligibleForFixedOrientationLetterbox && getWindowingMode() == WINDOWING_MODE_FULLSCREEN - && getRequestedConfigurationOrientation() == ORIENTATION_PORTRAIT; + && getRequestedConfigurationOrientation() == ORIENTATION_PORTRAIT + && mStartingWindow == null; } /**