diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-09-25 23:01:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-25 23:01:26 +0000 |
commit | be17a61447e1a7992a6c855059a3c43ab3216610 (patch) | |
tree | 8a47074a45f591ec5353044cd2c963239629c4f5 /core/java/com | |
parent | c499f5b2f7713507541ef655f65fbe154b34070a (diff) | |
parent | e66c1778f80f4b18e29e018eca3a338f125f23b9 (diff) | |
download | frameworks_base-be17a61447e1a7992a6c855059a3c43ab3216610.zip frameworks_base-be17a61447e1a7992a6c855059a3c43ab3216610.tar.gz frameworks_base-be17a61447e1a7992a6c855059a3c43ab3216610.tar.bz2 |
Merge "Require that persistable Uri permissions be taken." into klp-dev
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/util/XmlUtils.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/com/android/internal/util/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java index f40f48c..0b74cf3 100644 --- a/core/java/com/android/internal/util/XmlUtils.java +++ b/core/java/com/android/internal/util/XmlUtils.java @@ -931,6 +931,15 @@ public class XmlUtils { out.attribute(null, name, Integer.toString(value)); } + public static long readLongAttribute(XmlPullParser in, String name, long defaultValue) { + final String value = in.getAttributeValue(null, name); + try { + return Long.parseLong(value); + } catch (NumberFormatException e) { + return defaultValue; + } + } + public static long readLongAttribute(XmlPullParser in, String name) throws IOException { final String value = in.getAttributeValue(null, name); try { |