Merge "Not resume the invisible TaskFragment when resume top Task" into sc-v2-dev am: db888014dc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15574561

Change-Id: I81d11eeef9004ac969fe0c3da4772d3ca7e24151
This commit is contained in:
Chris Li
2021-08-18 04:39:15 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 5 deletions

View File

@@ -3114,10 +3114,6 @@ class Task extends TaskFragment {
});
}
boolean isFocusableAndVisible() {
return isTopActivityFocusable() && shouldBeVisible(null /* starting */);
}
void positionChildAtTop(ActivityRecord child) {
positionChildAt(child, POSITION_TOP);
}
@@ -5037,7 +5033,10 @@ class Task extends TaskFragment {
if (topFragment == f) {
return;
}
if (!f.isFocusableAndVisible()) {
// No need to resume activity in TaskFragment that is not visible.
return;
}
resumed[0] |= f.resumeTopActivity(prev, options, deferPause);
}, true);
return resumed[0];

View File

@@ -1262,6 +1262,10 @@ class TaskFragment extends WindowContainer<WindowContainer> {
return getVisibility(starting) != TASK_FRAGMENT_VISIBILITY_INVISIBLE;
}
boolean isFocusableAndVisible() {
return isTopActivityFocusable() && shouldBeVisible(null /* starting */);
}
final boolean startPausing(boolean uiSleeping, ActivityRecord resuming, String reason) {
return startPausing(mTaskSupervisor.mUserLeaving, uiSleeping, resuming, reason);
}