Merge "Request legacy app transition when moveActivityToFront" into tm-qpr-dev

This commit is contained in:
Chris Li
2022-11-30 02:51:28 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 0 deletions

View File

@@ -55,7 +55,9 @@ import static android.content.pm.ActivityInfo.launchModeToString;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
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;
@@ -2398,6 +2400,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);