diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2011-11-02 20:24:12 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2011-11-08 15:35:28 -0800 |
commit | 1baa142c06f3500f02dfc8d2fc15f5f70b77f3b0 (patch) | |
tree | 641527a23fe0a50a2170881d400294600ae923ab /cmds | |
parent | c7160d8dcb9861af67eea4b822889b3ce93be0b9 (diff) | |
download | android_development-1baa142c06f3500f02dfc8d2fc15f5f70b77f3b0.tar.gz android_development-1baa142c06f3500f02dfc8d2fc15f5f70b77f3b0.tar.bz2 android_development-1baa142c06f3500f02dfc8d2fc15f5f70b77f3b0.zip |
do not merge: cherry-picked Change-Id: I094dbc4ffa42771a13dfb796761546093649481c from master branch
Change-Id: Ia54463c93a7f941d7de3cc003ce773749d1f016e
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java index a9a06096c..4748a25c2 100644 --- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java +++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java @@ -492,14 +492,26 @@ public class MonkeySourceScript implements MonkeyEventSource { String cl_name = "com.google.android.powerutil.WakeUpScreen"; long deviceSleepTime = mDeviceSleepTime; + //Start the wakeUpScreen test activity to turn off the screen. ComponentName mApp = new ComponentName(pkg_name, cl_name); - MonkeyActivityEvent e1 = new MonkeyActivityEvent(mApp, deviceSleepTime); - mQ.addLast(e1); + mQ.addLast(new MonkeyActivityEvent(mApp, deviceSleepTime)); + + //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 //can continue after the device wake up. - MonkeyWaitEvent e2 = new MonkeyWaitEvent(deviceSleepTime + 3000); - mQ.addLast(e2); + mQ.addLast(new MonkeyWaitEvent(deviceSleepTime + 3000)); + + //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; } |