Skip to content

Commit 60dc137

Browse files
author
Ying Wang
committed
resolved conflicts for merge of e3b115d to master
2 parents 8cb8766 + e3b115d commit 60dc137

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import android.os.Process;
2929
import android.os.RemoteException;
3030
import android.os.ServiceManager;
31+
import android.os.SystemProperties;
3132
import android.view.IWindowManager;
3233

3334
import java.io.BufferedReader;
@@ -336,6 +337,15 @@ private void commandLineReport(String reportName, String command) {
336337
* @param args The command-line arguments
337338
*/
338339
public static void main(String[] args) {
340+
// Tell the system that Monkey is running.
341+
SystemProperties.set("monkey.running", "true");
342+
// Add a hook to tell the system that Monkey has finished running.
343+
Runtime.getRuntime().addShutdownHook(new Thread() {
344+
public void run() {
345+
SystemProperties.set("monkey.running", null);
346+
}
347+
});
348+
339349
int resultCode = (new Monkey()).run(args);
340350
System.exit(resultCode);
341351
}

0 commit comments

Comments
 (0)