@Implements(android.app.WallpaperManager.class) public class ShadowWallpaperManager extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
ShadowWallpaperManager.WallpaperCommandRecord |
Represents an invocation record of
WallpaperManager.sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle) |
Constructor | Description |
---|---|
ShadowWallpaperManager() |
Modifier and Type | Method | Description |
---|---|---|
Bitmap |
getBitmap(int which) |
Returns the memory cached
Bitmap associated with which . |
List<ShadowWallpaperManager.WallpaperCommandRecord> |
getWallpaperCommandRecords() |
Returns all the invocation records to
WallpaperManager.sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle) |
protected ParcelFileDescriptor |
getWallpaperFile(int which) |
Gets a wallpaper file associated with
which . |
protected WallpaperInfo |
getWallpaperInfo() |
Returns the information about the wallpaper if the current wallpaper is a live wallpaper
component.
|
protected boolean |
isSetWallpaperAllowed() |
|
protected boolean |
isWallpaperSupported() |
|
protected void |
sendWallpaperCommand(IBinder windowToken,
String action,
int x,
int y,
int z,
Bundle extras) |
|
protected int |
setBitmap(Bitmap fullImage,
Rect visibleCropHint,
boolean allowBackup,
int which) |
Caches
fullImage in the memory based on which . |
void |
setIsSetWallpaperAllowed(boolean allowed) |
|
void |
setIsWallpaperSupported(boolean supported) |
|
protected int |
setStream(InputStream bitmapData,
Rect visibleCropHint,
boolean allowBackup,
int which) |
Caches
bitmapData in the memory based on which . |
protected boolean |
setWallpaperComponent(ComponentName wallpaperService) |
Sets a live wallpaper,
wallpaperService , as the current wallpaper. |
@Implementation protected void sendWallpaperCommand(IBinder windowToken, String action, int x, int y, int z, Bundle extras)
@Implementation(minSdk=28) protected int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, int which)
fullImage
in the memory based on which
.
After a success call, any previously set live wallpaper is removed,
fullImage
- the bitmap image to be cached in the memoryvisibleCropHint
- not usedallowBackup
- not usedwhich
- either WallpaperManager.FLAG_LOCK
or {WallpaperManager#FLAG_SYSTEM}@Nullable public Bitmap getBitmap(int which)
Bitmap
associated with which
.which
- either WallpaperManager.FLAG_LOCK
or {WallpaperManager#FLAG_SYSTEM}.Bitmap
associated with which
. null
if no
bitmap was set.@Implementation(minSdk=28) @Nullable protected ParcelFileDescriptor getWallpaperFile(int which)
which
.which
- either WallpaperManager.FLAG_LOCK
or {WallpaperManager#FLAG_SYSTEM}null
if no such wallpaper is configured.@Implementation(minSdk=24) protected boolean isSetWallpaperAllowed()
public void setIsSetWallpaperAllowed(boolean allowed)
@Implementation(minSdk=23) protected boolean isWallpaperSupported()
public void setIsWallpaperSupported(boolean supported)
@Implementation(minSdk=24) protected int setStream(InputStream bitmapData, Rect visibleCropHint, boolean allowBackup, int which)
bitmapData
in the memory based on which
.bitmapData
- the input stream which contains a bitmap image to be cached in the memoryvisibleCropHint
- not usedallowBackup
- not usedwhich
- either WallpaperManager.FLAG_LOCK
or {WallpaperManager#FLAG_SYSTEM}@Implementation(minSdk=23) protected boolean setWallpaperComponent(ComponentName wallpaperService) throws IOException, XmlPullParserException
wallpaperService
, as the current wallpaper.
This only caches the live wallpaper info in the memory. Calling this will remove any previously set static wallpaper.
IOException
XmlPullParserException
@Implementation(minSdk=23) protected WallpaperInfo getWallpaperInfo()
public List<ShadowWallpaperManager.WallpaperCommandRecord> getWallpaperCommandRecords()
WallpaperManager.sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle)