Merge "[RESTRICT AUTOMERGE]Don't finish noHistory activity while it is on the topmost." into rvc-qpr-dev

This commit is contained in:
TreeHugger Robot
2020-09-23 09:51:55 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 4 deletions

View File

@@ -1700,8 +1700,9 @@ class ActivityStack extends Task {
// If the most recent activity was noHistory but was only stopped rather
// than stopped+finished because the device went to sleep, we need to make
// sure to finish it as we're making a new activity topmost.
if (shouldSleepActivities() && mLastNoHistoryActivity != null &&
!mLastNoHistoryActivity.finishing) {
if (shouldSleepActivities() && mLastNoHistoryActivity != null
&& !mLastNoHistoryActivity.finishing
&& mLastNoHistoryActivity != next) {
if (DEBUG_STATES) Slog.d(TAG_STATES,
"no-history finish of " + mLastNoHistoryActivity + " on new resume");
mLastNoHistoryActivity.finishIfPossible("resume-no-history", false /* oomAdj */);

View File

@@ -1481,9 +1481,10 @@ class ActivityStarter {
// anyone interested in this piece of information.
final ActivityStack homeStack = targetTask.getDisplayArea().getRootHomeTask();
final boolean homeTaskVisible = homeStack != null && homeStack.shouldBeVisible(null);
final ActivityRecord top = targetTask.getTopNonFinishingActivity();
final boolean visible = top != null && top.isVisible();
mService.getTaskChangeNotificationController().notifyActivityRestartAttempt(
targetTask.getTaskInfo(), homeTaskVisible, clearedTask,
targetTask.getTopNonFinishingActivity().isVisible());
targetTask.getTaskInfo(), homeTaskVisible, clearedTask, visible);
}
}