Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Android: Disable debug menu when monkey is running
Summary:
When testing an app on Android using the monkey, the monkey shouldn't be able to open or interact with the dev menu.

**Test plan (required)**

My team uses this change in our app.

Adam Comella
Microsoft Corp.
Closes #10901

Differential Revision: D4176167

Pulled By: ericvicenti

fbshipit-source-id: 8eb64715ae7496cdf957ee963777f66ab358546c
  • Loading branch information
Adam Comella authored and Facebook Github Bot committed Nov 15, 2016
1 parent 7991d12 commit 9a8b5d9
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -22,6 +22,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
Expand Down Expand Up @@ -334,7 +335,7 @@ public void run() {

@Override
public void showDevOptionsDialog() {
if (mDevOptionsDialog != null || !mIsDevSupportEnabled) {
if (mDevOptionsDialog != null || !mIsDevSupportEnabled || ActivityManager.isUserAMonkey()) {
return;
}
LinkedHashMap<String, DevOptionHandler> options = new LinkedHashMap<>();
Expand Down

0 comments on commit 9a8b5d9

Please sign in to comment.