Fix mis-overridden of activity level unifying
- AWT#inSizeCompatMode is overridden by ActivityRecord but they
were used for different purposes.
- Add missing ConfigurationContainerListener of display level.
So the configuration got from ActivityRecord#getParent (Task)
is synced with TaskRecord.
- Initial Task with TaskRecord's resolved configuration instead.
That avoids the orientation being locked.
Bug: 80414790
Test: atest AppWindowTokenTests#testSizeCompatBounds
Test: Launch an unresizable portrait activity, after calling
setRequestedOrientation to rotate, the restart button
won't appear.
Test: 1. Enter split-screen in portrait.
2. Finish the activity in secondary.
3. Launch the same activity from recents.
4. Drag divider to top.
5. Check the orientation is still portrait.
Change-Id: Ib3b54a74e98d1e85ea4f7707f17bac51d6dbe21b
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 721de61..b1ef601 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1735,13 +1735,13 @@
}
/** @return {@code true} if the compatibility bounds is taking effect. */
- boolean inSizeCompatMode() {
+ boolean hasSizeCompatBounds() {
return mSizeCompatBounds != null;
}
@Override
float getSizeCompatScale() {
- return inSizeCompatMode() ? mSizeCompatScale : super.getSizeCompatScale();
+ return hasSizeCompatBounds() ? mSizeCompatScale : super.getSizeCompatScale();
}
@Override