From c8c8425b51a4f68fae993e68b357679ca27d155d Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Sun, 13 Jul 2014 17:12:12 -0700 Subject: App restrictions schema and parser Documented the restrictions schema in RestrictionsManager docs. Added a parser to read the meta-data and XML file on the device. Added more types and methods in RestrictionEntry to accomodate some new types and construction modes. Added a styleable for restriction attributes. Slight tweak to permission response params. Bug: 14582645 Change-Id: I193d1162741d110c100831cab33b48e2baf7426c --- core/java/android/content/RestrictionEntry.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'core/java/android/content/RestrictionEntry.java') diff --git a/core/java/android/content/RestrictionEntry.java b/core/java/android/content/RestrictionEntry.java index 62f88a9d29b1..5341ea802a7a 100644 --- a/core/java/android/content/RestrictionEntry.java +++ b/core/java/android/content/RestrictionEntry.java @@ -79,6 +79,13 @@ public class RestrictionEntry implements Parcelable { */ public static final int TYPE_INTEGER = 5; + /** + * A type of restriction. Use this for storing a string value. + * @see #setSelectedString + * @see #getSelectedString + */ + public static final int TYPE_STRING = 6; + /** The type of restriction. */ private int mType; @@ -106,6 +113,17 @@ public class RestrictionEntry implements Parcelable { /* List of selected choices in the multi-select case. */ private String[] mCurrentValues; + /** + * Constructor for specifying the type and key, with no initial value; + * + * @param type the restriction type. + * @param key the unique key for this restriction + */ + public RestrictionEntry(int type, String key) { + mType = type; + mKey = key; + } + /** * Constructor for {@link #TYPE_CHOICE} type. * @param key the unique key for this restriction -- cgit v1.2.3