mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Forward VM version to inspector
Reviewed By: bnham Differential Revision: D6938018 fbshipit-source-id: c79853ddf835acab86a16ebd539874d29d3aa60a
This commit is contained in:
committed by
Facebook Github Bot
parent
b1d8af48ae
commit
ad2d9e7fab
@@ -51,6 +51,7 @@ public class Inspector {
|
||||
public static class Page {
|
||||
private final int mId;
|
||||
private final String mTitle;
|
||||
private final String mVM;
|
||||
|
||||
public int getId() {
|
||||
return mId;
|
||||
@@ -60,6 +61,10 @@ public class Inspector {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
public String getVM() {
|
||||
return mVM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Page{" +
|
||||
@@ -69,9 +74,10 @@ public class Inspector {
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
private Page(int id, String title) {
|
||||
private Page(int id, String title, String vm) {
|
||||
mId = id;
|
||||
mTitle = title;
|
||||
mVM = vm;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -154,6 +154,7 @@ public class InspectorPackagerConnection {
|
||||
jsonPage.put("id", String.valueOf(page.getId()));
|
||||
jsonPage.put("title", page.getTitle());
|
||||
jsonPage.put("app", mPackageName);
|
||||
jsonPage.put("vm", page.getVM());
|
||||
jsonPage.put("isLastBundleDownloadSuccess", bundleStatus.isLastDownloadSucess);
|
||||
jsonPage.put("bundleUpdateTimestamp", bundleStatus.updateTimestamp);
|
||||
array.put(jsonPage);
|
||||
|
||||
@@ -28,9 +28,9 @@ private:
|
||||
|
||||
}
|
||||
|
||||
jni::local_ref<JPage::javaobject> JPage::create(int id, const std::string& title) {
|
||||
static auto constructor = javaClassStatic()->getConstructor<JPage::javaobject(jint, jni::local_ref<jni::JString>)>();
|
||||
return javaClassStatic()->newObject(constructor, id, jni::make_jstring(title));
|
||||
jni::local_ref<JPage::javaobject> JPage::create(int id, const std::string& title, const std::string& vm) {
|
||||
static auto constructor = javaClassStatic()->getConstructor<JPage::javaobject(jint, jni::local_ref<jni::JString>, jni::local_ref<jni::JString>)>();
|
||||
return javaClassStatic()->newObject(constructor, id, jni::make_jstring(title), jni::make_jstring(vm));
|
||||
}
|
||||
|
||||
void JRemoteConnection::onMessage(const std::string& message) const {
|
||||
@@ -70,7 +70,7 @@ jni::local_ref<jni::JArrayClass<JPage::javaobject>> JInspector::getPages() {
|
||||
std::vector<InspectorPage> pages = inspector_->getPages();
|
||||
auto array = jni::JArrayClass<JPage::javaobject>::newArray(pages.size());
|
||||
for (size_t i = 0; i < pages.size(); i++) {
|
||||
(*array)[i] = JPage::create(pages[i].id, pages[i].title);
|
||||
(*array)[i] = JPage::create(pages[i].id, pages[i].title, pages[i].vm);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class JPage : public jni::JavaClass<JPage> {
|
||||
public:
|
||||
static constexpr auto kJavaDescriptor = "Lcom/facebook/react/bridge/Inspector$Page;";
|
||||
|
||||
static jni::local_ref<JPage::javaobject> create(int id, const std::string& title);
|
||||
static jni::local_ref<JPage::javaobject> create(int id, const std::string& title, const std::string& vm);
|
||||
};
|
||||
|
||||
class JRemoteConnection : public jni::JavaClass<JRemoteConnection> {
|
||||
|
||||
Reference in New Issue
Block a user