public final class WallpaperInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<WallpaperInfo> |
CREATOR
Used to make this class parcelable.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
WallpaperInfo(Context context,
ResolveInfo service)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
void |
dump(Printer pw,
String prefix) |
ComponentName |
getComponent()
Return the component of the service that implements this wallpaper.
|
String |
getPackageName()
Return the .apk package that implements this wallpaper.
|
ServiceInfo |
getServiceInfo()
Return the raw information about the Service implementing this
wallpaper.
|
String |
getServiceName()
Return the class name of the service component that implements
this wallpaper.
|
String |
getSettingsActivity()
Return the class name of an activity that provides a settings UI for
the wallpaper.
|
boolean |
getShowMetadataInPreview()
Queries whether any metadata should be shown when previewing the wallpaper.
|
CharSequence |
loadAuthor(PackageManager pm)
Return a string indicating the author(s) of this wallpaper.
|
CharSequence |
loadContextDescription(PackageManager pm)
Retrieves a title of the URI that specifies a link for further context about this wallpaper.
|
Uri |
loadContextUri(PackageManager pm)
Returns an URI that specifies a link for further context about this wallpaper.
|
CharSequence |
loadDescription(PackageManager pm)
Return a brief summary of this wallpaper's behavior.
|
Drawable |
loadIcon(PackageManager pm)
Load the user-displayed icon for this wallpaper.
|
CharSequence |
loadLabel(PackageManager pm)
Load the user-displayed label for this wallpaper.
|
Drawable |
loadThumbnail(PackageManager pm)
Load the thumbnail image for this wallpaper.
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Used to package this object into a
Parcel . |
public static final Parcelable.Creator<WallpaperInfo> CREATOR
public WallpaperInfo(Context context, ResolveInfo service) throws XmlPullParserException, IOException
context
- The Context in which we are parsing the wallpaper.service
- The ResolveInfo returned from the package manager about
this wallpaper's component.XmlPullParserException
IOException
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 wallpaper's
resources.public Drawable loadIcon(PackageManager pm)
pm
- Supply a PackageManager used to load the wallpaper's
resources.public Drawable loadThumbnail(PackageManager pm)
pm
- Supply a PackageManager used to load the wallpaper's
resources.public CharSequence loadAuthor(PackageManager pm) throws Resources.NotFoundException
Resources.NotFoundException
public CharSequence loadDescription(PackageManager pm) throws Resources.NotFoundException
Resources.NotFoundException
public Uri loadContextUri(PackageManager pm) throws Resources.NotFoundException
pm
- An instance of PackageManager
to retrieve the URI.Resources.NotFoundException
public CharSequence loadContextDescription(PackageManager pm) throws Resources.NotFoundException
pm
- An instance of PackageManager
to retrieve the title.Resources.NotFoundException
public boolean getShowMetadataInPreview()
loadLabel(android.content.pm.PackageManager)
,
loadDescription(android.content.pm.PackageManager)
, loadAuthor(android.content.pm.PackageManager)
and
loadContextDescription(PackageManager)
, so the user gets to know further information
about this wallpaper.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 wallpaper.
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
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
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR