Prevent monkey from turning off the screen.
Bug: 3371251 Change-Id: Iadae29e8e4a67052746b8e2d2f5f542e4ee6dcc5
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