diff options
| author | 2013-10-11 11:05:35 -0700 | |
|---|---|---|
| committer | 2013-10-11 11:05:35 -0700 | |
| commit | 3474040486ac6c2c351ea7dc7d34a5ce7f2c9c04 (patch) | |
| tree | 07824bfc106649a196c72fcbd383fdba22f69e1a | |
| parent | 1db8cf12a985425a73d24875d9d308c14c0b4359 (diff) | |
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
| -rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 4 | ||||
| -rw-r--r-- | services/java/com/android/server/am/ActivityStack.java | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 4fbbb785cff1..456a0a79918d 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -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) { diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index fc83f050676f..066989b8d631 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -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; |