am 6b415b7d: Merge "do not merge: cherry-picked Change-Id: I094dbc4ffa42771a13dfb796761546093649481c from master branch" into ics-mr0
* commit '6b415b7d0530151ffa3221594102a6752a539692': do not merge: cherry-picked Change-Id: I094dbc4ffa42771a13dfb796761546093649481c from master branch
This commit is contained in:
@@ -492,14 +492,26 @@ public class MonkeySourceScript implements MonkeyEventSource {
|
|||||||
String cl_name = "com.google.android.powerutil.WakeUpScreen";
|
String cl_name = "com.google.android.powerutil.WakeUpScreen";
|
||||||
long deviceSleepTime = mDeviceSleepTime;
|
long deviceSleepTime = mDeviceSleepTime;
|
||||||
|
|
||||||
|
//Start the wakeUpScreen test activity to turn off the screen.
|
||||||
ComponentName mApp = new ComponentName(pkg_name, cl_name);
|
ComponentName mApp = new ComponentName(pkg_name, cl_name);
|
||||||
MonkeyActivityEvent e1 = new MonkeyActivityEvent(mApp, deviceSleepTime);
|
mQ.addLast(new MonkeyActivityEvent(mApp, deviceSleepTime));
|
||||||
mQ.addLast(e1);
|
|
||||||
|
//inject the special key for the wakeUpScreen test activity.
|
||||||
|
mQ.addLast(new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_0));
|
||||||
|
mQ.addLast(new MonkeyKeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_0));
|
||||||
|
|
||||||
//Add the wait event after the device sleep event so that the monkey
|
//Add the wait event after the device sleep event so that the monkey
|
||||||
//can continue after the device wake up.
|
//can continue after the device wake up.
|
||||||
MonkeyWaitEvent e2 = new MonkeyWaitEvent(deviceSleepTime + 3000);
|
mQ.addLast(new MonkeyWaitEvent(deviceSleepTime + 3000));
|
||||||
mQ.addLast(e2);
|
|
||||||
|
//Insert the menu key to unlock the screen
|
||||||
|
mQ.addLast(new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MENU));
|
||||||
|
mQ.addLast(new MonkeyKeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_MENU));
|
||||||
|
|
||||||
|
//Insert the back key to dismiss the test activity
|
||||||
|
mQ.addLast(new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
|
||||||
|
mQ.addLast(new MonkeyKeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user