Merge "[Bugfix] Fix the issue of transition animation splash screen in split screen mode." am: 0665490327 am: 5d876166cd

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1867824

Change-Id: I86966a77aa03ed2b1cf8b14398fa599d0533c7dc
This commit is contained in:
Treehugger Robot
2021-10-28 13:54:37 +00:00
committed by Automerger Merge Worker
2 changed files with 18 additions and 7 deletions

View File

@@ -1349,13 +1349,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
final Task rootTask = getRootTask();
// If we reparent, make sure to remove ourselves from the old animation registry.
if (mAnimatingActivityRegistry != null) {
mAnimatingActivityRegistry.notifyFinished(this);
}
mAnimatingActivityRegistry = rootTask != null
? rootTask.getAnimatingActivityRegistry()
: null;
updateAnimatingActivityRegistry();
if (task == mLastParentBeforePip) {
// Activity's reparented back from pip, clear the links once established
@@ -1380,6 +1374,20 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
}
void updateAnimatingActivityRegistry() {
final Task rootTask = getRootTask();
final AnimatingActivityRegistry registry = rootTask != null
? rootTask.getAnimatingActivityRegistry()
: null;
// If we reparent, make sure to remove ourselves from the old animation registry.
if (mAnimatingActivityRegistry != null && mAnimatingActivityRegistry != registry) {
mAnimatingActivityRegistry.notifyFinished(this);
}
mAnimatingActivityRegistry = registry;
}
/**
* Sets {@link #mLastParentBeforePip} to the current parent Task, it's caller's job to ensure
* {@link #getTask()} is set before this is called.

View File

@@ -1464,6 +1464,9 @@ class Task extends WindowContainer<WindowContainer> {
adjustBoundsForDisplayChangeIfNeeded(getDisplayContent());
mRootWindowContainer.updateUIDsPresentOnDisplay();
// Ensure all animations are finished at same time in split-screen mode.
forAllActivities(ActivityRecord::updateAnimatingActivityRegistry);
}
void cleanUpActivityReferences(ActivityRecord r) {