Not resume the invisible TaskFragment when resume top Task
When a TaskFragment is covered by another resumed TaskFragment, this call would try to resume the activity in the invisible TaskFragment as well. However, because the activity would not be visible, so it would also be called to pause, which would then call to resume the top Task. It resulted a infinite recurring call of [resume, pause, ...] Bug: 189385903 Test: manually with splite demo app Change-Id: I561fec516f0585695e71508c00946355ab0764bb
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user