|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.internal.repository.updater.PackageLoader
public class PackageLoader
Loads packages fetched from the remote SDK Repository and keeps track of their state compared with the current local SDK installation.
| Nested Class Summary | |
|---|---|
static interface |
PackageLoader.IAutoInstallTask
Interface describing the task of installing a specific package. |
static interface |
PackageLoader.ISourceLoadedCallback
Interface for the callback called by loadPackages(boolean, ISourceLoadedCallback). |
| Constructor Summary | |
|---|---|
PackageLoader(UpdaterData updaterData)
Creates a new PackageManager associated with the given UpdaterData
and using the UpdaterData's default DownloadCache. |
|
PackageLoader(UpdaterData updaterData,
DownloadCache cache)
Creates a new PackageManager associated with the given UpdaterData
but using the specified DownloadCache instead of the one from
UpdaterData. |
|
| Method Summary | |
|---|---|
UpdaterData |
getUpdaterData()
|
void |
loadPackages(boolean overrideExisting,
PackageLoader.ISourceLoadedCallback sourceLoadedCallback)
Loads all packages from the remote repository. |
void |
loadPackagesWithInstallTask(int installFlags,
PackageLoader.IAutoInstallTask installTask)
Load packages, source by source using loadPackages(boolean, ISourceLoadedCallback),
and executes the given PackageLoader.IAutoInstallTask on the current package list. |
void |
loadRemoteAddonsList(ITaskMonitor monitor)
Loads the remote add-ons list. |
protected void |
runOnUiThread(java.lang.Runnable r)
Runs a runnable on the UI thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackageLoader(UpdaterData updaterData)
UpdaterData
and using the UpdaterData's default DownloadCache.
updaterData - The UpdaterData. Must not be null.
public PackageLoader(UpdaterData updaterData,
DownloadCache cache)
UpdaterData
but using the specified DownloadCache instead of the one from
UpdaterData.
updaterData - The UpdaterData. Must not be null.cache - The DownloadCache to use instead of the one from UpdaterData.| Method Detail |
|---|
public UpdaterData getUpdaterData()
protected void runOnUiThread(@NonNull
java.lang.Runnable r)
r - Non-null runnable.
public void loadPackages(boolean overrideExisting,
PackageLoader.ISourceLoadedCallback sourceLoadedCallback)
ITask. The call is blocking.
The callback is called with each set of PkgItem found in each source.
The caller is responsible to accumulate the packages given to the callback
after each source is finished loaded. In return the callback tells the loader
whether to continue loading sources.
Normally this method doesn't access the remote source if it's already
been loaded in the in-memory source (e.g. don't fetch twice).
overrideExisting - Set this to true when the caller wants to
check for updates and discard any existing source already
loaded in memory. It should be false for normal use.sourceLoadedCallback - The callback to invoke for each loaded source.
public void loadPackagesWithInstallTask(int installFlags,
PackageLoader.IAutoInstallTask installTask)
loadPackages(boolean, ISourceLoadedCallback),
and executes the given PackageLoader.IAutoInstallTask on the current package list.
That is for each package known, the install task is queried to find if
the package is the one to be installed or updated.
- If an already installed package is accepted by the task, it is returned. PackageLoader.IAutoInstallTask.setResult(boolean, java.util.Map) is called on the
result of the accepted package.
When the task is completed, PackageLoader.IAutoInstallTask.taskCompleted() is called.
The call is blocking. Although the name says "Task", this is not an ITask
running in its own thread but merely a synchronous call.
installFlags - Flags for installation such as
UpdaterData.TOOLS_MSG_UPDATED_FROM_ADT.installTask - The task to perform.public void loadRemoteAddonsList(ITaskMonitor monitor)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||