Only set ready early in AR.finish if it is a self-contained op
Otherwise, it will cause early-ready during, eg, clearTop
launches which can lead to flickers.
Bug: 273206473
Test: Launch messages, go home, launch phone, pick a contact, then
pick "text". Observe, no black-flash.
Change-Id: I1badf42914514f3922bc3f6ef67eaa7f10711c84
This commit is contained in:
@@ -3522,7 +3522,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
|
||||
final boolean endTask = task.getTopNonFinishingActivity() == null
|
||||
&& !task.isClearingToReuseTask();
|
||||
mTransitionController.requestCloseTransitionIfNeeded(endTask ? task : this);
|
||||
final Transition newTransition =
|
||||
mTransitionController.requestCloseTransitionIfNeeded(endTask ? task : this);
|
||||
if (isState(RESUMED)) {
|
||||
if (endTask) {
|
||||
mAtmService.getTaskChangeNotificationController().notifyTaskRemovalStarted(
|
||||
@@ -3576,7 +3577,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
} else if (!isState(PAUSING)) {
|
||||
if (mVisibleRequested) {
|
||||
// Prepare and execute close transition.
|
||||
prepareActivityHideTransitionAnimation();
|
||||
if (mTransitionController.isShellTransitionsEnabled()) {
|
||||
setVisibility(false);
|
||||
if (newTransition != null) {
|
||||
// This is a transition specifically for this close operation, so set
|
||||
// ready now.
|
||||
newTransition.setReady(mDisplayContent, true);
|
||||
}
|
||||
} else {
|
||||
prepareActivityHideTransitionAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
final boolean removedActivity = completeFinishing("finishIfPossible") == null;
|
||||
|
||||
@@ -577,12 +577,16 @@ class TransitionController {
|
||||
return transition;
|
||||
}
|
||||
|
||||
/** Requests transition for a window container which will be removed or invisible. */
|
||||
void requestCloseTransitionIfNeeded(@NonNull WindowContainer<?> wc) {
|
||||
if (mTransitionPlayer == null) return;
|
||||
/**
|
||||
* Requests transition for a window container which will be removed or invisible.
|
||||
* @return the new transition if it was created for this request, `null` otherwise.
|
||||
*/
|
||||
Transition requestCloseTransitionIfNeeded(@NonNull WindowContainer<?> wc) {
|
||||
if (mTransitionPlayer == null) return null;
|
||||
Transition out = null;
|
||||
if (wc.isVisibleRequested()) {
|
||||
if (!isCollecting()) {
|
||||
requestStartTransition(createTransition(TRANSIT_CLOSE, 0 /* flags */),
|
||||
out = requestStartTransition(createTransition(TRANSIT_CLOSE, 0 /* flags */),
|
||||
wc.asTask(), null /* remoteTransition */, null /* displayChange */);
|
||||
}
|
||||
collectExistenceChange(wc);
|
||||
@@ -591,6 +595,7 @@ class TransitionController {
|
||||
// collecting, this should be a member just in case.
|
||||
collect(wc);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** @see Transition#collect */
|
||||
|
||||
Reference in New Issue
Block a user