ControllableTask
public abstract class ControllableTask<StateT> extends CancellableTask
| java.lang.Object | |||
| ↳ | com.google.android.gms.tasks.Task | ||
| ↳ | com.google.firebase.storage.CancellableTask | ||
| ↳ | com.google.firebase.storage.ControllableTask |
StorageTask |
A controllable Task that has a synchronized state machine. |
FileDownloadTask |
A task that downloads bytes of a GCS blob to a specified File. |
StreamDownloadTask |
A task that downloads bytes of a GCS blob. |
UploadTask |
An controllable task that uploads and fires events for success, progress and failure. |
Represents an asynchronous operation that can be paused, resumed and canceled. This task also receives progress and other state change notifications.
| Parameters | |
|---|---|
<StateT> |
the type of state this operation returns in events. |
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
abstract @NonNull ControllableTask<StateT> |
addOnPausedListener(@NonNull OnPausedListener<Object> listener)Adds a listener that is called when the Task becomes paused. |
abstract @NonNull ControllableTask<StateT> |
addOnPausedListener(Adds a listener that is called when the Task becomes paused. |
abstract @NonNull ControllableTask<StateT> |
addOnPausedListener(Adds a listener that is called when the Task becomes paused. |
abstract boolean |
isPaused() |
abstract boolean |
pause()Attempts to pause the task. |
abstract boolean |
resume()Attempts to resume this task. |
Inherited methods |
||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||
|
Public constructors
Public methods
addOnPausedListener
public abstract @NonNull ControllableTask<StateT> addOnPausedListener(@NonNull OnPausedListener<Object> listener)
Adds a listener that is called when the Task becomes paused.
| Returns | |
|---|---|
@NonNull ControllableTask<StateT> |
this Task |
addOnPausedListener
public abstract @NonNull ControllableTask<StateT> addOnPausedListener(
@NonNull Activity activity,
@NonNull OnPausedListener<Object> listener
)
Adds a listener that is called when the Task becomes paused.
| Parameters | |
|---|---|
@NonNull Activity activity |
When the supplied |
| Returns | |
|---|---|
@NonNull ControllableTask<StateT> |
this Task |
addOnPausedListener
public abstract @NonNull ControllableTask<StateT> addOnPausedListener(
@NonNull Executor executor,
@NonNull OnPausedListener<Object> listener
)
Adds a listener that is called when the Task becomes paused.
| Returns | |
|---|---|
@NonNull ControllableTask<StateT> |
this Task |
pause
public abstract boolean pause()
Attempts to pause the task. A paused task can later be resumed.
| Returns | |
|---|---|
boolean |
true if this task was successfully paused or is in the process of being paused. Returns false if the task is already completed or in a state that cannot be paused. |
resume
public abstract boolean resume()
Attempts to resume this task.
| Returns | |
|---|---|
boolean |
true if the task is successfully resumed or is in the process of being resumed. Returns false if the task is already completed or in a state that cannot be resumed. |