summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2022-12-14 18:04:06 +0000
committerChet Haase <chet@google.com>2022-12-14 18:12:29 +0000
commitb9ed093976c84a6a4a8993fe7029a6c55f9afec9 (patch)
treecc9ef03881c1bd0d1b641ac54d05731ea0b33c1e /core/java/android/view/ViewRootImpl.java
parentc199efbedad862609bc82a06d58f5b665eb6e324 (diff)
Revert "DO NOT MERGE Revert "Fix activity leak bug""
DO NOT MERGE Revert submission 20674641-revert-20610032-cherrypick-AnimatorLeak fixes-4lh72bu61o-BQALTBEXMY Reason for revert: Temporary revert deemed unnecessary - this revert will re-submit the original changes. Reverted changes: /q/submissionid:20674641-revert-20610032-cherrypick-AnimatorLeak+fixes-4lh72bu61o-BQALTBEXMY Bug: 261518932 Bug: 258616235 Change-Id: I539c771a6897a9d635613a17138343a7a9feddb9 Test: Presubmit tests. Also, forrest runs with these changes showed no regression
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 8f4a836b6861..b4698dee6019 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1409,7 +1409,11 @@ public final class ViewRootImpl implements ViewParent,
mFirstPostImeInputStage = earlyPostImeStage;
mPendingInputEventQueueLengthCounterName = "aq:pending:" + counterSuffix;
- AnimationHandler.requestAnimatorsEnabled(mAppVisible, this);
+ if (!mRemoved || !mAppVisible) {
+ AnimationHandler.requestAnimatorsEnabled(mAppVisible, this);
+ } else if (LOCAL_LOGV) {
+ Log.v(mTag, "setView() enabling visibility when removed");
+ }
}
}
}
@@ -1747,7 +1751,12 @@ public final class ViewRootImpl implements ViewParent,
if (!mAppVisible) {
WindowManagerGlobal.trimForeground();
}
- AnimationHandler.requestAnimatorsEnabled(mAppVisible, this);
+ // Only enable if the window is not already removed (via earlier call to doDie())
+ if (!mRemoved || !mAppVisible) {
+ AnimationHandler.requestAnimatorsEnabled(mAppVisible, this);
+ } else if (LOCAL_LOGV) {
+ Log.v(mTag, "handleAppVisibility() enabling visibility when removed");
+ }
}
}