public static void writeBooleanArrayXml(boolean[] val, String name, XmlSerializer out)
            throws XmlPullParserException, IOException {

        if (val == null) {
            out.startTag(null, "null");
            out.endTag(null, "null");
            return;
        }

        out.startTag(null, "boolean-array");
        if (name != null) {
            out.attribute(null, "name", name);
        }

        final int n = val.length;
        out.attribute(null, "num", Integer.toString(n));

        for (int i = 0; i < n; i++) {
            out.startTag(null, "item");
            out.attribute(null, "value", Boolean.toString(val[i]));
            out.endTag(null, "item");
        }

        out.endTag(null, "boolean-array");
    }
Flatten a boolean[] into an XmlSerializer.  The list can later be read back
global readThisBooleanArrayXml().

@param val  The boolean array to be flattened.
@param name Name attribute to include global this array's tag, or null for
            none.
@param out  XmlSerializer to write the array into.
@see #writeMapXml
@see #writeValueXml
@see #readThisIntArrayXml
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/XmlUtils.java