Merge "Correct activity lifecycle when forcedResize activity is finished" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4570df8fd5
@@ -2017,6 +2017,9 @@ final class ActivityStack {
|
||||
void cancelInitializingActivities() {
|
||||
final ActivityRecord topActivity = topRunningActivityLocked();
|
||||
boolean aboveTop = true;
|
||||
// We don't want to clear starting window for activities that aren't behind fullscreen
|
||||
// activities as we need to display their starting window until they are done initializing.
|
||||
boolean behindFullscreenActivity = false;
|
||||
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
|
||||
final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
|
||||
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
|
||||
@@ -2025,16 +2028,20 @@ final class ActivityStack {
|
||||
if (r == topActivity) {
|
||||
aboveTop = false;
|
||||
}
|
||||
behindFullscreenActivity |= r.fullscreen;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (r.state == ActivityState.INITIALIZING
|
||||
&& r.mStartingWindowState == STARTING_WINDOW_SHOWN) {
|
||||
&& r.mStartingWindowState == STARTING_WINDOW_SHOWN
|
||||
&& behindFullscreenActivity) {
|
||||
if (DEBUG_VISIBILITY) Slog.w(TAG_VISIBILITY,
|
||||
"Found orphaned starting window " + r);
|
||||
r.mStartingWindowState = STARTING_WINDOW_REMOVED;
|
||||
mWindowManager.removeAppStartingWindow(r.appToken);
|
||||
}
|
||||
|
||||
behindFullscreenActivity |= r.fullscreen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1122,7 +1122,8 @@ class ActivityStarter {
|
||||
}
|
||||
final ActivityRecord topTaskActivity = mStartActivity.task.topRunningActivityLocked();
|
||||
if (!mTargetStack.isFocusable()
|
||||
|| (topTaskActivity != null && topTaskActivity.mTaskOverlay)) {
|
||||
|| (topTaskActivity != null && topTaskActivity.mTaskOverlay
|
||||
&& mStartActivity != topTaskActivity)) {
|
||||
// If the activity is not focusable, we can't resume it, but still would like to
|
||||
// make sure it becomes visible as it starts (this will also trigger entry
|
||||
// animation). An example of this are PIP activities.
|
||||
|
||||
Reference in New Issue
Block a user