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

Update config from ancestor if it can handle orientation request

When calling Activity#setRequestedOrientation, the orientation of task
may not be updated yet. If the requested orientation are mismatched,
the configuration could be letterboxed (unresizable activity) according
to the intermediate state. And because WindowProcessController may be a
configuration listener of the activity, the app may receive unexpected
configuration and keep calling setRequestedOrientation to cause a
relaunch loop.

Now the direct onConfigurationChanged from setOrientation is only
called when:
 - In multi window mode: if the activity is unresizable, its requested
   orientation should be still respected to compute letterboxed bounds
   if needed. Otherwise the orientation is ignored for resizable.
 - The ancestor ignores orientation request from descendant, e.g. in a
   fixed orientation display.

This should save an extra onConfigurationChanged for the most common
case in fullscreen windowing mode.

Fixes: 169349616
Test: atest WindowContainerTests#testSetOrientation

Change-Id: I49ba2003699422a491c1183b10a691e25867ffa7
parent aa36363f
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