Fix persistent tasks and expand scope

- Fixed missing tag closure on the xml for storing Intent categories.
- Shortened timeout for flushing tasks to persistent storage from
one minute to ten seconds.
- Made persistency the default except for those tasks on the home
stack and those tasks that exclude themselves from the recent task
list.
- Fixed deletion of tasks after restoring. Tasks now survive a second
reboot, not just the first reboot.
- Fixed sort order so most recent tasks will be restored at front.

Fixes bug 15672002.

Change-Id: I16d87d58c6fd2e879cfd0c0b18b2694432a79b71
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 6e53a6fb..3dfa78b 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -7375,6 +7375,7 @@
             for (int categoryNdx = mCategories.size() - 1; categoryNdx >= 0; --categoryNdx) {
                 out.attribute(null, ATTR_CATEGORY, mCategories.valueAt(categoryNdx));
             }
+            out.endTag(null, TAG_CATEGORIES);
         }
     }