|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.internal.repository.updater.UpdaterData
public class UpdaterData
Data shared by the SDK Manager updaters.
| Field Summary | |
|---|---|
static int |
NO_TOOLS_MSG
|
static int |
TOOLS_MSG_UPDATED_FROM_ADT
|
static int |
TOOLS_MSG_UPDATED_FROM_SDKMAN
|
| Constructor Summary | |
|---|---|
UpdaterData(java.lang.String osSdkRoot,
com.android.utils.ILogger sdkLog)
Creates a new updater data. |
|
| Method Summary | |
|---|---|
void |
addListeners(ISdkChangeListener listener)
Adds a listener ( ISdkChangeListener) that is notified when the SDK is reloaded. |
protected void |
askForAdbRestart(ITaskMonitor monitor)
Attempts to restart ADB. |
void |
broadcastOnSdkLoaded()
Safely invoke all the registered ISdkChangeListener.onSdkLoaded(). |
boolean |
checkIfInitFailed()
Check if any error occurred during initialization. |
protected ArchiveInstaller |
createArchiveInstaler()
Internal helper to return a new ArchiveInstaller. |
protected void |
displayInitError(java.lang.String error)
|
AvdManager |
getAvdManager()
|
DownloadCache |
getDownloadCache()
|
Package[] |
getInstalledPackages(ITaskMonitor monitor)
Returns the list of installed packages, parsing them if this has not yet been done. |
LocalSdkParser |
getLocalSdkParser()
|
java.lang.String |
getOsSdkRoot()
|
PackageLoader |
getPackageLoader()
|
com.android.utils.ILogger |
getSdkLog()
|
SdkManager |
getSdkManager()
|
SettingsController |
getSettingsController()
|
SdkSources |
getSources()
|
ITaskFactory |
getTaskFactory()
|
protected void |
initSdk()
Initializes the SdkManager and the AvdManager. |
protected SettingsController |
initSettingsController()
Initializes the SettingsController
Extracted so that we can override this in unit tests. |
protected java.util.List<Archive> |
installArchives(java.util.List<ArchiveInfo> archives,
int flags)
Install the list of given Archives. |
void |
listRemotePackages_NoGUI(boolean includeAll,
boolean extendedOutput)
Lists remote packages available for install using updateOrInstallAll_NoGUI(java.util.Collection. |
protected void |
notifyToolsNeedsToBeRestarted(int flags)
|
void |
refreshSources(boolean forceFetching)
Refresh all sources. |
void |
reloadAvds()
Reloads the AVDs. |
void |
reloadSdk()
Reloads the SDK content (targets). |
void |
removeListener(ISdkChangeListener listener)
Removes a listener ( ISdkChangeListener) that is notified when the SDK is reloaded. |
protected void |
runOnUiThread(java.lang.Runnable r)
Runs a runnable on the UI thread. |
protected void |
setSdkManager(SdkManager sdkManager)
|
void |
setTaskFactory(ITaskFactory taskFactory)
|
void |
setupDefaultSources()
Sets up the default sources: - the default google SDK repository, - the user sources from prefs - the extra repo URLs from the environment, - and finally the extra user repo URLs from the environment. |
java.util.List<Archive> |
updateOrInstallAll_NoGUI(java.util.Collection<java.lang.String> pkgFilter,
boolean includeAll,
boolean dryMode,
java.lang.String acceptLicense)
Tries to update all the *existing* local packages. |
java.util.List<Archive> |
updateOrInstallAll_WithGUI(java.util.Collection<Archive> selectedArchives,
boolean includeObsoletes,
int flags)
Tries to update all the *existing* local packages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_TOOLS_MSG
public static final int TOOLS_MSG_UPDATED_FROM_ADT
public static final int TOOLS_MSG_UPDATED_FROM_SDKMAN
| Constructor Detail |
|---|
public UpdaterData(java.lang.String osSdkRoot,
com.android.utils.ILogger sdkLog)
sdkLog - Logger. Cannot be null.osSdkRoot - The OS path to the SDK root.| Method Detail |
|---|
public java.lang.String getOsSdkRoot()
public DownloadCache getDownloadCache()
getDownloadCache in interface IUpdaterDatapublic void setTaskFactory(ITaskFactory taskFactory)
public ITaskFactory getTaskFactory()
getTaskFactory in interface IUpdaterDatapublic SdkSources getSources()
public LocalSdkParser getLocalSdkParser()
public com.android.utils.ILogger getSdkLog()
getSdkLog in interface IUpdaterDatapublic SdkManager getSdkManager()
getSdkManager in interface IUpdaterDatapublic AvdManager getAvdManager()
getAvdManager in interface IUpdaterDatapublic SettingsController getSettingsController()
getSettingsController in interface IUpdaterDatapublic void addListeners(ISdkChangeListener listener)
ISdkChangeListener) that is notified when the SDK is reloaded.
public void removeListener(ISdkChangeListener listener)
ISdkChangeListener) that is notified when the SDK is reloaded.
public PackageLoader getPackageLoader()
public boolean checkIfInitFailed()
protected void displayInitError(java.lang.String error)
protected void runOnUiThread(@NonNull
java.lang.Runnable r)
r - Non-null runnable.protected void initSdk()
SdkManager and the AvdManager.
Extracted so that we can override this in unit tests.
protected SettingsController initSettingsController()
SettingsController
Extracted so that we can override this in unit tests.
protected void setSdkManager(SdkManager sdkManager)
public void reloadSdk()
ISdkChangeListener).
public void reloadAvds()
public void setupDefaultSources()
public Package[] getInstalledPackages(ITaskMonitor monitor)
LocalSdkParser and will be reset when
reloadSdk() is invoked.
protected java.util.List<Archive> installArchives(java.util.List<ArchiveInfo> archives,
int flags)
Archives. This is invoked by the user selecting some
packages in the remote page and then clicking "install selected".
archives - The archives to install. Incompatible ones will be skipped.flags - Optional flags for the installer, such as NO_TOOLS_MSG.
protected void askForAdbRestart(ITaskMonitor monitor)
protected void notifyToolsNeedsToBeRestarted(int flags)
public void listRemotePackages_NoGUI(boolean includeAll,
boolean extendedOutput)
updateOrInstallAll_NoGUI(java.util.Collection, boolean, boolean, java.lang.String) .
includeAll - True to list and install all packages, including obsolete ones.extendedOutput - True to display more details on each package.
public java.util.List<Archive> updateOrInstallAll_WithGUI(java.util.Collection<Archive> selectedArchives,
boolean includeObsoletes,
int flags)
selectedArchives - The list of remote archives to consider for the update.
This can be null, in which case a list of remote archive is fetched from all
available sources.includeObsoletes - True if obsolete packages should be used when resolving what
to update.flags - Optional flags for the installer, such as NO_TOOLS_MSG.
public java.util.List<Archive> updateOrInstallAll_NoGUI(java.util.Collection<java.lang.String> pkgFilter,
boolean includeAll,
boolean dryMode,
java.lang.String acceptLicense)
ILogger.
pkgFilter - A list of SdkRepoConstants.NODES or Package.installId()
or package indexes to limit the packages we can update or install.
A null or empty list means to update everything possible.includeAll - True to list and install all packages, including obsolete ones.dryMode - True to check what would be updated/installed but do not actually
download or install anything.acceptLicense - SDK licenses to automatically accept.
public void refreshSources(boolean forceFetching)
forceFetching - When true, load sources that haven't been loaded yet.
When false, only refresh sources that have been loaded yet.public void broadcastOnSdkLoaded()
ISdkChangeListener.onSdkLoaded().
This can be called from any thread.
protected ArchiveInstaller createArchiveInstaler()
ArchiveInstaller.
This allows us to override the installer for unit-testing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||