FileDocCategorySizeDatePackage
WallpaperService.javaAPI DocAndroid 5.1 API53932Thu Mar 12 22:22:10 GMT 2015android.service.wallpaper

WallpaperService

public abstract class WallpaperService extends android.app.Service
A wallpaper service is responsible for showing a live wallpaper behind applications that would like to sit on top of it. This service object itself does very little -- its only purpose is to generate instances of {@link Engine} as needed. Implementing a wallpaper thus involves subclassing from this, subclassing an Engine implementation, and implementing {@link #onCreateEngine()} to return a new instance of your engine.

Fields Summary
public static final String
SERVICE_INTERFACE
The {@link Intent} that must be declared as handled by the service. To be supported, the service must also require the {@link android.Manifest.permission#BIND_WALLPAPER} permission so that other applications can not abuse it.
public static final String
SERVICE_META_DATA
Name under which a WallpaperService component publishes information about itself. This meta-data must reference an XML resource containing a <{@link android.R.styleable#Wallpaper wallpaper}> tag.
static final String
TAG
static final boolean
DEBUG
private static final int
DO_ATTACH
private static final int
DO_DETACH
private static final int
DO_SET_DESIRED_SIZE
private static final int
DO_SET_DISPLAY_PADDING
private static final int
MSG_UPDATE_SURFACE
private static final int
MSG_VISIBILITY_CHANGED
private static final int
MSG_WALLPAPER_OFFSETS
private static final int
MSG_WALLPAPER_COMMAND
private static final int
MSG_WINDOW_RESIZED
private static final int
MSG_WINDOW_MOVED
private static final int
MSG_TOUCH_EVENT
private final ArrayList
mActiveEngines
Constructors Summary
Methods Summary
protected voiddump(java.io.FileDescriptor fd, java.io.PrintWriter out, java.lang.String[] args)

        out.print("State of wallpaper "); out.print(this); out.println(":");
        for (int i=0; i<mActiveEngines.size(); i++) {
            Engine engine = mActiveEngines.get(i);
            out.print("  Engine "); out.print(engine); out.println(":");
            engine.dump("    ", fd, out, args);
        }
    
public final android.os.IBinderonBind(android.content.Intent intent)
Implement to return the implementation of the internal accessibility service interface. Subclasses should not override.

        return new IWallpaperServiceWrapper(this);
    
public voidonCreate()

        super.onCreate();
    
public abstract android.service.wallpaper.WallpaperService$EngineonCreateEngine()
Must be implemented to return a new instance of the wallpaper's engine. Note that multiple instances may be active at the same time, such as when the wallpaper is currently set as the active wallpaper and the user is in the wallpaper picker viewing a preview of it as well.

public voidonDestroy()

        super.onDestroy();
        for (int i=0; i<mActiveEngines.size(); i++) {
            mActiveEngines.get(i).detach();
        }
        mActiveEngines.clear();