Merge "Request legacy app transition when moveActivityToFront" into tm-qpr-dev am: 1ab52b08b3

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

Change-Id: If46682e1d61f9dfb589b52649cffe36a9c6fa9a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chris Li
2022-11-30 17:12:30 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 0 deletions

View File

@@ -53,7 +53,9 @@ import static android.content.pm.ActivityInfo.LAUNCH_SINGLE_TOP;
import static android.content.pm.ActivityInfo.launchModeToString;
import static android.os.Process.INVALID_UID;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_START_ACTIVITY_IN_TASK_FRAGMENT;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_CONFIGURATION;
@@ -2121,6 +2123,11 @@ class ActivityStarter {
if (actuallyMoved) {
// Only record if the activity actually moved.
mMovedToTopActivity = act;
if (mNoAnimation) {
act.mDisplayContent.prepareAppTransition(TRANSIT_NONE);
} else {
act.mDisplayContent.prepareAppTransition(TRANSIT_TO_FRONT);
}
}
act.updateOptionsLocked(mOptions);
deliverNewIntent(act, intentGrants);

View File

@@ -2605,6 +2605,14 @@ class TaskFragment extends WindowContainer<WindowContainer> {
return false;
}
@Override
boolean canCustomizeAppTransition() {
// This is only called when the app transition is going to be played by system server. In
// this case, we should allow custom app transition for fullscreen embedded TaskFragment
// just like Activity.
return isEmbedded() && matchParentBounds();
}
/** Clear {@link #mLastPausedActivity} for all {@link TaskFragment} children */
void clearLastPausedActivity() {
forAllTaskFragments(taskFragment -> taskFragment.mLastPausedActivity = null);