@Synthetic void handleExceptionOnMainThread() { stateVerifier.throwIfRecycled(); if (isCancelled) { release(false /*isRemovedFromQueue*/); 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 /*isRemovedFromQueue*/); }
@Synthetic void checkCurrentDimens() { if (cbs.isEmpty()) { return; } int currentWidth = getTargetWidth(); int currentHeight = getTargetHeight(); if (!isViewStateAndSizeValid(currentWidth, currentHeight)) { return; } notifyCbs(currentWidth, currentHeight); clearCallbacksAndListener(); }
@Synthetic boolean isConnected(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); return networkInfo != null && networkInfo.isConnected(); }
@Synthetic void handleResultOnMainThread() { stateVerifier.throwIfRecycled(); if (isCancelled) { resource.recycle(); release(false /*isRemovedFromQueue*/); 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 /*isRemovedFromQueue*/); }
@Synthetic void handleCancelledOnMainThread() { stateVerifier.throwIfRecycled(); if (!isCancelled) { throw new IllegalStateException("Not cancelled"); } listener.onEngineJobCancelled(this, key); release(false /*isRemovedFromQueue*/); }
@SuppressWarnings("WeakerAccess") @Synthetic // Permissions are checked in the factory instead. @SuppressLint("MissingPermission") boolean isConnected(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = Preconditions.checkNotNull(connectivityManager).getActiveNetworkInfo(); return networkInfo != null && networkInfo.isConnected(); }
@Synthetic void handleResultOnMainThread() { stateVerifier.throwIfRecycled(); if (isCancelled) { resource.recycle(); release(false /*isRemovedFromQueue*/); 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); int size = cbs.size(); for (int i = 0; i < size; i++) { ResourceCallback cb = cbs.get(i); if (!isInIgnoredCallbacks(cb)) { engineResource.acquire(); cb.onResourceReady(engineResource, dataSource); } } // Our request is complete, so we can release the resource. engineResource.release(); release(false /*isRemovedFromQueue*/); }
@Synthetic @SuppressWarnings("WeakerAccess") ResourceWeakReference( Key key, EngineResource<?> r, ReferenceQueue<? super EngineResource<?>> q) { super(r, q); this.key = Preconditions.checkNotNull(key); this.resource = Preconditions.checkNotNull(r.getResource()); isCacheable = r.isCacheable(); }
@Synthetic SingleRequest() { // just create, instances are reused with recycle/init }
@Synthetic FragmentRequestManagerTreeNode() { }
@Synthetic SupportFragmentRequestManagerTreeNode() { }
@Synthetic FrameLoaderCallback() { }
@Synthetic NoLock() { }
@Synthetic FitCenter() { }
@Synthetic CenterOutside() { }
@Synthetic AtLeast() { }
@Synthetic AtMost() { }
@Synthetic None() { }
@Synthetic CenterInside() { }
@Synthetic DefaultHttpUrlConnectionFactory() { }
@Synthetic UniqueKey() { }
@Synthetic LockedResource() { }
@Synthetic static String getBitmapString(int size, Bitmap.Config config) { return "[" + size + "](" + config + ")"; }
@Synthetic KeyPool() { }
@Synthetic static String getBitmapString(int size) { return "[" + size + "]"; }
@Synthetic NullBitmapTracker() { }
@Synthetic static String getBitmapString(int width, int height, Bitmap.Config config) { return "[" + width + "x" + height + "], " + config; }
@Synthetic ResourceRecyclerCallback() { }
@Synthetic MainThreadCallback() { }
@Synthetic DecodeCallback(DataSource dataSource) { this.dataSource = dataSource; }
@Synthetic ReleaseManager() { }
@Synthetic DeferredEncodeManager() { }
@Synthetic WriteLock() { }
@Synthetic WriteLockPool() { }
@Synthetic ModelLoaderCache() { }
@Synthetic EmptyModelLoader() { }
@Synthetic boolean handles(Class<?> resourceClass) { return this.resourceClass.isAssignableFrom(resourceClass); }