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

Commit 4b268c85 authored by Graciela Putri's avatar Graciela Putri Committed by Android (Google) Code Review
Browse files

Merge "Move boolean AppCompatTaskInfo attributes to bit flags" into main

parents 2ea93073 993f9aeb
Loading
Loading
Loading
Loading
+216 −92
Original line number Diff line number Diff line
@@ -18,62 +18,20 @@ package android.app;

import static android.app.TaskInfo.PROPERTY_VALUE_UNSET;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Stores App Compat information about a particular Task.
 * @hide
 */
public class AppCompatTaskInfo implements Parcelable {
    /**
     * Whether the direct top activity is eligible for letterbox education.
     */
    public boolean topActivityEligibleForLetterboxEducation;

    /**
     * Whether the letterbox education is enabled.
     */
    public boolean isLetterboxEducationEnabled;

    /**
     * Whether the direct top activity is in size compat mode on foreground.
     */
    public boolean topActivityInSizeCompat;

    /**
     * Whether the double tap is enabled.
     */
    public boolean isLetterboxDoubleTapEnabled;

    /**
     * Whether the user aspect ratio settings button is enabled.
     */
    public boolean topActivityEligibleForUserAspectRatioButton;

    /**
     * Whether the user has forced the activity to be fullscreen through the user aspect ratio
     * settings.
     */
    public boolean isUserFullscreenOverrideEnabled;

    /**
     * Whether the system has forced the activity to be fullscreen
     */
    public boolean isSystemFullscreenOverrideEnabled;

    /**
     * Hint about the letterbox state of the top activity.
     */
    public boolean topActivityBoundsLetterboxed;

    /**
     * Whether the update comes from a letterbox double-tap action from the user or not.
     */
    public boolean isFromLetterboxDoubleTap;

    /**
     * If {@link #isLetterboxDoubleTapEnabled} it contains the current letterbox vertical position
     * or {@link TaskInfo#PROPERTY_VALUE_UNSET} otherwise.
@@ -115,6 +73,57 @@ public class AppCompatTaskInfo implements Parcelable {
     */
    public CameraCompatTaskInfo cameraCompatTaskInfo = CameraCompatTaskInfo.create();

    /** Constant indicating no top activity flag has been set. */
    private static final int FLAG_UNDEFINED = 0x0;
    /** Constant base value for top activity flag. */
    private static final int FLAG_BASE = 0x1;
    /** Top activity flag for whether letterbox education is enabled. */
    private static final int FLAG_LETTERBOX_EDU_ENABLED = FLAG_BASE;
    /** Top activity flag for whether activity is eligible for letterbox education. */
    private static final int FLAG_ELIGIBLE_FOR_LETTERBOX_EDU = FLAG_BASE << 1;
    /** Top activity flag for whether activity bounds are letterboxed. */
    private static final int FLAG_LETTERBOXED = FLAG_BASE << 2;
    /** Top activity flag for whether activity is in size compat mode. */
    private static final int FLAG_IN_SIZE_COMPAT = FLAG_BASE << 3;
    /** Top activity flag for whether letterbox double tap is enabled. */
    private static final int FLAG_LETTERBOX_DOUBLE_TAP_ENABLED = FLAG_BASE << 4;
    /** Top activity flag for whether the update comes from a letterbox double tap action. */
    private static final int FLAG_IS_FROM_LETTERBOX_DOUBLE_TAP = FLAG_BASE << 5;
    /** Top activity flag for whether activity is eligible for user aspect ratio button. */
    private static final int FLAG_ELIGIBLE_FOR_USER_ASPECT_RATIO_BUTTON = FLAG_BASE << 6;
    /** Top activity flag for whether has activity has been overridden to fullscreen by system. */
    private static final int FLAG_FULLSCREEN_OVERRIDE_SYSTEM = FLAG_BASE << 7;
    /** Top activity flag for whether has activity has been overridden to fullscreen by user. */
    private static final int FLAG_FULLSCREEN_OVERRIDE_USER = FLAG_BASE << 8;

    @Retention(RetentionPolicy.SOURCE)
    @IntDef(flag = true, value = {
            FLAG_UNDEFINED,
            FLAG_BASE,
            FLAG_LETTERBOX_EDU_ENABLED,
            FLAG_ELIGIBLE_FOR_LETTERBOX_EDU,
            FLAG_LETTERBOXED,
            FLAG_IN_SIZE_COMPAT,
            FLAG_LETTERBOX_DOUBLE_TAP_ENABLED,
            FLAG_IS_FROM_LETTERBOX_DOUBLE_TAP,
            FLAG_ELIGIBLE_FOR_USER_ASPECT_RATIO_BUTTON,
            FLAG_FULLSCREEN_OVERRIDE_SYSTEM,
            FLAG_FULLSCREEN_OVERRIDE_USER
    })
    public @interface TopActivityFlag {}

