Skip to content
Commit 47e576c0 authored by Garfield Tan's avatar Garfield Tan
Browse files

Bring more visibility logic from stack to activity.

There has been a discrepancy between the condition of pushing
configuration to apps in ActivityRecord#ensureActivityConfiguration()
and WindowManagerService#relayoutWindow(). This CL tries to remove the
discrepancy for most activities (with an exception on activity behind a
modal activity in the same stack), by changing relevant logic in
ActivityRecord.

This effectively fixes b/123127858 (Home page layout issue after
exiting a landscape app), but still leaves a question to answer. The
root cause of that issue is someone calls startRecentsActivity() to
launch Nexus launcher activity and uses mLaunchTaskBehind to promote
visibility. In WMS#relayoutWindow() it pushes configuration if
mLaunchTaskBehind is true (by setting visibility into AppWindowToken),
but ActivityRecord#ensureActivityConfiguration() doesn't consider it
visible before this CL. After startRecentActivity() Nexus launcher
activity schedules a relayout and receives a landscape configuration
because the game is still in the foreground in the relayout pass. Later
when it's really brought to foreground ActivityRecord won't push a new
configuration to it because ActivityRecord still thinks the last
reported configuration is the portrait one. Thus a wrong landscape
config stayed. This CL lets ActivityRecord#ensureActivityConfiguration()
consider mLaunchTaskBehind and pushes the landscape config, which gives
it a chance to fix it when really bringing home to front.

Bug: 123127858
Test: Manual test. go/wm-smoke.

Change-Id: Iff6ee724a98113921d843344bba322c8b2a55f54
parent 87969723
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