public final class InputMethodInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<InputMethodInfo> |
CREATOR
Used to make this class parcelable.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
InputMethodInfo(Context context,
ResolveInfo service)
Constructor.
|
InputMethodInfo(Context context,
ResolveInfo service,
Map<String,List<InputMethodSubtype>> additionalSubtypesMap)
Constructor.
|
InputMethodInfo(String packageName,
String className,
CharSequence label,
String settingsActivity)
Temporary API for creating a built-in input method.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
void |
dump(Printer pw,
String prefix) |
boolean |
equals(Object o)
Used to test whether the given parameter object is an
InputMethodInfo and its Id is the same to this one. |
ComponentName |
getComponent()
Return the component of the service that implements this input
method.
|
String |
getId()
Return a unique ID for this input method.
|
int |
getIsDefaultResourceId()
Return the resource identifier of a resource inside of this input
method's .apk that determines whether it should be considered a
default input method for the system.
|
String |
getPackageName()
Return the .apk package that implements this input method.
|
ServiceInfo |
getServiceInfo()
Return the raw information about the Service implementing this
input method.
|
String |
getServiceName()
Return the class name of the service component that implements
this input method.
|
String |
getSettingsActivity()
Return the class name of an activity that provides a settings UI for
the input method.
|
InputMethodSubtype |
getSubtypeAt(int index)
Return the Input Method's subtype at the specified index.
|
int |
getSubtypeCount()
Return the count of the subtypes of Input Method.
|
int |
hashCode()
Returns an integer hash code for this object.
|
boolean |
isAuxiliaryIme() |
Drawable |
loadIcon(PackageManager pm)
Load the user-displayed icon for this input method.
|
CharSequence |
loadLabel(PackageManager pm)
Load the user-displayed label for this input method.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
void |
writeToParcel(Parcel dest,
int flags)
Used to package this object into a
Parcel . |
public static final Parcelable.Creator<InputMethodInfo> CREATOR
public InputMethodInfo(Context context, ResolveInfo service) throws XmlPullParserException, IOException
context
- The Context in which we are parsing the input method.service
- The ResolveInfo returned from the package manager about
this input method's component.XmlPullParserException
IOException
public InputMethodInfo(Context context, ResolveInfo service, Map<String,List<InputMethodSubtype>> additionalSubtypesMap) throws XmlPullParserException, IOException
context
- The Context in which we are parsing the input method.service
- The ResolveInfo returned from the package manager about
this input method's component.additionalSubtypes
- additional subtypes being added to this InputMethodInfoXmlPullParserException
IOException
public InputMethodInfo(String packageName, String className, CharSequence label, String settingsActivity)
public String getId()
public String getPackageName()
public String getServiceName()
public ServiceInfo getServiceInfo()
public ComponentName getComponent()
public CharSequence loadLabel(PackageManager pm)
pm
- Supply a PackageManager used to load the input method's
resources.public Drawable loadIcon(PackageManager pm)
pm
- Supply a PackageManager used to load the input method's
resources.public String getSettingsActivity()
Intent
whose action is MAIN and with an
explicit ComponentName
composed of getPackageName()
and the class name returned here.
A null will be returned if there is no settings activity associated with the input method.
public int getSubtypeCount()
public InputMethodSubtype getSubtypeAt(int index)
index
- the index of the subtype to return.public int getIsDefaultResourceId()
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public boolean equals(Object o)
InputMethodInfo
and its Id is the same to this one.equals
in class Object
o
- the object to compare this instance with.InputMethodInfo
and its Id is the same to this one.Object.hashCode()
public int hashCode()
Object
Object.equals(java.lang.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.
hashCode
in class Object
Object.equals(java.lang.Object)
public boolean isAuxiliaryIme()
public void writeToParcel(Parcel dest, int flags)
Parcel
.writeToParcel
in interface Parcelable
dest
- The Parcel
to be written.flags
- The flags used for parceling.public int describeContents()
Parcelable
describeContents
in interface Parcelable