Improve configuration of default preferred apps.

The file that defines default preferred apps is now more
robust.  It is no longer a raw dump of the package
manager settings, but instead a more general list of a
target activity and filter.  When reading it, the remaining
information (match value, set of potential matches) is
determined dynamically.

Change-Id: I0edc6e0d2ed3dd2a6e2238992f18f7fc1f51d8d4
diff --git a/services/java/com/android/server/PreferredComponent.java b/services/java/com/android/server/PreferredComponent.java
index 718b05d..bb22545 100644
--- a/services/java/com/android/server/PreferredComponent.java
+++ b/services/java/com/android/server/PreferredComponent.java
@@ -164,17 +164,19 @@
         return mParseError;
     }
 
-    public void writeToXml(XmlSerializer serializer) throws IOException {
+    public void writeToXml(XmlSerializer serializer, boolean full) throws IOException {
         final int NS = mSetClasses != null ? mSetClasses.length : 0;
         serializer.attribute(null, "name", mShortComponent);
-        if (mMatch != 0) {
-            serializer.attribute(null, "match", Integer.toHexString(mMatch));
-        }
-        serializer.attribute(null, "set", Integer.toString(NS));
-        for (int s=0; s<NS; s++) {
-            serializer.startTag(null, "set");
-            serializer.attribute(null, "name", mSetComponents[s]);
-            serializer.endTag(null, "set");
+        if (full) {
+            if (mMatch != 0) {
+                serializer.attribute(null, "match", Integer.toHexString(mMatch));
+            }
+            serializer.attribute(null, "set", Integer.toString(NS));
+            for (int s=0; s<NS; s++) {
+                serializer.startTag(null, "set");
+                serializer.attribute(null, "name", mSetComponents[s]);
+                serializer.endTag(null, "set");
+            }
         }
     }