summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilsonshih <wilsonshih@google.com>2023-04-27 07:46:48 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-14 02:44:22 +0000
commitb0aedab367d7381351e73f3bdb27bcb086f03df1 (patch)
treed3880fe419b9d86c8fc4ca9a1f6c23e74cf1a892
parent5f38d273cd9fd584f0a89aaee24e03dc3d7f48fb (diff)
downloadbase-b0aedab367d7381351e73f3bdb27bcb086f03df1.tar.gz
[RESTRICT AUTOMERGE] Always set last report configuration for starting window.
The windows of an activity can be request to resize if the last report configration didn't set during relayout window before activity request visible. So there should excludes starting window since the starting window won't restart activity from configuration change. Bug: 276356396 Test: manual do quick switch on large screen device. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b6b5861513f372b32982df55052241ad3883a13a) Merged-In: Ie12843d00c5336e5a472624205e4e4b9ec881cc5 Change-Id: Ie12843d00c5336e5a472624205e4e4b9ec881cc5
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 95fea0ee22f5..399156090594 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -3867,7 +3867,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// configuration update when the window has requested to be hidden. Doing so can lead to
// the client erroneously accepting a configuration that would have otherwise caused an
// activity restart. We instead hand back the last reported {@link MergedConfiguration}.
+ // Also note since starting window isn't a window of activity, it won't make activity
+ // restart, so here should allow starting window to set the last reported configuration
+ // during relayout, which could happen before activity request visible.
if (useLatestConfig || (relayoutVisible && (mActivityRecord == null
+ || mAttrs.type == TYPE_APPLICATION_STARTING
|| mActivityRecord.isVisibleRequested()))) {
final Configuration globalConfig = getProcessGlobalConfiguration();
final Configuration overrideConfig = getMergedOverrideConfiguration();