Merge "Execute app transition if starting window is drawn" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e8db079138
@@ -5777,10 +5777,24 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onStartingWindowDrawn() {
|
void onStartingWindowDrawn() {
|
||||||
|
boolean wasTaskVisible = false;
|
||||||
if (task != null) {
|
if (task != null) {
|
||||||
mSplashScreenStyleEmpty = true;
|
mSplashScreenStyleEmpty = true;
|
||||||
|
wasTaskVisible = task.getHasBeenVisible();
|
||||||
task.setHasBeenVisible(true);
|
task.setHasBeenVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The transition may not be executed if the starting process hasn't attached. But if the
|
||||||
|
// starting window is drawn, the transition can start earlier. Exclude finishing and bubble
|
||||||
|
// because it may be a trampoline.
|
||||||
|
if (!wasTaskVisible && mStartingData != null && !finishing && !mLaunchedFromBubble
|
||||||
|
&& !mDisplayContent.mAppTransition.isReady()
|
||||||
|
&& !mDisplayContent.mAppTransition.isRunning()) {
|
||||||
|
// The pending transition state will be cleared after the transition is started, so
|
||||||
|
// save the state for launching the client later (used by LaunchActivityItem).
|
||||||
|
mStartingData.mIsTransitionForward = mDisplayContent.isNextTransitionForward();
|
||||||
|
mDisplayContent.executeAppTransition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when the windows associated app window container are drawn. */
|
/** Called when the windows associated app window container are drawn. */
|
||||||
@@ -6493,6 +6507,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
|| dc.mChangingContainers.contains(this));
|
|| dc.mChangingContainers.contains(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isTransitionForward() {
|
||||||
|
return (mStartingData != null && mStartingData.mIsTransitionForward)
|
||||||
|
|| mDisplayContent.isNextTransitionForward();
|
||||||
|
}
|
||||||
|
|
||||||
private int getAnimationLayer() {
|
private int getAnimationLayer() {
|
||||||
// The leash is parented to the animation layer. We need to preserve the z-order by using
|
// The leash is parented to the animation layer. We need to preserve the z-order by using
|
||||||
// the prefix order index, but we boost if necessary.
|
// the prefix order index, but we boost if necessary.
|
||||||
@@ -8094,8 +8113,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
preserveWindow);
|
preserveWindow);
|
||||||
final ActivityLifecycleItem lifecycleItem;
|
final ActivityLifecycleItem lifecycleItem;
|
||||||
if (andResume) {
|
if (andResume) {
|
||||||
lifecycleItem = ResumeActivityItem.obtain(
|
lifecycleItem = ResumeActivityItem.obtain(isTransitionForward());
|
||||||
mDisplayContent.isNextTransitionForward());
|
|
||||||
} else {
|
} else {
|
||||||
lifecycleItem = PauseActivityItem.obtain();
|
lifecycleItem = PauseActivityItem.obtain();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -836,7 +836,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
final ClientTransaction clientTransaction = ClientTransaction.obtain(
|
final ClientTransaction clientTransaction = ClientTransaction.obtain(
|
||||||
proc.getThread(), r.appToken);
|
proc.getThread(), r.appToken);
|
||||||
|
|
||||||
final DisplayContent dc = r.mDisplayContent;
|
final boolean isTransitionForward = r.isTransitionForward();
|
||||||
clientTransaction.addCallback(LaunchActivityItem.obtain(new Intent(r.intent),
|
clientTransaction.addCallback(LaunchActivityItem.obtain(new Intent(r.intent),
|
||||||
System.identityHashCode(r), r.info,
|
System.identityHashCode(r), r.info,
|
||||||
// TODO: Have this take the merged configuration instead of separate global
|
// TODO: Have this take the merged configuration instead of separate global
|
||||||
@@ -845,7 +845,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
mergedConfiguration.getOverrideConfiguration(), r.compat,
|
mergedConfiguration.getOverrideConfiguration(), r.compat,
|
||||||
r.launchedFromPackage, task.voiceInteractor, proc.getReportedProcState(),
|
r.launchedFromPackage, task.voiceInteractor, proc.getReportedProcState(),
|
||||||
r.getSavedState(), r.getPersistentSavedState(), results, newIntents,
|
r.getSavedState(), r.getPersistentSavedState(), results, newIntents,
|
||||||
r.takeOptions(), dc.isNextTransitionForward(),
|
r.takeOptions(), isTransitionForward,
|
||||||
proc.createProfilerInfoIfNeeded(), r.assistToken, activityClientController,
|
proc.createProfilerInfoIfNeeded(), r.assistToken, activityClientController,
|
||||||
r.createFixedRotationAdjustmentsIfNeeded(), r.shareableActivityToken,
|
r.createFixedRotationAdjustmentsIfNeeded(), r.shareableActivityToken,
|
||||||
r.getLaunchedFromBubble()));
|
r.getLaunchedFromBubble()));
|
||||||
@@ -853,7 +853,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
// Set desired final state.
|
// Set desired final state.
|
||||||
final ActivityLifecycleItem lifecycleItem;
|
final ActivityLifecycleItem lifecycleItem;
|
||||||
if (andResume) {
|
if (andResume) {
|
||||||
lifecycleItem = ResumeActivityItem.obtain(dc.isNextTransitionForward());
|
lifecycleItem = ResumeActivityItem.obtain(isTransitionForward);
|
||||||
} else {
|
} else {
|
||||||
lifecycleItem = PauseActivityItem.obtain();
|
lifecycleItem = PauseActivityItem.obtain();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ public abstract class StartingData {
|
|||||||
protected final WindowManagerService mService;
|
protected final WindowManagerService mService;
|
||||||
protected final int mTypeParams;
|
protected final int mTypeParams;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell whether the launching activity should use
|
||||||
|
* {@link android.view.WindowManager.LayoutParams#SOFT_INPUT_IS_FORWARD_NAVIGATION}.
|
||||||
|
*/
|
||||||
|
boolean mIsTransitionForward;
|
||||||
|
|
||||||
protected StartingData(WindowManagerService service, int typeParams) {
|
protected StartingData(WindowManagerService service, int typeParams) {
|
||||||
mService = service;
|
mService = service;
|
||||||
mTypeParams = typeParams;
|
mTypeParams = typeParams;
|
||||||
|
|||||||
Reference in New Issue
Block a user