Skip to content

Commit ba5df0d

Browse files
guang-googleAndroid (Google) Code Review
authored andcommitted
Merge "Prevent monkey from triggering bugreport" into lmp-dev
2 parents d867b7c + 98a8814 commit ba5df0d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

policy/src/com/android/internal/policy/impl/GlobalActions.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.android.internal.R;
2424
import com.android.internal.widget.LockPatternUtils;
2525

26+
import android.app.ActivityManager;
2627
import android.app.ActivityManagerNative;
2728
import android.app.AlertDialog;
2829
import android.app.Dialog;
@@ -370,6 +371,11 @@ public void onPress() {
370371
new DialogInterface.OnClickListener() {
371372
@Override
372373
public void onClick(DialogInterface dialog, int which) {
374+
// don't actually trigger the bugreport if we are running stability
375+
// tests via monkey
376+
if (ActivityManager.isUserAMonkey()) {
377+
return;
378+
}
373379
// Add a little delay before executing, to give the
374380
// dialog a chance to go away before it takes a
375381
// screenshot.

0 commit comments

Comments
 (0)