Allow task fragment to use higher animation level
The method canCreateRemoteAnimationTarget was used to decide whether to promote the animation level for transition. E.g. If 2 activities in task fragment of the same task are opening, the animation target should be the task instead of the 2 activities individually. The method createRemoteAnimationTarget is also moved from Task to TaskFragment for consistency of the ability to create the animation target. Test: Move a task with embedded activities to front. Bug: 194673563 Change-Id: I51aed380d0a20ce7981bf5d1911dfa82d8b54165
This commit is contained in:
@@ -180,7 +180,6 @@ import android.util.TypedXmlSerializer;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
import android.view.DisplayInfo;
|
||||
import android.view.RemoteAnimationAdapter;
|
||||
import android.view.RemoteAnimationTarget;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceControl;
|
||||
import android.view.WindowManager;
|
||||
@@ -3031,18 +3030,6 @@ class Task extends TaskFragment {
|
||||
return isAnimating(CHILDREN, ANIMATION_TYPE_RECENTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
RemoteAnimationTarget createRemoteAnimationTarget(
|
||||
RemoteAnimationController.RemoteAnimationRecord record) {
|
||||
final ActivityRecord activity = getTopMostActivity();
|
||||
return activity != null ? activity.createRemoteAnimationTarget(record) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean canCreateRemoteAnimationTarget() {
|
||||
return true;
|
||||
}
|
||||
|
||||
WindowState getTopVisibleAppMainWindow() {
|
||||
final ActivityRecord activity = getTopVisibleActivity();
|
||||
return activity != null ? activity.findMainWindow() : null;
|
||||
|
||||
@@ -83,6 +83,7 @@ import android.util.DisplayMetrics;
|
||||
import android.util.Slog;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
import android.view.DisplayInfo;
|
||||
import android.view.RemoteAnimationTarget;
|
||||
import android.view.SurfaceControl;
|
||||
import android.window.ITaskFragmentOrganizer;
|
||||
import android.window.TaskFragmentInfo;
|
||||
@@ -1486,6 +1487,18 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
||||
// No app transition applied to the task fragment.
|
||||
}
|
||||
|
||||
@Override
|
||||
RemoteAnimationTarget createRemoteAnimationTarget(
|
||||
RemoteAnimationController.RemoteAnimationRecord record) {
|
||||
final ActivityRecord activity = getTopMostActivity();
|
||||
return activity != null ? activity.createRemoteAnimationTarget(record) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean canCreateRemoteAnimationTarget() {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean shouldSleepActivities() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user