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
|
// The remaining event categories are injected as key events
|
||||||
do {
|
for (;;) {
|
||||||
if (cls < mFactors[FACTOR_NAV]) {
|
if (cls < mFactors[FACTOR_NAV]) {
|
||||||
lastKey = NAV_KEYS[mRandom.nextInt(NAV_KEYS.length)];
|
lastKey = NAV_KEYS[mRandom.nextInt(NAV_KEYS.length)];
|
||||||
} else if (cls < mFactors[FACTOR_MAJORNAV]) {
|
} else if (cls < mFactors[FACTOR_MAJORNAV]) {
|
||||||
@@ -412,11 +412,12 @@ public class MonkeySourceRandom implements MonkeyEventSource {
|
|||||||
lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
|
lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastKey == KeyEvent.KEYCODE_POWER || lastKey == KeyEvent.KEYCODE_ENDCALL) {
|
if (lastKey != KeyEvent.KEYCODE_POWER
|
||||||
// Make sure we don't inadvertently turn off the device.
|
&& lastKey != KeyEvent.KEYCODE_ENDCALL
|
||||||
continue;
|
&& PHYSICAL_KEY_EXISTS[lastKey]) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} while (!PHYSICAL_KEY_EXISTS[lastKey]);
|
}
|
||||||
|
|
||||||
MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);
|
MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);
|
||||||
mQ.addLast(e);
|
mQ.addLast(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user