java.lang.Object | |
↳ | android.content.RestrictionEntry |
Applications can expose restrictions for a restricted user on a multiuser device. The administrator can configure these restrictions that will then be applied to the restricted user. Each RestrictionsEntry is one configurable restriction.
Any application that chooses to expose such restrictions does so by implementing a receiver that handles theACTION_GET_RESTRICTION_ENTRIES
action.
The receiver then returns a result bundle that contains an entry called "restrictions", whose
value is an ArrayListConstants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | TYPE_BOOLEAN | A type of restriction. | |||||||||
int | TYPE_CHOICE | A type of restriction. | |||||||||
int | TYPE_MULTI_SELECT | A type of restriction. | |||||||||
int | TYPE_NULL | A type of restriction. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for
TYPE_CHOICE type. | |||||||||||
Constructor for
TYPE_BOOLEAN type. | |||||||||||
Constructor for
TYPE_MULTI_SELECT type. | |||||||||||
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Compares this instance with the specified object and indicates if they
are equal.
| |||||||||||
Returns the list of currently selected values.
| |||||||||||
Returns the list of strings, set earlier, that will be presented as choices to the user.
| |||||||||||
Returns the list of possible string values set earlier.
| |||||||||||
Returns the provided user-visible description of the entry, if any.
| |||||||||||
This is the unique key for the restriction entry.
| |||||||||||
Returns the current selected state for an entry of type
TYPE_BOOLEAN . | |||||||||||
Returns the currently selected string value.
| |||||||||||
Returns the user-visible title for the entry, if any.
| |||||||||||
Returns the type for this restriction.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Sets the current list of selected values for an entry of type
TYPE_MULTI_SELECT . | |||||||||||
Sets a list of strings that will be presented as choices to the user.
| |||||||||||
Sets a list of strings that will be presented as choices to the user.
| |||||||||||
Sets a list of string values that can be selected by the user.
| |||||||||||
Sets a list of string values that can be selected by the user, similar to
setChoiceValues(String[]) . | |||||||||||
Sets the user-visible description of the entry, as a possible sub-text for the title.
| |||||||||||
Sets the current selected state for an entry of type
TYPE_BOOLEAN . | |||||||||||
Sets the string value to use as the selected value for this restriction.
| |||||||||||
Sets the user-visible title for the entry.
| |||||||||||
Sets the type for this restriction.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
A type of restriction. Use this for storing a boolean value, typically presented as a checkbox in the UI.
A type of restriction. Use this for storing a string value, typically presented as
a single-select list. Call setChoiceEntries(String[])
and
setChoiceValues(String[])
to set the localized list entries to present to the user
and the corresponding values, respectively.
A type of restriction. Use this for presenting a multi-select list where more than one
entry can be selected, such as for choosing specific titles to white-list.
Call setChoiceEntries(String[])
and
setChoiceValues(String[])
to set the localized list entries to present to the user
and the corresponding values, respectively.
Use getAllSelectedStrings()
and setAllSelectedStrings(String[])
to
manipulate the selections.
A type of restriction. Use this type for information that needs to be transferred across but shouldn't be presented to the user in the UI. Stores a single String value.
Constructor for TYPE_CHOICE
type.
key | the unique key for this restriction |
---|---|
selectedString | the current value |
Constructor for TYPE_BOOLEAN
type.
key | the unique key for this restriction |
---|---|
selectedState | whether this restriction is selected or not |
Constructor for TYPE_MULTI_SELECT
type.
key | the unique key for this restriction |
---|---|
selectedStrings | the list of values that are currently selected |
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Compares this instance with the specified object and indicates if they
are equal. In order to be equal, o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
o | the object to compare this instance with. |
---|
true
if the specified object is equal to this Object
; false
otherwise.Returns the list of currently selected values.
TYPE_MULTI_SELECT
,
null otherwise.
Returns the list of strings, set earlier, that will be presented as choices to the user.
Returns the list of possible string values set earlier.
Returns the provided user-visible description of the entry, if any.
This is the unique key for the restriction entry.
Returns the current selected state for an entry of type TYPE_BOOLEAN
.
Returns the currently selected string value.
Returns the user-visible title for the entry, if any.
Returns the type for this restriction.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
Sets the current list of selected values for an entry of type TYPE_MULTI_SELECT
.
These values will be persisted by the system for later use by the application.
allSelectedStrings | the current list of selected values. |
---|
Sets a list of strings that will be presented as choices to the user. This is similar to
setChoiceEntries(String[])
.
context | the application context, used for retrieving the resources. |
---|---|
stringArrayResId | the resource id of a string array containing the possible entries. |
Sets a list of strings that will be presented as choices to the user. When the
user selects one or more of these choices, the corresponding value from the possible values
are stored as the selected strings. The size of this array must match the size of the array
set in setChoiceValues(String[])
. This method is not relevant for types other
than TYPE_CHOICE
, and TYPE_MULTI_SELECT
.
choiceEntries | the list of user-visible choices. |
---|
Sets a list of string values that can be selected by the user. If no user-visible entries
are set by a call to setChoiceEntries(String[])
, these values will be the ones
shown to the user. Values will be chosen from this list as the user's selection and the
selected values can be retrieved by a call to getAllSelectedStrings()
, or
getSelectedString()
, depending on whether it is a multi-select type or choice type.
This method is not relevant for types other than
TYPE_CHOICE
, and TYPE_MULTI_SELECT
.
choiceValues | an array of Strings which will be the selected values for the user's selections. |
---|
Sets a list of string values that can be selected by the user, similar to
setChoiceValues(String[])
.
context | the application context for retrieving the resources. |
---|---|
stringArrayResId | the resource id for a string array containing the possible values. |
Sets the user-visible description of the entry, as a possible sub-text for the title. You can use this to describe the entry in more detail or to display the current state of the restriction.
description | the user-visible description string. |
---|
Sets the current selected state for an entry of type TYPE_BOOLEAN
. This value will
be persisted by the system for later use by the application.
state | the current selected state |
---|
Sets the string value to use as the selected value for this restriction. This value will be persisted by the system for later use by the application.
selectedString | the string value to select. |
---|
Sets the user-visible title for the entry.
title | the user-visible title for the entry. |
---|
Sets the type for this restriction.
type | the type for this restriction. |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Flatten this object in to a Parcel.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|