Skip to content

Commit

Permalink
add cmd+opt+ctrl+D to globally invoke dev menu for Android
Browse files Browse the repository at this point in the history
Reviewed By: frantic

Differential Revision: D5280788

fbshipit-source-id: ce11d122ee17a2ba8d8aa2e91fc6639610791577
  • Loading branch information
Yu-w authored and facebook-github-bot committed Jun 21, 2017
1 parent a2b0ee0 commit 01adc71
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public interface OnServerContentChangeListener {

public interface PackagerCommandListener {
void onPackagerReloadCommand();
void onPackagerDevMenuCommand();
void onCaptureHeapCommand(final Responder responder);
void onPokeSamplingProfilerCommand(final Responder responder);
}
Expand Down Expand Up @@ -145,6 +146,12 @@ public void onNotification(@Nullable Object params) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,16 @@ public void run() {
});
}

@Override
public void onPackagerDevMenuCommand() {
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
public void run() {
showDevOptionsDialog();
}
});
}

@Override
public void onCaptureHeapCommand(final Responder responder) {
UiThreadUtil.runOnUiThread(new Runnable() {
Expand Down

0 comments on commit 01adc71

Please sign in to comment.