use of android.app.IWallpaperService in project platform_packages_apps_launcher by android.
the class Launcher method setWallpaperDimension.
private void setWallpaperDimension() {
IBinder binder = ServiceManager.getService(WALLPAPER_SERVICE);
IWallpaperService wallpaperService = IWallpaperService.Stub.asInterface(binder);
Display display = getWindowManager().getDefaultDisplay();
boolean isPortrait = display.getWidth() < display.getHeight();
final int width = isPortrait ? display.getWidth() : display.getHeight();
final int height = isPortrait ? display.getHeight() : display.getWidth();
try {
wallpaperService.setDimensionHints(width * WALLPAPER_SCREENS_SPAN, height);
} catch (RemoteException e) {
// System is dead!
}
}
Aggregations