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

Commit abecaa80 authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas
Browse files

Move PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH to DesktopExperienceFlags

Flag: com.android.window.flags.preserve_recents_task_configuration_on_relaunch
Test: m
Fixes: 419264456
Change-Id: Ib32adf50d3ca6d910be52c87d9076d5063329494
parent 5d628b1f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -206,6 +206,9 @@ public enum DesktopExperienceFlags {
            true, Flags.FLAG_ENTER_DESKTOP_BY_DEFAULT_ON_FREEFORM_DISPLAYS),
    FORM_FACTOR_BASED_DESKTOP_FIRST_SWITCH(Flags::formFactorBasedDesktopFirstSwitch, true,
            Flags.FLAG_FORM_FACTOR_BASED_DESKTOP_FIRST_SWITCH),
    PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH(
            Flags::preserveRecentsTaskConfigurationOnRelaunch, false,
            Flags.FLAG_PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH),
    REPARENT_WINDOW_TOKEN_API(Flags::reparentWindowTokenApi, true,
            Flags.FLAG_REPARENT_WINDOW_TOKEN_API),
    RESPECT_FULLSCREEN_ACTIVITY_OPTION_IN_DESKTOP_LAUNCH_PARAMS(
+0 −2
Original line number Diff line number Diff line
@@ -145,8 +145,6 @@ public enum DesktopModeFlags {
            Flags::includeTopTransparentFullscreenTaskInDesktopHeuristic, true),
    INHERIT_TASK_BOUNDS_FOR_TRAMPOLINE_TASK_LAUNCHES(
            Flags::inheritTaskBoundsForTrampolineTaskLaunches, true),
    PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH(
            Flags::preserveRecentsTaskConfigurationOnRelaunch, false),
    SKIP_DECOR_VIEW_RELAYOUT_WHEN_CLOSING_BUGFIX(
            Flags::skipDecorViewRelayoutWhenClosingBugfix, true),
    // go/keep-sorted end
+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import android.annotation.NonNull;
import android.app.WindowConfiguration;
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.window.DesktopModeFlags;
import android.window.DesktopExperienceFlags;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
@@ -71,7 +71,7 @@ public class DesktopAppCompatAspectRatioPolicy {
     * launched in. Takes into account any min or max aspect ratio constraints.
     */
    float calculateAspectRatio(@NonNull Task task, boolean hasOrientationMismatch) {
        if (DesktopModeFlags.PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH.isTrue()
        if (DesktopExperienceFlags.PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH.isTrue()
                && task.inRecents && task.topRunningActivity() != null) {
            final ActivityRecord top = task.topRunningActivity();
            // If activity eligible for SCM, use original aspect ratio.
+2 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.os.SystemProperties;
import android.util.Size;
import android.view.Display;
import android.view.Gravity;
import android.window.DesktopExperienceFlags;
import android.window.DesktopModeFlags;

import java.util.function.Consumer;
@@ -243,7 +244,7 @@ public final class DesktopModeBoundsCalculator {
    private static @Configuration.Orientation int getActivityConfigurationOrientation(
            @NonNull ActivityRecord activity, @NonNull Task task,
            @Configuration.Orientation int stableBoundsOrientation) {
        if (DesktopModeFlags.PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH.isTrue()
        if (DesktopExperienceFlags.PRESERVE_RECENTS_TASK_CONFIGURATION_ON_RELAUNCH.isTrue()
                && task.inRecents && task.topRunningActivity() != null) {
            // If task in resents with running activity, inherit existing activity orientation.
            final WindowConfiguration windowConfiguration =