File tree Expand file tree Collapse file tree
services/core/java/com/android/server/am Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -435,7 +435,8 @@ final void addLocked(TaskRecord task) {
435435 */
436436 int trimForTaskLocked (TaskRecord task , boolean doTrim ) {
437437 int recentsCount = size ();
438- final boolean document = task .intent != null && task .intent .isDocument ();
438+ final Intent intent = task .intent ;
439+ final boolean document = intent != null && intent .isDocument ();
439440 int maxRecents = task .maxRecents - 1 ;
440441 for (int i = 0 ; i < recentsCount ; i ++) {
441442 final TaskRecord tr = get (i );
@@ -446,12 +447,13 @@ int trimForTaskLocked(TaskRecord task, boolean doTrim) {
446447 if (i > MAX_RECENT_BITMAPS ) {
447448 tr .freeLastThumbnail ();
448449 }
450+ final Intent trIntent = tr .intent ;
449451 final boolean sameAffinity =
450452 task .affinity != null && task .affinity .equals (tr .affinity );
451- final boolean trIsDocument = tr .intent != null && tr .intent .isDocument ();
453+ final boolean sameIntent = (intent != null && intent .filterEquals (trIntent ));
454+ final boolean trIsDocument = trIntent != null && trIntent .isDocument ();
452455 final boolean bothDocuments = document && trIsDocument ;
453- if (!sameAffinity && !bothDocuments ) {
454- // Not the same affinity and not documents. Move along...
456+ if (!sameAffinity && !sameIntent && !bothDocuments ) {
455457 continue ;
456458 }
457459
You can’t perform that action at this time.
0 commit comments