From a3bc565882dd3984e995363642b1295fe3d24d10 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 17 Apr 2012 11:42:25 -0700 Subject: Add persistence for selected keyboard layout. Bug: 6110399 Change-Id: I99544bf05e9755385bee478b5f047ccec2e5cae3 --- core/java/com/android/internal/util/XmlUtils.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/java/com') diff --git a/core/java/com/android/internal/util/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java index e00a853..6a09fe0 100644 --- a/core/java/com/android/internal/util/XmlUtils.java +++ b/core/java/com/android/internal/util/XmlUtils.java @@ -888,4 +888,19 @@ public class XmlUtils ; } } + + public static boolean nextElementWithin(XmlPullParser parser, int outerDepth) + throws IOException, XmlPullParserException { + for (;;) { + int type = parser.next(); + if (type == XmlPullParser.END_DOCUMENT + || (type == XmlPullParser.END_TAG && parser.getDepth() == outerDepth)) { + return false; + } + if (type == XmlPullParser.START_TAG + && parser.getDepth() == outerDepth + 1) { + return true; + } + } + } } -- cgit v1.1