public class SdkDownloadTracker extends java.lang.Object implements Disposable
Disposable.Parent
Constructor and Description |
---|
SdkDownloadTracker() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.util.List<Sdk> |
findDownloadingSdks(java.lang.String sdkName)
Looks into the currently downloading SDK instances
and returns one with matching name
|
static SdkDownloadTracker |
getInstance() |
boolean |
isDownloading(Sdk sdk)
Checks if there is an activity for a given Sdk
|
void |
onSdkRemoved(Sdk sdk) |
void |
registerEditableSdk(Sdk original,
Sdk editable) |
void |
registerSdkDownload(Sdk originalSdk,
SdkDownloadTask item) |
void |
startSdkDownloadIfNeeded(Sdk sdkFromTable) |
boolean |
tryRegisterDownloadingListener(Sdk sdk,
Disposable lifetime,
ProgressIndicator indicator,
Consumer<java.lang.Boolean> onDownloadCompleteCallback)
Checks if there is an activity for a given Sdk and subscribes a listeners if there is an activity
|
public static SdkDownloadTracker getInstance()
public void dispose()
Disposable
dispose
in interface Disposable
public void onSdkRemoved(Sdk sdk)
public void registerSdkDownload(Sdk originalSdk, SdkDownloadTask item)
public void startSdkDownloadIfNeeded(Sdk sdkFromTable)
public java.util.List<Sdk> findDownloadingSdks(java.lang.String sdkName)
public boolean isDownloading(Sdk sdk)
public boolean tryRegisterDownloadingListener(Sdk sdk, Disposable lifetime, ProgressIndicator indicator, Consumer<java.lang.Boolean> onDownloadCompleteCallback)
sdk
- the Sdk instance that to check (it could be it's #clone())lifetime
- unsubscribe callbackindicator
- progress indicator to deliver progressonDownloadCompleteCallback
- called once download is completed from EDT thread,
with true
to indicate success and false
for a failure