diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java index a9a16ecae..666acc2fe 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java @@ -11,9 +11,7 @@ package com.facebook.react.modules.fresco; import java.util.HashSet; -import android.content.ComponentCallbacks2; import android.content.Context; -import android.content.res.Configuration; import android.support.annotation.Nullable; import com.facebook.cache.common.CacheKey; @@ -39,7 +37,7 @@ import com.squareup.okhttp.OkHttpClient; *
Does not expose any methods to JavaScript code. For initialization and cleanup only. */ public class FrescoModule extends ReactContextBaseJavaModule implements - ModuleDataCleaner.Cleanable, ComponentCallbacks2 { + ModuleDataCleaner.Cleanable { @Nullable private RequestListener mRequestListener; @Nullable private DiskCacheConfig mDiskCacheConfig; @@ -90,14 +88,6 @@ public class FrescoModule extends ReactContextBaseJavaModule implements ImagePipelineConfig config = builder.build(); Fresco.initialize(context, config); - - getReactApplicationContext().getApplicationContext().registerComponentCallbacks(this); - } - - @Override - public void onCatalystInstanceDestroy() { - getReactApplicationContext().getApplicationContext().unregisterComponentCallbacks(this); - clearMemoryCaches(); } @Override @@ -115,26 +105,6 @@ public class FrescoModule extends ReactContextBaseJavaModule implements imagePipelineFactory.getSmallImageDiskStorageCache().clearAll(); } - @Override - public void onTrimMemory(int level) { - if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE || - level == ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { - clearMemoryCaches(); - } - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - } - - @Override - public void onLowMemory() { - } - - private void clearMemoryCaches() { - Fresco.getImagePipeline().clearMemoryCaches(); - } - private static class FrescoHandler implements SoLoaderShim.Handler { @Override public void loadLibrary(String libraryName) {