Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f66560d6 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Put ResovlerActivity and noDisplay activities in the source task"

parents b90a8813 85ee6548
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -477,8 +477,8 @@ final class ActivityRecord {
        }
    }

    boolean isNotResolverActivity() {
        return !ResolverActivity.class.getName().equals(realActivity.getClassName());
    boolean isResolverActivity() {
        return ResolverActivity.class.getName().equals(realActivity.getClassName());
    }

    ActivityRecord(ActivityManagerService _service, ProcessRecord _caller,
@@ -605,7 +605,7 @@ final class ActivityRecord {
                    _intent.getData() == null &&
                    _intent.getType() == null &&
                    (intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0 &&
                    isNotResolverActivity()) {
                    !isResolverActivity()) {
                // This sure looks like a home activity!
                mActivityType = HOME_ACTIVITY_TYPE;
            } else if (realActivity.getClassName().contains(RECENTS_PACKAGE_NAME)) {
+1 −1
Original line number Diff line number Diff line
@@ -1153,7 +1153,7 @@ final class ActivityStack {
        next.results = null;
        next.newIntents = null;

        if (next.isHomeActivity() && next.isNotResolverActivity()) {
        if (next.isHomeActivity()) {
            ProcessRecord app = next.task.mActivities.get(0).app;
            if (app != null && app != mService.mHomeProcess) {
                mService.mHomeProcess = app;
+9 −1
Original line number Diff line number Diff line
@@ -1262,7 +1262,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
                        r.userId, System.identityHashCode(r),
                        task.taskId, r.shortComponentName);
            }
            if (r.isHomeActivity() && r.isNotResolverActivity()) {
            if (r.isHomeActivity()) {
                // Home process is the root process of the task.
                mService.mHomeProcess = task.mActivities.get(0).app;
            }
@@ -2024,6 +2024,14 @@ public final class ActivityStackSupervisor implements DisplayListener {
            reuseTask = inTask;
        } else {
            inTask = null;
            // Launch ResolverActivity in the source task, so that it stays in the task
            // bounds when in freeform workspace.
            // Also put noDisplay activities in the source task. These by itself can
            // be placed in any task/stack, however it could launch other activities
            // like ResolverActivity, and we want those to stay in the original task.
            if (r.isResolverActivity() || r.noDisplay) {
                addingToTask = true;
            }
        }

        if (inTask == null) {