Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98a88141 authored by Guang Zhu's avatar Guang Zhu
Browse files

Prevent monkey from triggering bugreport

Change-Id: Ifa6f06f7dfa63b740352ad7388f33911649afcb0
parent 7b13c4d8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.R;
import com.android.internal.widget.LockPatternUtils;

import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -370,6 +371,11 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
                        new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                // don't actually trigger the bugreport if we are running stability
                                // tests via monkey
                                if (ActivityManager.isUserAMonkey()) {
                                    return;
                                }
                                // Add a little delay before executing, to give the
                                // dialog a chance to go away before it takes a
                                // screenshot.