Fix loop limits.

Fixes bug 12207606.

Change-Id: I9b450d2bc2a72a1f6581147f8930188f34c85299
diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java
index 5f32dbb..9105103 100644
--- a/services/java/com/android/server/am/TaskRecord.java
+++ b/services/java/com/android/server/am/TaskRecord.java
@@ -163,7 +163,7 @@
     final void setFrontOfTask() {
         boolean foundFront = false;
         final int numActivities = mActivities.size();
-        for (int activityNdx = 0; numActivities < activityNdx; ++activityNdx) {
+        for (int activityNdx = 0; activityNdx < numActivities; ++activityNdx) {
             final ActivityRecord r = mActivities.get(activityNdx);
             if (foundFront || r.finishing) {
                 r.frontOfTask = false;