Skip to content
Commit c6b91c65 authored by David Stevens's avatar David Stevens
Browse files

Prefer to launch activities on the source display

If the Activity was sent by another Activity, the source display is
whatever display the original activity was running on. Otherwise,
the source display is the primary display.

- When looking for a task to launch the activity into, ignore affinity
  matches on other displays so we ignore tasks on other displays (when
  possible). This is effectively the inverse of LAUNCH_ADJACENT, which
  ignores all affinity matches to try to launch into the adjacent stack.
- Bypass LAUNCH_ADJACENT's logic for determining the launch stack if
  we're not on the primary display.
- If the focused stack is dynamic, only consider it if the source was on
  the same display as that dynamic stack.
- If no particular stack matches, use the source display instead of
  defaulting to the primary display.

This behavior also means we don't need to check display access
permissions unless the caller requests a specific display, since the
source is already running on the display and thus has permissions.

Bug: 34230873
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testTaskMatchAcrossDisplays
Test: #testNewTaskSameDisplay
Change-Id: Ic3b4754ffb290f84c3964352105594961604891a
parent a98767ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment