Merge "[RESTRICT AUTOMERGE] Do not resume activity if behind a translucent task" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9eba99f414
@@ -93,7 +93,7 @@ class EnsureActivitiesVisibleHelper {
|
|||||||
// activities are actually behind other fullscreen activities, but still required
|
// activities are actually behind other fullscreen activities, but still required
|
||||||
// to be visible (such as performing Recents animation).
|
// to be visible (such as performing Recents animation).
|
||||||
final boolean resumeTopActivity = mTop != null && !mTop.mLaunchTaskBehind
|
final boolean resumeTopActivity = mTop != null && !mTop.mLaunchTaskBehind
|
||||||
&& mTask.isTopActivityFocusable()
|
&& mTask.canBeResumed(starting)
|
||||||
&& (starting == null || !starting.isDescendantOf(mTask));
|
&& (starting == null || !starting.isDescendantOf(mTask));
|
||||||
|
|
||||||
mTask.forAllActivities(a -> {
|
mTask.forAllActivities(a -> {
|
||||||
|
|||||||
@@ -1948,7 +1948,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (mTaskSupervisor.realStartActivityLocked(r, app,
|
if (mTaskSupervisor.realStartActivityLocked(r, app,
|
||||||
top == r && r.isFocusable() /*andResume*/, true /*checkConfig*/)) {
|
top == r && r.getTask().canBeResumed(r) /*andResume*/,
|
||||||
|
true /*checkConfig*/)) {
|
||||||
mTmpBoolean = true;
|
mTmpBoolean = true;
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
@@ -4240,6 +4240,17 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
return getVisibility(starting) != TASK_VISIBILITY_INVISIBLE;
|
return getVisibility(starting) != TASK_VISIBILITY_INVISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code true} is the activity in this Task can be resumed.
|
||||||
|
*
|
||||||
|
* @param starting The currently starting activity or {@code null} if there is none.
|
||||||
|
*/
|
||||||
|
boolean canBeResumed(@Nullable ActivityRecord starting) {
|
||||||
|
// No need to resume activity in Task that is not visible.
|
||||||
|
return isTopActivityFocusable()
|
||||||
|
&& getVisibility(starting) == TASK_VISIBILITY_VISIBLE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the task should be visible.
|
* Returns true if the task should be visible.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user