Skip to content

Commit 1a13258

Browse files
Yu Shan Emily LauAndroid (Google) Code Review
authored andcommitted
Merge "Add the AUTOTEST_TEST_BEGIN_DELAY keyword to the scripted monkey which allow the power log to start 10 seconds after the event was send out." into froyo
2 parents 81b9c9d + 07aeb8c commit 1a13258

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmds/monkey/src/com/android/commands/monkey/MonkeyPowerEvent.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ public class MonkeyPowerEvent extends MonkeyEvent {
3737
private static ArrayList<ContentValues> mLogEvents = new ArrayList<ContentValues>();
3838
private static final String TEST_SEQ_BEGIN = "AUTOTEST_SEQUENCE_BEGIN";
3939
private static final String TEST_STARTED = "AUTOTEST_TEST_BEGIN";
40+
private static final String TEST_DELAY_STARTED = "AUTOTEST_TEST_BEGIN_DELAY";
4041
private static final String TEST_ENDED = "AUTOTEST_TEST_SUCCESS";
4142
private static final String TEST_IDLE_ENDED = "AUTOTEST_IDLE_SUCCESS";
4243
private static long mTestStartTime;
4344

4445
private String mPowerLogTag;
4546
private String mTestResult;
4647

48+
//10 secs for the screen to trun off after the usb notification
49+
private static final long USB_DELAY_TIME = 10000;
50+
4751
public MonkeyPowerEvent(String powerLogTag, String powerTestResult) {
4852
super(EVENT_TYPE_ACTIVITY);
4953
mPowerLogTag = powerLogTag;
@@ -74,6 +78,10 @@ private void bufferLogEvent(String tag, String value) {
7478
long lagTime = Long.parseLong(value);
7579
tagTime = mTestStartTime + lagTime;
7680
tag = TEST_ENDED;
81+
} else if (tag.compareTo(TEST_DELAY_STARTED) == 0) {
82+
mTestStartTime = tagTime + USB_DELAY_TIME;
83+
tagTime = mTestStartTime;
84+
tag = TEST_STARTED;
7785
}
7886

7987
ContentValues event = new ContentValues();

0 commit comments

Comments
 (0)