add cmd+opt+ctrl+D to globally invoke dev menu for Android
Reviewed By: frantic Differential Revision: D5280788 fbshipit-source-id: ce11d122ee17a2ba8d8aa2e91fc6639610791577
This commit is contained in:
parent
a2b0ee0fc3
commit
01adc71ade
|
@ -98,6 +98,7 @@ public class DevServerHelper {
|
||||||
|
|
||||||
public interface PackagerCommandListener {
|
public interface PackagerCommandListener {
|
||||||
void onPackagerReloadCommand();
|
void onPackagerReloadCommand();
|
||||||
|
void onPackagerDevMenuCommand();
|
||||||
void onCaptureHeapCommand(final Responder responder);
|
void onCaptureHeapCommand(final Responder responder);
|
||||||
void onPokeSamplingProfilerCommand(final Responder responder);
|
void onPokeSamplingProfilerCommand(final Responder responder);
|
||||||
}
|
}
|
||||||
|
@ -145,6 +146,12 @@ public class DevServerHelper {
|
||||||
commandListener.onPackagerReloadCommand();
|
commandListener.onPackagerReloadCommand();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
handlers.put("devMenu", new NotificationOnlyHandler() {
|
||||||
|
@Override
|
||||||
|
public void onNotification(@Nullable Object params) {
|
||||||
|
commandListener.onPackagerDevMenuCommand();
|
||||||
|
}
|
||||||
|
});
|
||||||
handlers.put("captureHeap", new RequestOnlyHandler() {
|
handlers.put("captureHeap", new RequestOnlyHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequest(@Nullable Object params, Responder responder) {
|
public void onRequest(@Nullable Object params, Responder responder) {
|
||||||
|
|
|
@ -682,6 +682,16 @@ public class DevSupportManagerImpl implements
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPackagerDevMenuCommand() {
|
||||||
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
showDevOptionsDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCaptureHeapCommand(final Responder responder) {
|
public void onCaptureHeapCommand(final Responder responder) {
|
||||||
UiThreadUtil.runOnUiThread(new Runnable() {
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
||||||
|
|
Loading…
Reference in New Issue