com.android.sdklib.internal.repository.updater
Interface PackageLoader.IAutoInstallTask

Enclosing class:
PackageLoader

public static interface PackageLoader.IAutoInstallTask

Interface describing the task of installing a specific package. For details on the operation, see PackageLoader.loadPackagesWithInstallTask(int, IAutoInstallTask).

See Also:
PackageLoader.loadPackagesWithInstallTask(int, IAutoInstallTask)

Method Summary
 boolean acceptPackage(Package pkg)
          Called by the install task for every package available (new ones, updates as well as existing ones that don't have a potential update.) The method should return true if this is a package that should be installed.
 Package[] filterLoadedSource(SdkSource source, Package[] packages)
          Invoked by the loader once a source has been loaded and its package definitions are known.
 void setResult(boolean success, java.util.Map<Package,java.io.File> installPaths)
          Called when the accepted package has been installed, successfully or not.
 void taskCompleted()
          Called when the task is done iterating and completed.
 

Method Detail

filterLoadedSource

Package[] filterLoadedSource(SdkSource source,
                             Package[] packages)
Invoked by the loader once a source has been loaded and its package definitions are known. The method should return the packages array and can modify it if necessary. The loader will call acceptPackage(Package) on all the packages returned.

Parameters:
source - The source of the packages. Null for the locally installed packages.
packages - The packages found in the source.

acceptPackage

boolean acceptPackage(Package pkg)
Called by the install task for every package available (new ones, updates as well as existing ones that don't have a potential update.) The method should return true if this is a package that should be installed.

Important: This method is called from a sub-thread, so clients who try to access any UI widgets must wrap their calls into Display.syncExec(Runnable) or Display.asyncExec(Runnable).


setResult

void setResult(boolean success,
               java.util.Map<Package,java.io.File> installPaths)
Called when the accepted package has been installed, successfully or not. If an already installed (aka existing) package has been accepted, this will be called with a 'true' success and the actual install paths.

Important: This method is called from a sub-thread, so clients who try to access any UI widgets must wrap their calls into Display.syncExec(Runnable) or Display.asyncExec(Runnable).


taskCompleted

void taskCompleted()
Called when the task is done iterating and completed.