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

Commit 5214ca48 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Changing the fallback behavior to launch on focused display" into main

parents 5f7aca12 777d7862
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -248,3 +248,11 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
    name: "fallback_to_focused_display"
    description: "Use the focused display as the fallback"
    bug: "406967985"
    is_fixed_read_only: true
}
 No newline at end of file
+13 −5
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ class LaunchParamsUtil {
     *     <li>The display area of the top activity from the launching process will be used</li>
     *     <li>The display area of the top activity from the real launching process will be used
     *     </li>
     *     <li>Default display area from the associated root window container.</li>
     *     <li>The default display area of the current focused display will be used.</li>
     * </ol>
     * @param activityRecord the activity being started
     * @param request optional {@link ActivityStarter.Request} made to start the activity record
@@ -452,9 +452,17 @@ class LaunchParamsUtil {
            }
        }

        if (com.android.window.flags.Flags.fallbackToFocusedDisplay()) {
            // Select the TDA from the top focused display.
            final TaskDisplayArea defaultTaskDisplayArea = supervisor.mRootWindowContainer
                    .getTopFocusedDisplayContent().getDefaultTaskDisplayArea();
            logger.accept("display-area-from-default-fallback=" + defaultTaskDisplayArea);
            return defaultTaskDisplayArea;
        } else {
            final TaskDisplayArea defaultTaskDisplayArea =
                    supervisor.mRootWindowContainer.getDefaultTaskDisplayArea();
            logger.accept("display-area-from-default-fallback=" + defaultTaskDisplayArea);
            return defaultTaskDisplayArea;
        }
    }
}