Commit 137d70b0 by aquilescanta Committed by Oliver Woodman

Clear fatal errors in Loader#startLoading

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189323050
parent c7c9a1e9
......@@ -159,22 +159,23 @@ public final class Loader implements LoaderErrorThrower {
/**
* Starts loading a {@link Loadable}.
* <p>
* The calling thread must be a {@link Looper} thread, which is the thread on which the
* {@link Callback} will be called.
*
* <p>The calling thread must be a {@link Looper} thread, which is the thread on which the {@link
* Callback} will be called.
*
* @param <T> The type of the loadable.
* @param loadable The {@link Loadable} to load.
* @param callback A callback to be called when the load ends.
* @param defaultMinRetryCount The minimum number of times the load must be retried before
* {@link #maybeThrowError()} will propagate an error.
* @param defaultMinRetryCount The minimum number of times the load must be retried before {@link
* #maybeThrowError()} will propagate an error.
* @throws IllegalStateException If the calling thread does not have an associated {@link Looper}.
* @return {@link SystemClock#elapsedRealtime} when the load started.
*/
public <T extends Loadable> long startLoading(T loadable, Callback<T> callback,
int defaultMinRetryCount) {
public <T extends Loadable> long startLoading(
T loadable, Callback<T> callback, int defaultMinRetryCount) {
Looper looper = Looper.myLooper();
Assertions.checkState(looper != null);
fatalError = null;
long startTimeMs = SystemClock.elapsedRealtime();
new LoadTask<>(looper, loadable, callback, defaultMinRetryCount, startTimeMs).start(0);
return startTimeMs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment