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

Commit 76e2a765 authored by Craig Mautner's avatar Craig Mautner
Browse files

Don't set return to recents on every resume

Checking for previous task to be the Recents activity every time
through resumeTopActivityLocked() leads to missetting the
mTaskToReturnTo to Recents for Recents. Instead check for
Recents launching a task in moveTaskToFront and startActivity.

Fixes bug 15832448.

Change-Id: Ib64fe26f3fd3fdcd878edafb041928ec02757e63
parent 3dd5118b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7522,6 +7522,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                    Slog.e(TAG, "moveTaskToFront: Attempt to violate Lock Task Mode");
                    return;
                }
                final ActivityRecord prev = mStackSupervisor.topRunningActivityLocked();
                if (prev != null && prev.isRecentsActivity()) {
                    task.setTaskToReturnTo(ActivityRecord.RECENTS_ACTIVITY_TYPE);
                }
                mStackSupervisor.findTaskToMoveToFrontLocked(task, flags, options);
            } finally {
                Binder.restoreCallingIdentity(origId);
+0 −3
Original line number Diff line number Diff line
@@ -1443,9 +1443,6 @@ final class ActivityStack {
                        mStackSupervisor.resumeHomeStackTask(returnTaskType, prev);
            }
        }
        if (prev != null && prev.isRecentsActivity()) {
            nextTask.setTaskToReturnTo(RECENTS_ACTIVITY_TYPE);
        }

        // If we are sleeping, and there is no resumed activity, and the top
        // activity is paused, well that is the state we want.
+3 −0
Original line number Diff line number Diff line
@@ -1981,6 +1981,9 @@ public final class ActivityStackSupervisor implements DisplayListener {
        mService.grantUriPermissionFromIntentLocked(callingUid, r.packageName,
                intent, r.getUriPermissionsLocked(), r.userId);

        if (sourceRecord != null && sourceRecord.isRecentsActivity()) {
            r.task.setTaskToReturnTo(RECENTS_ACTIVITY_TYPE);
        }
        if (newTask) {
            EventLog.writeEvent(EventLogTags.AM_CREATE_TASK, r.userId, r.task.taskId);
        }