use of com.bumptech.glide.util.Synthetic in project glide by bumptech.
the class EngineJob method handleResultOnMainThread.
@Synthetic
void handleResultOnMainThread() {
stateVerifier.throwIfRecycled();
if (isCancelled) {
resource.recycle();
release(false);
return;
} else if (cbs.isEmpty()) {
throw new IllegalStateException("Received a resource without any callbacks to notify");
} else if (hasResource) {
throw new IllegalStateException("Already have resource");
}
engineResource = engineResourceFactory.build(resource, isCacheable);
hasResource = true;
// Hold on to resource for duration of request so we don't recycle it in the middle of
// notifying if it synchronously released by one of the callbacks.
engineResource.acquire();
listener.onEngineJobComplete(key, engineResource);
for (ResourceCallback cb : cbs) {
if (!isInIgnoredCallbacks(cb)) {
engineResource.acquire();
cb.onResourceReady(engineResource, dataSource);
}
}
// Our request is complete, so we can release the resource.
engineResource.release();
release(false);
}
use of com.bumptech.glide.util.Synthetic in project glide by bumptech.
the class DefaultConnectivityMonitor method isConnected.
@Synthetic
boolean isConnected(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
return networkInfo != null && networkInfo.isConnected();
}
use of com.bumptech.glide.util.Synthetic in project glide by bumptech.
the class EngineJob method handleExceptionOnMainThread.
@Synthetic
void handleExceptionOnMainThread() {
stateVerifier.throwIfRecycled();
if (isCancelled) {
release(false);
return;
} else if (cbs.isEmpty()) {
throw new IllegalStateException("Received an exception without any callbacks to notify");
} else if (hasLoadFailed) {
throw new IllegalStateException("Already failed once");
}
hasLoadFailed = true;
listener.onEngineJobComplete(key, null);
for (ResourceCallback cb : cbs) {
if (!isInIgnoredCallbacks(cb)) {
cb.onLoadFailed(exception);
}
}
release(false);
}
Aggregations