Fix getAnimationTargets so that it returns valid animation target
AppTransitionController#getAnimationTargets traverse ancestors of activity to find animation targets. Previously it can reach DisplayContent#mWindowContainers which does not inherit WindowContainer#createRemoteAnimationTarget thus cannot be a remote animation target. After this CL, getAnimationTargets stops traversing if it reaches WindowContainer which cannot be a remote animation target. Bug: 149716548 Test: None Change-Id: Ie94ab8ecd35e9dcc28d0b8f7aaeb058e15b0f80b
This commit is contained in:
@@ -7568,6 +7568,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
record.mStartBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean canCreateRemoteAnimationTarget() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets,
|
||||
Rect outSurfaceInsets) {
|
||||
|
||||
@@ -446,7 +446,7 @@ public class AppTransitionController {
|
||||
siblings.add(current);
|
||||
boolean canPromote = true;
|
||||
|
||||
if (parent == null) {
|
||||
if (parent == null || !parent.canCreateRemoteAnimationTarget()) {
|
||||
canPromote = false;
|
||||
} else {
|
||||
// In case a descendant of the parent belongs to the other group, we cannot promote
|
||||
|
||||
@@ -3087,6 +3087,11 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
return activity != null ? activity.createRemoteAnimationTarget(record) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean canCreateRemoteAnimationTarget() {
|
||||
return true;
|
||||
}
|
||||
|
||||
WindowState getTopVisibleAppMainWindow() {
|
||||
final ActivityRecord activity = getTopVisibleActivity();
|
||||
return activity != null ? activity.findMainWindow() : null;
|
||||
|
||||
@@ -2186,6 +2186,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean canCreateRemoteAnimationTarget() {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean okToDisplay() {
|
||||
final DisplayContent dc = getDisplayContent();
|
||||
return dc != null && dc.okToDisplay();
|
||||
|
||||
Reference in New Issue
Block a user