    @TopActivityFlag
    private int mTopActivityFlags;

    @TopActivityFlag
    private static final int FLAGS_ORGANIZER_INTERESTED = FLAG_IS_FROM_LETTERBOX_DOUBLE_TAP
            | FLAG_ELIGIBLE_FOR_USER_ASPECT_RATIO_BUTTON | FLAG_FULLSCREEN_OVERRIDE_SYSTEM
            | FLAG_FULLSCREEN_OVERRIDE_USER;

    @TopActivityFlag
    private static final int FLAGS_COMPAT_UI_INTERESTED = FLAGS_ORGANIZER_INTERESTED
            | FLAG_IN_SIZE_COMPAT | FLAG_ELIGIBLE_FOR_LETTERBOX_EDU | FLAG_LETTERBOX_EDU_ENABLED;

    private AppCompatTaskInfo() {
        // Do nothing
    }
@@ -150,9 +159,8 @@ public class AppCompatTaskInfo implements Parcelable {
     * @return {@code true} if the task has some compat ui.
     */
    public boolean hasCompatUI() {
        return topActivityInSizeCompat || topActivityEligibleForLetterboxEducation
                || isLetterboxDoubleTapEnabled
                || topActivityEligibleForUserAspectRatioButton;
        return isTopActivityInSizeCompat() || eligibleForLetterboxEducation()
                || isLetterboxDoubleTapEnabled() || eligibleForUserAspectRatioButton();
    }

    /**
@@ -162,6 +170,142 @@ public class AppCompatTaskInfo implements Parcelable {
        return topActivityLetterboxWidth < topActivityLetterboxHeight;
    }

    /**
     * @return {@code true} if the letterbox education is enabled.
     */
    public boolean isLetterboxEducationEnabled() {
        return isTopActivityFlagEnabled(FLAG_LETTERBOX_EDU_ENABLED);
    }

    /**
     * Sets the top activity flag for whether letterbox education is enabled.
     */
    public void setLetterboxEducationEnabled(boolean enable) {
        setTopActivityFlag(FLAG_LETTERBOX_EDU_ENABLED, enable);
    }

    /**
     * @return {@code true} if the direct top activity is eligible for letterbox education.
     */
    public boolean eligibleForLetterboxEducation() {
        return isTopActivityFlagEnabled(FLAG_ELIGIBLE_FOR_LETTERBOX_EDU);
    }

    /**
     * Sets the top activity flag to be eligible for letterbox education.
     */
    public void setEligibleForLetterboxEducation(boolean enable) {
        setTopActivityFlag(FLAG_ELIGIBLE_FOR_LETTERBOX_EDU, enable);
    }

    /**
     * @return {@code true} if the direct top activity is eligible for the user aspect ratio
     * settings button.
     */
    public boolean eligibleForUserAspectRatioButton() {
        return isTopActivityFlagEnabled(FLAG_ELIGIBLE_FOR_USER_ASPECT_RATIO_BUTTON);
    }

    /**
     * Sets the top activity flag to be eligible for the user aspect ratio settings button.
     */
    public void setEligibleForUserAspectRatioButton(boolean enable) {
        setTopActivityFlag(FLAG_ELIGIBLE_FOR_USER_ASPECT_RATIO_BUTTON, enable);
    }

    /**
     * @return {@code true} if double tap to reposition letterboxed app is enabled.
     */
    public boolean isLetterboxDoubleTapEnabled() {
        return isTopActivityFlagEnabled(FLAG_LETTERBOX_DOUBLE_TAP_ENABLED);
    }

    /**
     * Sets the top activity flag to enable double tap to reposition letterboxed app.
     */
    public void setLetterboxDoubleTapEnabled(boolean enable) {
        setTopActivityFlag(FLAG_LETTERBOX_DOUBLE_TAP_ENABLED, enable);
    }

    /**
     * @return {@code true} if the update comes from a letterbox double-tap action from the user.
     */
    public boolean isFromLetterboxDoubleTap() {
        return isTopActivityFlagEnabled(FLAG_IS_FROM_LETTERBOX_DOUBLE_TAP);
    }

    /**
     * Sets the top activity flag for whether the update comes from a letterbox double-tap action
     * from the user.
     */
    public void setIsFromLetterboxDoubleTap(boolean enable) {
        setTopActivityFlag(FLAG_IS_FROM_LETTERBOX_DOUBLE_TAP, enable);
    }

    /**
     * @return {@code true} if the user has forced the activity to be fullscreen through the
     * user aspect ratio settings.
     */
    public boolean isUserFullscreenOverrideEnabled() {
        return isTopActivityFlagEnabled(FLAG_FULLSCREEN_OVERRIDE_USER);
    }

    /**
     * Sets the top activity flag for whether the user has forced the activity to be fullscreen
     * through the user aspect ratio settings.
     */
    public void setUserFullscreenOverrideEnabled(boolean enable) {
        setTopActivityFlag(FLAG_FULLSCREEN_OVERRIDE_USER, enable);
    }

    /**
     * @return {@code true} if the system has forced the activity to be fullscreen.
     */
    public boolean isSystemFullscreenOverrideEnabled() {
        return isTopActivityFlagEnabled(FLAG_FULLSCREEN_OVERRIDE_SYSTEM);
    }

    /**
     * Sets the top activity flag for whether the system has forced the activity to be fullscreen.
     */
    public void setSystemFullscreenOverrideEnabled(boolean enable) {
        setTopActivityFlag(FLAG_FULLSCREEN_OVERRIDE_SYSTEM, enable);
    }

    /**
     * @return {@code true} if the direct top activity is in size compat mode on foreground.
     */
    public boolean isTopActivityInSizeCompat() {
        return isTopActivityFlagEnabled(FLAG_IN_SIZE_COMPAT);
    }

    /**
     * Sets the top activity flag for whether the direct top activity is in size compat mode
     * on foreground.
     */
    public void setTopActivityInSizeCompat(boolean enable) {
        setTopActivityFlag(FLAG_IN_SIZE_COMPAT, enable);
    }

    /**
     * @return {@code true} if the top activity bounds are letterboxed.
     */
    public boolean isTopActivityLetterboxed() {
        return isTopActivityFlagEnabled(FLAG_LETTERBOXED);
    }

    /**
     * Sets the top activity flag for whether the top activity bounds are letterboxed.
     */
    public void setTopActivityLetterboxed(boolean enable) {
        setTopActivityFlag(FLAG_LETTERBOXED, enable);
    }

    /** Clear all top activity flags and set to false. */
    public void clearTopActivityFlags() {
        mTopActivityFlags = FLAG_UNDEFINED;
    }

    /**
     * @return {@code true} if the app compat parameters that are important for task organizers
     * are equal.
@@ -170,9 +314,8 @@ public class AppCompatTaskInfo implements Parcelable {
        if (that == null) {
            return false;
        }
        return isFromLetterboxDoubleTap == that.isFromLetterboxDoubleTap
                && topActivityEligibleForUserAspectRatioButton
                    == that.topActivityEligibleForUserAspectRatioButton
        return (mTopActivityFlags & FLAGS_ORGANIZER_INTERESTED)
                    == (that.mTopActivityFlags & FLAGS_ORGANIZER_INTERESTED)
                && topActivityLetterboxVerticalPosition == that.topActivityLetterboxVerticalPosition
                && topActivityLetterboxWidth == that.topActivityLetterboxWidth
                && topActivityLetterboxHeight == that.topActivityLetterboxHeight
@@ -180,8 +323,6 @@ public class AppCompatTaskInfo implements Parcelable {
                && topActivityLetterboxAppHeight == that.topActivityLetterboxAppHeight
                && topActivityLetterboxHorizontalPosition
                    == that.topActivityLetterboxHorizontalPosition
                && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled
                && isSystemFullscreenOverrideEnabled == that.isSystemFullscreenOverrideEnabled
                && cameraCompatTaskInfo.equalsForTaskOrganizer(that.cameraCompatTaskInfo);
    }

@@ -192,13 +333,8 @@ public class AppCompatTaskInfo implements Parcelable {
        if (that == null) {
            return false;
        }
        return topActivityInSizeCompat == that.topActivityInSizeCompat
                && isFromLetterboxDoubleTap == that.isFromLetterboxDoubleTap
                && topActivityEligibleForUserAspectRatioButton
                    == that.topActivityEligibleForUserAspectRatioButton
                && topActivityEligibleForLetterboxEducation
                    == that.topActivityEligibleForLetterboxEducation
                && isLetterboxEducationEnabled == that.isLetterboxEducationEnabled
        return (mTopActivityFlags & FLAGS_COMPAT_UI_INTERESTED)
                    == (that.mTopActivityFlags & FLAGS_COMPAT_UI_INTERESTED)
                && topActivityLetterboxVerticalPosition == that.topActivityLetterboxVerticalPosition
                && topActivityLetterboxHorizontalPosition
                    == that.topActivityLetterboxHorizontalPosition
@@ -206,8 +342,6 @@ public class AppCompatTaskInfo implements Parcelable {
                && topActivityLetterboxHeight == that.topActivityLetterboxHeight
                && topActivityLetterboxAppWidth == that.topActivityLetterboxAppWidth
                && topActivityLetterboxAppHeight == that.topActivityLetterboxAppHeight
                && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled
                && isSystemFullscreenOverrideEnabled == that.isSystemFullscreenOverrideEnabled
                && cameraCompatTaskInfo.equalsForCompatUi(that.cameraCompatTaskInfo);
    }

@@ -215,21 +349,13 @@ public class AppCompatTaskInfo implements Parcelable {
     * Reads the AppCompatTaskInfo from a parcel.
     */
    void readFromParcel(Parcel source) {
        isLetterboxEducationEnabled = source.readBoolean();
        topActivityInSizeCompat = source.readBoolean();
        topActivityEligibleForLetterboxEducation = source.readBoolean();
        isLetterboxDoubleTapEnabled = source.readBoolean();
        topActivityEligibleForUserAspectRatioButton = source.readBoolean();
        topActivityBoundsLetterboxed = source.readBoolean();
        isFromLetterboxDoubleTap = source.readBoolean();
        mTopActivityFlags = source.readInt();
        topActivityLetterboxVerticalPosition = source.readInt();
        topActivityLetterboxHorizontalPosition = source.readInt();
        topActivityLetterboxWidth = source.readInt();
        topActivityLetterboxHeight = source.readInt();
        topActivityLetterboxAppWidth = source.readInt();
        topActivityLetterboxAppHeight = source.readInt();
        isUserFullscreenOverrideEnabled = source.readBoolean();
        isSystemFullscreenOverrideEnabled = source.readBoolean();
        cameraCompatTaskInfo = source.readTypedObject(CameraCompatTaskInfo.CREATOR);
    }

@@ -238,35 +364,25 @@ public class AppCompatTaskInfo implements Parcelable {
     */
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeBoolean(isLetterboxEducationEnabled);
        dest.writeBoolean(topActivityInSizeCompat);
        dest.writeBoolean(topActivityEligibleForLetterboxEducation);
        dest.writeBoolean(isLetterboxDoubleTapEnabled);
        dest.writeBoolean(topActivityEligibleForUserAspectRatioButton);
        dest.writeBoolean(topActivityBoundsLetterboxed);
        dest.writeBoolean(isFromLetterboxDoubleTap);
        dest.writeInt(mTopActivityFlags);
        dest.writeInt(topActivityLetterboxVerticalPosition);
        dest.writeInt(topActivityLetterboxHorizontalPosition);
        dest.writeInt(topActivityLetterboxWidth);
        dest.writeInt(topActivityLetterboxHeight);
        dest.writeInt(topActivityLetterboxAppWidth);
        dest.writeInt(topActivityLetterboxAppHeight);
        dest.writeBoolean(isUserFullscreenOverrideEnabled);
        dest.writeBoolean(isSystemFullscreenOverrideEnabled);
        dest.writeTypedObject(cameraCompatTaskInfo, flags);
    }

    @Override
    public String toString() {
        return "AppCompatTaskInfo { topActivityInSizeCompat=" + topActivityInSizeCompat
                + " topActivityEligibleForLetterboxEducation= "
                + topActivityEligibleForLetterboxEducation
                + "isLetterboxEducationEnabled= " + isLetterboxEducationEnabled
                + " isLetterboxDoubleTapEnabled= " + isLetterboxDoubleTapEnabled
                + " topActivityEligibleForUserAspectRatioButton= "
                + topActivityEligibleForUserAspectRatioButton
                + " topActivityBoundsLetterboxed= " + topActivityBoundsLetterboxed
                + " isFromLetterboxDoubleTap= " + isFromLetterboxDoubleTap
        return "AppCompatTaskInfo { topActivityInSizeCompat=" + isTopActivityInSizeCompat()
                + " eligibleForLetterboxEducation= " + eligibleForLetterboxEducation()
                + " isLetterboxEducationEnabled= " + isLetterboxEducationEnabled()
                + " isLetterboxDoubleTapEnabled= " + isLetterboxDoubleTapEnabled()
                + " eligibleForUserAspectRatioButton= " + eligibleForUserAspectRatioButton()
                + " topActivityBoundsLetterboxed= " + isTopActivityLetterboxed()
                + " isFromLetterboxDoubleTap= " + isFromLetterboxDoubleTap()
                + " topActivityLetterboxVerticalPosition= " + topActivityLetterboxVerticalPosition
                + " topActivityLetterboxHorizontalPosition= "
                + topActivityLetterboxHorizontalPosition
@@ -274,9 +390,17 @@ public class AppCompatTaskInfo implements Parcelable {
                + " topActivityLetterboxHeight=" + topActivityLetterboxHeight
                + " topActivityLetterboxAppWidth=" + topActivityLetterboxAppWidth
                + " topActivityLetterboxAppHeight=" + topActivityLetterboxAppHeight
                + " isUserFullscreenOverrideEnabled=" + isUserFullscreenOverrideEnabled
                + " isSystemFullscreenOverrideEnabled=" + isSystemFullscreenOverrideEnabled
                + " isUserFullscreenOverrideEnabled=" + isUserFullscreenOverrideEnabled()
                + " isSystemFullscreenOverrideEnabled=" + isSystemFullscreenOverrideEnabled()
                + " cameraCompatTaskInfo=" + cameraCompatTaskInfo.toString()
                + "}";
    }

    private void setTopActivityFlag(@TopActivityFlag int flag, boolean enable) {
        mTopActivityFlags = enable ? (mTopActivityFlags | flag) : (mTopActivityFlags & ~flag);
    }

    private boolean isTopActivityFlagEnabled(@TopActivityFlag int flag) {
        return (mTopActivityFlags & flag) == flag;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ abstract class CrossActivityBackAnimation(
        initialTouchPos.set(backMotionEvent.touchX, backMotionEvent.touchY)

        transaction.setAnimationTransaction()
        isLetterboxed = closingTarget!!.taskInfo.appCompatTaskInfo.topActivityBoundsLetterboxed
        isLetterboxed = closingTarget!!.taskInfo.appCompatTaskInfo.isTopActivityLetterboxed
        enteringHasSameLetterbox =
            isLetterboxed && closingTarget!!.localBounds.equals(enteringTarget!!.localBounds)

+9 −9
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ public class CompatUIController implements OnDisplaysChangedListener,
    public void onCompatInfoChanged(@NonNull CompatUIInfo compatUIInfo) {
        final TaskInfo taskInfo = compatUIInfo.getTaskInfo();
        final ShellTaskOrganizer.TaskListener taskListener = compatUIInfo.getListener();
        if (taskInfo != null && !taskInfo.appCompatTaskInfo.topActivityInSizeCompat) {
        if (taskInfo != null && !taskInfo.appCompatTaskInfo.isTopActivityInSizeCompat()) {
            mSetOfTaskIdsShowingRestartDialog.remove(taskInfo.taskId);
        }

@@ -256,16 +256,16 @@ public class CompatUIController implements OnDisplaysChangedListener,
        // basically cancel all the onboarding flow. We don't have to ignore events in case
        // the app is in size compat mode.
        if (mIsFirstReachabilityEducationRunning) {
            if (!taskInfo.appCompatTaskInfo.isFromLetterboxDoubleTap
                    && !taskInfo.appCompatTaskInfo.topActivityInSizeCompat) {
            if (!taskInfo.appCompatTaskInfo.isFromLetterboxDoubleTap()
                    && !taskInfo.appCompatTaskInfo.isTopActivityInSizeCompat()) {
                return;
            }
            mIsFirstReachabilityEducationRunning = false;
        }
        if (taskInfo.appCompatTaskInfo.topActivityBoundsLetterboxed) {
            if (taskInfo.appCompatTaskInfo.isLetterboxEducationEnabled) {
        if (taskInfo.appCompatTaskInfo.isTopActivityLetterboxed()) {
            if (taskInfo.appCompatTaskInfo.isLetterboxEducationEnabled()) {
                createOrUpdateLetterboxEduLayout(taskInfo, taskListener);
            } else if (!taskInfo.appCompatTaskInfo.isFromLetterboxDoubleTap) {
            } else if (!taskInfo.appCompatTaskInfo.isFromLetterboxDoubleTap()) {
                // In this case the app is letterboxed and the letterbox education
                // is disabled. In this case we need to understand if it's the first
                // time we show the reachability education. When this is happening
@@ -282,7 +282,7 @@ public class CompatUIController implements OnDisplaysChangedListener,
                    // We activate the first reachability education if the double-tap is enabled.
                    // If the double tap is not enabled (e.g. thin letterbox) we just set the value
                    // of the education being seen.
                    if (taskInfo.appCompatTaskInfo.isLetterboxDoubleTapEnabled) {
                    if (taskInfo.appCompatTaskInfo.isLetterboxDoubleTapEnabled()) {
                        mIsFirstReachabilityEducationRunning = true;
                        createOrUpdateReachabilityEduLayout(taskInfo, taskListener);
                        return;
@@ -293,7 +293,7 @@ public class CompatUIController implements OnDisplaysChangedListener,
        createOrUpdateCompatLayout(taskInfo, taskListener);
        createOrUpdateRestartDialogLayout(taskInfo, taskListener);
        if (mCompatUIConfiguration.getHasSeenLetterboxEducation(taskInfo.userId)) {
            if (taskInfo.appCompatTaskInfo.isLetterboxDoubleTapEnabled) {
            if (taskInfo.appCompatTaskInfo.isLetterboxDoubleTapEnabled()) {
                createOrUpdateReachabilityEduLayout(taskInfo, taskListener);
            }
            // The user aspect ratio button should not be handled when a new TaskInfo is
@@ -305,7 +305,7 @@ public class CompatUIController implements OnDisplaysChangedListener,
                }
                return;
            }
            if (!taskInfo.appCompatTaskInfo.isFromLetterboxDoubleTap) {
            if (!taskInfo.appCompatTaskInfo.isFromLetterboxDoubleTap()) {
                createOrUpdateUserAspectRatioSettingsLayout(taskInfo, taskListener);
            }
        }
+2 −2
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ class CompatUIWindowManager extends CompatUIWindowManagerAbstract {
                                  onRestartButtonClicked) {
        super(context, taskInfo, syncQueue, taskListener, displayLayout);
        mCallback = callback;
        mHasSizeCompat = taskInfo.appCompatTaskInfo.topActivityInSizeCompat;
        mHasSizeCompat = taskInfo.appCompatTaskInfo.isTopActivityInSizeCompat();
        if (DESKTOP_WINDOWING_MODE.isEnabled(mContext)
                && DesktopModeFlags.DYNAMIC_INITIAL_BOUNDS.isEnabled(context)) {
            // Don't show the SCM button for freeform tasks
@@ -138,7 +138,7 @@ class CompatUIWindowManager extends CompatUIWindowManagerAbstract {
    public boolean updateCompatInfo(TaskInfo taskInfo, ShellTaskOrganizer.TaskListener taskListener,
            boolean canShow) {
        final boolean prevHasSizeCompat = mHasSizeCompat;
        mHasSizeCompat = taskInfo.appCompatTaskInfo.topActivityInSizeCompat;
        mHasSizeCompat = taskInfo.appCompatTaskInfo.isTopActivityInSizeCompat();
        if (DESKTOP_WINDOWING_MODE.isEnabled(mContext)
                && DesktopModeFlags.DYNAMIC_INITIAL_BOUNDS.isEnabled(mContext)) {
            // Don't show the SCM button for freeform tasks
+2 −3
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ class LetterboxEduWindowManager extends CompatUIWindowManagerAbstract {
        mDockStateReader = dockStateReader;
        mCompatUIConfiguration = compatUIConfiguration;
        mEligibleForLetterboxEducation =
                taskInfo.appCompatTaskInfo.topActivityEligibleForLetterboxEducation;
                taskInfo.appCompatTaskInfo.eligibleForLetterboxEducation();
    }

    @Override
@@ -205,8 +205,7 @@ class LetterboxEduWindowManager extends CompatUIWindowManagerAbstract {
    @Override
    public boolean updateCompatInfo(TaskInfo taskInfo, ShellTaskOrganizer.TaskListener taskListener,
            boolean canShow) {
        mEligibleForLetterboxEducation =
                taskInfo.appCompatTaskInfo.topActivityEligibleForLetterboxEducation;
        mEligibleForLetterboxEducation = taskInfo.appCompatTaskInfo.eligibleForLetterboxEducation();

        return super.updateCompatInfo(taskInfo, taskListener, canShow);
    }
Loading