mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 22:42:05 +08:00
Disable SamplingProfiler for OSS builds
Summary: It depends on symbols that are not available. Closes https://github.com/facebook/react-native/pull/13950 Reviewed By: cwdick Differential Revision: D5053724 Pulled By: javache fbshipit-source-id: 9d5676ce5e4ad3ceeb20aeb8c48429319d48799e
This commit is contained in:
committed by
Facebook Github Bot
parent
2f5524d04e
commit
0c1e009ad9
@@ -45,7 +45,7 @@ import com.facebook.react.devsupport.interfaces.StackFrame;
|
||||
import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
|
||||
import com.facebook.react.packagerconnection.JSPackagerClient;
|
||||
import com.facebook.react.packagerconnection.Responder;
|
||||
import com.facebook.react.packagerconnection.SamplingProfilerPackagerMethod;
|
||||
import com.facebook.react.packagerconnection.RequestHandler;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -699,9 +699,14 @@ public class DevSupportManagerImpl implements
|
||||
responder.error("JSCContext is missing, unable to profile");
|
||||
return;
|
||||
}
|
||||
SamplingProfilerPackagerMethod method =
|
||||
new SamplingProfilerPackagerMethod(mCurrentContext.getJavaScriptContext());
|
||||
method.onRequest(null, responder);
|
||||
try {
|
||||
long jsContext = mCurrentContext.getJavaScriptContext();
|
||||
Class clazz = Class.forName("com.facebook.react.packagerconnection.SamplingProfilerPackagerMethod");
|
||||
RequestHandler handler = (RequestHandler)clazz.getConstructor(long.class).newInstance(jsContext);
|
||||
handler.onRequest(null, responder);
|
||||
} catch (Exception e) {
|
||||
// Module not present
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ include_defs("//ReactAndroid/DEFS")
|
||||
|
||||
android_library(
|
||||
name = "packagerconnection",
|
||||
srcs = glob(["**/*.java"]),
|
||||
srcs = glob(
|
||||
["**/*.java"],
|
||||
excludes = ["SamplingProfilerPackagerMethod.java"] if IS_OSS_BUILD else [],
|
||||
),
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
@@ -17,6 +20,5 @@ android_library(
|
||||
react_native_dep("third-party/java/okhttp:okhttp3-ws"),
|
||||
react_native_dep("third-party/java/okio:okio"),
|
||||
react_native_target("java/com/facebook/react/modules/systeminfo:systeminfo-moduleless"),
|
||||
react_native_target("jni/packagerconnection:jni"),
|
||||
],
|
||||
] + ([react_native_target("jni/packagerconnection:jni")] if not IS_OSS_BUILD else []),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user