• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

development


Commit MetaInfo

Revisione0dfaf68b4710b88f45548b35404cff6be7b365e (tree)
Time2011-01-21 14:42:01
AuthorEd Heyl <edheyl@goog...>
CommiterAndroid Git Automerger

Log Message

am fd6a2b4d: Merge "Really don\'t send POWER or ENDCALL." into honeycomb

* commit 'fd6a2b4d2552f4a6179ac6f5f499e48310a8d813':

Really don't send POWER or ENDCALL.

Change Summary

Incremental Difference

--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
@@ -391,7 +391,7 @@ public class MonkeySourceRandom implements MonkeyEventSource {
391391 }
392392
393393 // The remaining event categories are injected as key events
394- do {
394+ for (;;) {
395395 if (cls < mFactors[FACTOR_NAV]) {
396396 lastKey = NAV_KEYS[mRandom.nextInt(NAV_KEYS.length)];
397397 } else if (cls < mFactors[FACTOR_MAJORNAV]) {
@@ -412,11 +412,12 @@ public class MonkeySourceRandom implements MonkeyEventSource {
412412 lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
413413 }
414414
415- if (lastKey == KeyEvent.KEYCODE_POWER || lastKey == KeyEvent.KEYCODE_ENDCALL) {
416- // Make sure we don't inadvertently turn off the device.
417- continue;
415+ if (lastKey != KeyEvent.KEYCODE_POWER
416+ && lastKey != KeyEvent.KEYCODE_ENDCALL
417+ && PHYSICAL_KEY_EXISTS[lastKey]) {
418+ break;
418419 }
419- } while (!PHYSICAL_KEY_EXISTS[lastKey]);
420+ }
420421
421422 MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);
422423 mQ.addLast(e);