am eddcd118: Merge "Prevent monkey from turning off the screen." into honeycomb

* commit 'eddcd1186b05b9b425ae765e98882a1815e3ac4d':
  Prevent monkey from turning off the screen.
This commit is contained in:
Jeff Brown
2011-01-19 19:59:04 -08:00
committed by Android Git Automerger

View File

@@ -411,6 +411,11 @@ public class MonkeySourceRandom implements MonkeyEventSource {
} else {
lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
}
if (lastKey == KeyEvent.KEYCODE_POWER || lastKey == KeyEvent.KEYCODE_ENDCALL) {
// Make sure we don't inadvertently turn off the device.
continue;
}
} while (!PHYSICAL_KEY_EXISTS[lastKey]);
MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);