Really don't send POWER or ENDCALL.
Change-Id: If55c6bc7565a9a6b493da16fac5c7ad3c621684f
This commit is contained in:
@@ -391,7 +391,7 @@ public class MonkeySourceRandom implements MonkeyEventSource {
|
||||
}
|
||||
|
||||
// The remaining event categories are injected as key events
|
||||
do {
|
||||
for (;;) {
|
||||
if (cls < mFactors[FACTOR_NAV]) {
|
||||
lastKey = NAV_KEYS[mRandom.nextInt(NAV_KEYS.length)];
|
||||
} else if (cls < mFactors[FACTOR_MAJORNAV]) {
|
||||
@@ -412,11 +412,12 @@ public class MonkeySourceRandom implements MonkeyEventSource {
|
||||
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;
|
||||
if (lastKey != KeyEvent.KEYCODE_POWER
|
||||
&& lastKey != KeyEvent.KEYCODE_ENDCALL
|
||||
&& PHYSICAL_KEY_EXISTS[lastKey]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (!PHYSICAL_KEY_EXISTS[lastKey]);
|
||||
|
||||
MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);
|
||||
mQ.addLast(e);
|
||||
|
||||
Reference in New Issue
Block a user