diff options
| author | Brian Muramatsu <btmura@google.com> | 2012-10-09 19:18:57 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-09 19:18:57 -0700 |
| commit | c200e94ff5090baf96b320c3783e963ddf1ac6e1 (patch) | |
| tree | 9baf2f86bf2a9569bba5155124d816c2defd60ee /cmds | |
| parent | 652538d6afa2474820382be393e3a748723a9f1a (diff) | |
| parent | ab8b25ff8ec856f490f5bbb95240c8fc0d24ba43 (diff) | |
| download | android_development-c200e94ff5090baf96b320c3783e963ddf1ac6e1.tar.gz android_development-c200e94ff5090baf96b320c3783e963ddf1ac6e1.tar.bz2 android_development-c200e94ff5090baf96b320c3783e963ddf1ac6e1.zip | |
am ab8b25ff: am 03c58239: am c6fbad00: Merge "Make all monkeys do the same thing" into jb-mr1-dev
* commit 'ab8b25ff8ec856f490f5bbb95240c8fc0d24ba43':
Make all monkeys do the same thing
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/monkey/src/com/android/commands/monkey/Monkey.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java b/cmds/monkey/src/com/android/commands/monkey/Monkey.java index c8a480fd6..5e86a79c8 100644 --- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java +++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java @@ -516,6 +516,10 @@ public class Monkey { mMainCategories.add(Intent.CATEGORY_MONKEY); } + if (mSeed == 0) { + mSeed = System.currentTimeMillis() + System.identityHashCode(this); + } + if (mVerbose > 0) { System.out.println(":Monkey: seed=" + mSeed + " count=" + mCount); if (mValidPackages.size() > 0) { @@ -550,8 +554,7 @@ public class Monkey { return -4; } - mRandom = new SecureRandom(); - mRandom.setSeed((mSeed == 0) ? -1 : mSeed); + mRandom = new Random(mSeed); if (mScriptFileNames != null && mScriptFileNames.size() == 1) { // script mode, ignore other options |
