Implement maxRecents and fix TaskPersister bug

Activities can now set the maximum number of times that they will
appear in the recent task lists when using DocCentric mode. The
default number is 15, the min 1, and the max 100.

Also a bug in TaskPersister that deleted files because it did not
properly parse their task ids is fixed.

Fixes bug 13736052.

Change-Id: I7ccb4e6f89d6202ff31c8577bb7b9d8d1b7e5e8d
diff --git a/services/core/java/com/android/server/am/TaskPersister.java b/services/core/java/com/android/server/am/TaskPersister.java
index 3bfaca9..bb289fa 100644
--- a/services/core/java/com/android/server/am/TaskPersister.java
+++ b/services/core/java/com/android/server/am/TaskPersister.java
@@ -227,7 +227,7 @@
         for (int fileNdx = 0; fileNdx < files.length; ++fileNdx) {
             File file = files[fileNdx];
             String filename = file.getName();
-            final int taskIdEnd = filename.indexOf('_') + 1;
+            final int taskIdEnd = filename.indexOf('_');
             if (taskIdEnd > 0) {
                 final int taskId;
                 try {