From af1475fc4ce95c1c38404a71e932fd179724188f Mon Sep 17 00:00:00 2001 From: Oleksandr Stashuk Date: Fri, 27 Nov 2015 04:24:33 -0800 Subject: [PATCH] revert of D2699721 Reviewed By: lexs Differential Revision: D2700660 fb-gh-sync-id: c59fc46e03146af9a1a6ce836070924d6bcfaba6 --- .../react/modules/fresco/FrescoModule.java | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) 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) {