本文链接:http://blog.csdn.net/yimi1400488193/article/details/51889997
直接上MonkeySourceRandom类部分代码:
public MonkeySourceRandom(Random random, ArrayList<ComponentName> MainApps,
long throttle, boolean randomizeThrottle) {
// default values for random distributions
// note, these are straight percentages, to match user input (cmd line args)
// but they will be converted to 0..1 values before the main loop runs.
mFactors[FACTOR_TOUCH] = 15.0f;
mFactors[FACTOR_MOTION] = 10.0f;
mFactors[FACTOR_TRACKBALL] = 15.0f;
// Adjust the values if we want to enable rotation by default.
mFactors[FACTOR_ROTATION] = 0.0f;
mFactors[FACTOR_NAV] = 25.0f;
mFactors[FACTOR_MAJORNAV] = 15.0f;
mFactors[FACTOR_SYSOPS] = 2.0f;
mFactors[FACTOR_APPSWITCH] = 2.0f;
mFactors[FACTOR_FLIP] = 1.0f;
mFactors[FACTOR_ANYTHING] = 13.0f;
mFactors[FACTOR_PINCHZOOM] = 2.0f;
mRandom = random;
mMainApps = MainApps;
mQ = new MonkeyEventQueue(random, throttle, randomizeThrottle);
}
/**