Skip to content

Commit

Permalink
Back out "[RN][Android] Release underlying resources when JS instance…
Browse files Browse the repository at this point in the history
… is GC'ed on Android"

Summary: Original commit changeset: 12f14fa4a582

Reviewed By: furdei

Differential Revision: D16494091

fbshipit-source-id: f3080873a11ebb376e819b102fc13efe97146a89
  • Loading branch information
fred2028 authored and mcuelenaere committed Sep 24, 2019
1 parent 39800ff commit 865524d
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 215 deletions.
1 change: 0 additions & 1 deletion RNTester/android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ rn_android_library(
react_native_target("java/com/facebook/react:react"),
react_native_target("java/com/facebook/react/common:build_config"),
react_native_target("java/com/facebook/react/modules/core:core"),
react_native_target("java/com/facebook/react/views/text:text"),
react_native_target("java/com/facebook/react/shell:shell"),
react_native_target("jni/prebuilt:android-jsc"),
# .so files are prebuilt by Gradle with `./gradlew :ReactAndroid:packageReactNdkLibsForBuck`
Expand Down
1 change: 0 additions & 1 deletion ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def getNdkBuildFullPath() {
task buildReactNdkLib(dependsOn: [prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog], type: Exec) {
inputs.dir("$projectDir/../ReactCommon")
inputs.dir("src/main/jni")
inputs.dir("src/main/java/com/facebook/react/modules/blob")
outputs.dir("$buildDir/react-ndk/all")
commandLine(getNdkBuildFullPath(),
"NDK_PROJECT_PATH=null",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ rn_android_library(
],
deps = [
react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_dep("third-party/java/okhttp:okhttp3"),
Expand All @@ -25,7 +24,6 @@ rn_android_library(
react_native_target("java/com/facebook/react/bridge:bridge"),
react_native_target("java/com/facebook/react/common:common"),
react_native_target("java/com/facebook/react/module/annotations:annotations"),
react_native_target("java/com/facebook/react/modules/blob/jni:jni"),
react_native_target("java/com/facebook/react/modules/network:network"),
react_native_target("java/com/facebook/react/modules/websocket:websocket"),
],
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import androidx.annotation.Nullable;
import android.webkit.MimeTypeMap;

import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
Expand Down Expand Up @@ -152,11 +151,6 @@ public BlobModule(ReactApplicationContext reactContext) {
super(reactContext);
}

@Override
public void initialize() {
BlobCollector.install(getReactApplicationContext(), this);
}

@Override
public String getName() {
return NAME;
Expand Down Expand Up @@ -184,16 +178,11 @@ public String store(byte[] data) {
}

public void store(byte[] data, String blobId) {
synchronized (mBlobs) {
mBlobs.put(blobId, data);
}
mBlobs.put(blobId, data);
}

@DoNotStrip
public void remove(String blobId) {
synchronized (mBlobs) {
mBlobs.remove(blobId);
}
mBlobs.remove(blobId);
}

public @Nullable byte[] resolve(Uri uri) {
Expand All @@ -212,19 +201,17 @@ public void remove(String blobId) {
}

public @Nullable byte[] resolve(String blobId, int offset, int size) {
synchronized (mBlobs) {
byte[] data = mBlobs.get(blobId);
if (data == null) {
return null;
}
if (size == -1) {
size = data.length - offset;
}
if (offset > 0 || size != data.length) {
data = Arrays.copyOfRange(data, offset, offset + size);
}
return data;
byte[] data = mBlobs.get(blobId);
if (data == null) {
return null;
}
if (size == -1) {
size = data.length - offset;
}
if (offset > 0 || size != data.length) {
data = Arrays.copyOfRange(data, offset, offset + size);
}
return data;
}

public @Nullable byte[] resolve(ReadableMap blob) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions ReactAndroid/src/main/jni/react/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,3 @@ include $(REACT_SRC_DIR)/turbomodule/core/jni/Android.mk

include $(REACT_SRC_DIR)/jscexecutor/Android.mk
include $(REACT_SRC_DIR)/../hermes/reactexecutor/Android.mk

include $(REACT_SRC_DIR)/modules/blob/jni/Android.mk

0 comments on commit 865524d

Please sign in to comment.