OSDN Git Service

Fix frontOfTask assignment.
authorDanny Baumann <dannybaumann@web.de>
Sun, 22 Jun 2014 14:55:36 +0000 (16:55 +0200)
committerDanny Baumann <dannybaumann@web.de>
Mon, 23 Jun 2014 06:43:37 +0000 (08:43 +0200)
If all activities of a given stack were finishing, no activity was
marked as front-of-task. This confused ActivityManager, so make sure
there's always exactly one activity marked as front-of-task.

Change-Id: I087cbe10280d4a60aa5ccfaefe24a223523fb3f2

services/java/com/android/server/am/TaskRecord.java

index 9105103..9c4b7d1 100644 (file)
@@ -173,6 +173,11 @@ final class TaskRecord extends ThumbnailHolder {
                 foundFront = true;
             }
         }
+        if (!foundFront && numActivities > 0) {
+            // All activities of this task are finishing. As we ought to have a frontOfTask
+            // activity, make the bottom activity front.
+            mActivities.get(0).frontOfTask = true;
+        }
     }
 
     /**