Skip to content
Commit 46dc79bb authored by Mariia Sandrikova's avatar Mariia Sandrikova
Browse files

Per-app compat treatment for setRequestedOrientation loops.

Per-package controls introduced in this change:
- OVERRIDE_ENABLE_COMPAT_IGNORE_REQUESTED_ORIENTATION for device manufactures to opt in a package into the treatment.
- android.window.PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION for app developers to opt in/out from the treatment via a component property.

When enabled for the package and on the devices, treatment ignores app requested orientation in response to an app calling Activity#setRequestedOrientation if app is currently relaunching or has an active Camera Compat treatment.

This is needed to avoid getting into Activity#setRequestedOrientation loop when ignoreOrientationRequest is enabled. For example, the loop can look like this:
1) App sets default orientation to "unspecified" at runtime
2) App requests to "portrait" after checking some condition (e.g. display rotation).
3) (2) leads to fullscreen -> letterboxed bounds change and activity relaunch because app can't handle the corresponding config changes.
4) Loop goes back to (1)

Fix: 254631730
Test: atest WmTests:LetterboxUiControllerTest
Change-Id: I3dc88db4193d08215c36d9a69ef2cc53155b60c7
parent fa71876c
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