diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java index 1767bd123..5b0bce641 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java @@ -98,6 +98,7 @@ public class DevServerHelper { public interface PackagerCommandListener { void onPackagerReloadCommand(); + void onPackagerDevMenuCommand(); void onCaptureHeapCommand(final Responder responder); void onPokeSamplingProfilerCommand(final Responder responder); } @@ -145,6 +146,12 @@ public class DevServerHelper { commandListener.onPackagerReloadCommand(); } }); + handlers.put("devMenu", new NotificationOnlyHandler() { + @Override + public void onNotification(@Nullable Object params) { + commandListener.onPackagerDevMenuCommand(); + } + }); handlers.put("captureHeap", new RequestOnlyHandler() { @Override public void onRequest(@Nullable Object params, Responder responder) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java index 4f0b422d3..74fc0794b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java @@ -682,6 +682,16 @@ public class DevSupportManagerImpl implements }); } + @Override + public void onPackagerDevMenuCommand() { + UiThreadUtil.runOnUiThread(new Runnable() { + @Override + public void run() { + showDevOptionsDialog(); + } + }); + } + @Override public void onCaptureHeapCommand(final Responder responder) { UiThreadUtil.runOnUiThread(new Runnable() {