Permalink
Browse files

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...
1 parent 7991d12 commit 9a8b5d9f4f860f16d0845d537f80bfd2f515ee93 @rigdern rigdern committed with Facebook Github Bot Nov 15, 2016
@@ -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;
@@ -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<>();

0 comments on commit 9a8b5d9

Please sign in to comment.