com.android.sdklib.repository.remote
Class RemoteSdk

java.lang.Object
  extended by com.android.sdklib.repository.remote.RemoteSdk

public class RemoteSdk
extends java.lang.Object

This class keeps information on the remote SDK repository.


Constructor Summary
RemoteSdk()
           
 
Method Summary
 com.google.common.collect.Multimap<PkgType,RemotePkgInfo> fetch(com.android.sdklib.internal.repository.sources.SdkSources sources, com.android.utils.ILogger logger)
          Fetches the remote list of packages.
protected  com.android.sdklib.internal.repository.DownloadCache getDownloadCache()
          Returns the DownloadCache Extracted so that we can override this in unit tests.
protected  com.android.sdklib.internal.repository.updater.SettingsController getSettingsController()
          Returns the SettingsController Extracted so that we can override this in unit tests.
protected  com.android.sdklib.internal.repository.updater.SettingsController initSettingsController()
          Initializes the SettingsController Extracted so that we can override this in unit tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteSdk

public RemoteSdk()
Method Detail

fetch

public com.google.common.collect.Multimap<PkgType,RemotePkgInfo> fetch(@NonNull
                                                                       com.android.sdklib.internal.repository.sources.SdkSources sources,
                                                                       @NonNull
                                                                       com.android.utils.ILogger logger)
Fetches the remote list of packages.

This respects the settings from the SettingsController which dictates whether the DownloadCache is used and whether HTTP is enforced over HTTPS.

The call may block on network access. Callers will likely want to invoke this from a thread and make sure the logger is thread-safe with regard to UI updates.

Parameters:
sources - The sources to download from.
logger - A logger to report status & progress.
Returns:
A non-null potentially map of PkgType to RemotePkgInfo describing the remote packages available for install/download.

getDownloadCache

protected com.android.sdklib.internal.repository.DownloadCache getDownloadCache()
Returns the DownloadCache Extracted so that we can override this in unit tests.


getSettingsController

protected com.android.sdklib.internal.repository.updater.SettingsController getSettingsController()
Returns the SettingsController Extracted so that we can override this in unit tests.


initSettingsController

protected com.android.sdklib.internal.repository.updater.SettingsController initSettingsController()
Initializes the SettingsController Extracted so that we can override this in unit tests.