Fix check when finding tasks to reuse.
am: 91e5c886c8
Change-Id: Ica5af20f308ff5c059cef39685aaaa62809ce531
This commit is contained in:
@@ -23,6 +23,7 @@ import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.RECENTS_STACK_ID;
|
||||
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_LAYOUT;
|
||||
import static android.content.pm.ActivityInfo.FLAG_RESUME_WHILE_PAUSING;
|
||||
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
|
||||
@@ -800,6 +801,10 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
|
||||
return mStackId == HOME_STACK_ID;
|
||||
}
|
||||
|
||||
final boolean isRecentsStack() {
|
||||
return mStackId == RECENTS_STACK_ID;
|
||||
}
|
||||
|
||||
final boolean isHomeOrRecentsStack() {
|
||||
return StackId.isHomeOrRecentsStack(mStackId);
|
||||
}
|
||||
|
||||
@@ -3025,8 +3025,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
|
||||
final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
|
||||
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
|
||||
final ActivityStack stack = stacks.get(stackNdx);
|
||||
if (!r.isApplicationActivity() && !stack.isHomeOrRecentsStack()) {
|
||||
if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Skipping stack: (home activity) " + stack);
|
||||
if (!checkActivityBelongsInStack(r, stack)) {
|
||||
if (DEBUG_TASKS) Slog.d(TAG_TASKS, "Skipping stack: (mismatch activity/stack) "
|
||||
+ stack);
|
||||
continue;
|
||||
}
|
||||
if (!stack.mActivityContainer.isEligibleForNewTasks()) {
|
||||
@@ -3053,6 +3054,21 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
|
||||
return affinityMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that for the given activity {@param r}, its activity type matches the {@param stack}
|
||||
* type.
|
||||
*/
|
||||
private boolean checkActivityBelongsInStack(ActivityRecord r, ActivityStack stack) {
|
||||
if (r.isHomeActivity()) {
|
||||
return stack.isHomeStack();
|
||||
} else if (r.isRecentsActivity()) {
|
||||
return stack.isRecentsStack();
|
||||
} else if (r.isAssistantActivity()) {
|
||||
return stack.isAssistantStack();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ActivityRecord findActivityLocked(Intent intent, ActivityInfo info,
|
||||
boolean compareIntentFilters) {
|
||||
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
|
||||
|
||||
Reference in New Issue
Block a user