Fix recents crashing during docked stack resize.
Whether acitvity window should be preserved during the relaunch is
controlled by the activity manager and the existence of
non-client-decor should not affect it. For example, docked activities
will not have non-client-decor, but we would like to preserve them
anyway.
Bug: 24573657
Change-Id: I5d4852c3b7c26ac3ec1bbc105639f75b67d1d3ad
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 4b8efab..9f24de8 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -3956,13 +3956,12 @@
}
IBinder wtoken = v.getWindowToken();
if (r.activity.mWindowAdded) {
- boolean reuseForResize = r.window.hasNonClientDecorView() && r.mPreserveWindow;
- if (r.onlyLocalRequest || reuseForResize) {
+ if (r.onlyLocalRequest || r.mPreserveWindow) {
// Hold off on removing this until the new activity's
// window is being added.
r.mPendingRemoveWindow = r.window;
r.mPendingRemoveWindowManager = wm;
- if (reuseForResize) {
+ if (r.mPreserveWindow) {
// We can only keep the part of the view hierarchy that we control,
// everything else must be removed, because it might not be able to
// behave properly when activity is relaunching.