Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2b9c427 authored by Tom Natan's avatar Tom Natan Committed by Android (Google) Code Review
Browse files

Merge "[8/n] Letterbox Education: display education only after starting window is removed."

parents c69e76f3 89becc4c
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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
     *     <li>The activity is eligible for fixed orientation letterbox.
     *     <li>The activity is in fullscreen.
     *     <li>The activity is portrait-only.
     *     <li>The activity doesn't have a starting window (education should only be displayed
     *     once the starting window is removed in {@link #removeStartingWindow}).
     * </ul>
     */
    // 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;
    }

    /**