Skip to content
Commit 5901e7ce authored by Garfield Tan's avatar Garfield Tan
Browse files

Add window layout affinity.

Window layout affinity is used to combine launch params records for
activities from the same UID that have the same value.

I didn't choose to replace component name as the key to launch params
map by window layout affinity because keeping both has some good traits
when app is updated with some window layout affinity changes:
1) The record with component name is still updated even if it starts to
have a window layout affinity so we don't have to worry about the
orphaned record;
2) Activity that changes/loses window layout affinity can always use the
last launch param that activity saves, instead of starting from default
launch behavior again;
3) App removal can still naturally clean up all useless records.

Those come at a cost that we need to iterate all activities in the same
window layout affinity when getting the launch params, but it's OK
because it's not very common to have specific task affinities and in
cases where they do the number of activities sharing the same task
affinities is limited.

Bug: 146015757
Test: Manual test that 2 activities in a single test app shares the same
launch params record.
Test: atest LaunchParamsPersisterTests

Change-Id: Idb2e7509c6bdf22ac6c9cf41059e9c696419028b
parent 43cae91e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment