* commit '3ba0b44aefe2ab170adf8e4232baa99a61df944f': Prevent monkey from turning off the screen.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user