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

Commit 34740404 authored by Craig Mautner's avatar Craig Mautner
Browse files

Make an exception for screenshot optimization.

Screenshots were not being made for tasks with the flag
FLAG_EXCLUDE_FROM_RECENTS set. But if the task is in the foreground
the shot should be taken even with the flag set. This fix adds a test
for tasks being in the foreground.

Fixes bug 11170567.

Change-Id: If42db7f43ed1dd8d2b16b68824adc813b31c94f0
parent 1db8cf12
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6640,6 +6640,10 @@ public final class ActivityManagerService extends ActivityManagerNative
        return list;
    }
    TaskRecord getMostRecentTask() {
        return mRecentTasks.get(0);
    }
    @Override
    public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
            int flags, int userId) {
+2 −2
Original line number Diff line number Diff line
@@ -674,8 +674,8 @@ final class ActivityStack {
        }

        TaskRecord tr = who.task;
        if (tr.intent != null && (tr.intent.getFlags()
                &Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0) {
        if (mService.getMostRecentTask() != tr && tr.intent != null &&
                (tr.intent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0) {
            // If this task is being excluded from recents, we don't want to take
            // the expense of capturing a thumbnail, since we will never show it.
            return null;