Skip to content
Commit fd4a0500 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix unused new stack when bring existing activity to front

If a non-top reusable activity is found when starting activity on
secondary display, the condition in
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded will get launch
stack by the reusable activity. But it actually creates a new stack
with the target display which won't be used and seems as a leakage.
That may also disturb focused stack checking when it is on the top of
display (e.g. other tasks are moved to back).

This change gives the preference to use the stack of candidate task
if it already exists on target display. Then it will have the same
behavior as default display that reuses the existing stack.

Bug: 117799939
Test: atest ActivityStarterTests#testBringTaskToFrontOnSecondaryDisplay
Change-Id: I65213386d9802f39ac7ba0d377a06711913c672d
parent a1b9c31c
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